| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
| HistoryComboBoxEditor |
|
| 1.1111111111111112;1.111 |
| 1 | /* |
|
| 2 | * $Id: HistoryComboBoxEditor.java,v 1.1 2006/04/23 16:31:33 edankert Exp $ |
|
| 3 | * |
|
| 4 | * The contents of this file are subject to the Mozilla Public License |
|
| 5 | * Version 1.1 (the "License"); you may not use this file except in |
|
| 6 | * compliance with the License. You may obtain a copy of the License at |
|
| 7 | * http://www.mozilla.org/MPL/ |
|
| 8 | * |
|
| 9 | * Software distributed under the License is distributed on an "AS IS" basis, |
|
| 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
|
| 11 | * for the specific language governing rights and limitations under the License. |
|
| 12 | * |
|
| 13 | * The Original Code is XML Hammer code. (org.xmlhammer.*) |
|
| 14 | * |
|
| 15 | * The Initial Developer of the Original Code is Edwin Dankert. Portions created |
|
| 16 | * by the Initial Developer are Copyright (C) 2005 - 2006 the Initial Developer. |
|
| 17 | * All Rights Reserved. |
|
| 18 | * |
|
| 19 | * Contributor(s): Edwin Dankert <edankert@gmail.com> |
|
| 20 | */ |
|
| 21 | package org.xmlhammer.gui.history; |
|
| 22 | ||
| 23 | import java.awt.Component; |
|
| 24 | import java.awt.event.ActionListener; |
|
| 25 | ||
| 26 | import javax.swing.ComboBoxEditor; |
|
| 27 | ||
| 28 | class HistoryComboBoxEditor implements ComboBoxEditor { |
|
| 29 | 7876 | private ComboBoxEditor parent = null; |
| 30 | 7876 | boolean changable = true; |
| 31 | ||
| 32 | 7876 | public HistoryComboBoxEditor(ComboBoxEditor parent) { |
| 33 | 7876 | this.parent = parent; |
| 34 | 7876 | } |
| 35 | ||
| 36 | public Component getEditorComponent() { |
|
| 37 | 69786 | return parent.getEditorComponent(); |
| 38 | } |
|
| 39 | ||
| 40 | public void setChangable(boolean changable) { |
|
| 41 | 0 | this.changable = changable; |
| 42 | 0 | } |
| 43 | ||
| 44 | public boolean isChangable() { |
|
| 45 | 0 | return changable; |
| 46 | } |
|
| 47 | ||
| 48 | public void setItem(Object item) { |
|
| 49 | 16522 | if ( changable) { |
| 50 | 16522 | parent.setItem(item); |
| 51 | } |
|
| 52 | 16522 | } |
| 53 | ||
| 54 | public Object getItem() { |
|
| 55 | 44194 | return parent.getItem(); |
| 56 | } |
|
| 57 | ||
| 58 | public void selectAll() { |
|
| 59 | 0 | parent.selectAll(); |
| 60 | 0 | } |
| 61 | ||
| 62 | public void addActionListener(ActionListener listener) { |
|
| 63 | 15752 | parent.addActionListener(listener); |
| 64 | 15752 | } |
| 65 | ||
| 66 | public void removeActionListener(ActionListener listener) { |
|
| 67 | 7876 | parent.removeActionListener(listener); |
| 68 | 7876 | } |
| 69 | } |