com.togethersoft.openapi.ide.inspector.util.editors
Class SwingComboBoxEditor
java.lang.Object
|
+--java.beans.PropertyEditorSupport
|
+--com.togethersoft.openapi.ide.inspector.util.editors.SwingEditorSupport
|
+--com.togethersoft.openapi.ide.inspector.util.editors.SwingComboBoxEditor
- public class SwingComboBoxEditor
- extends SwingEditorSupport
Represents editor on the base of MutableComboBox.
- Author:
- TogetherSoft
| Constructor Summary |
SwingComboBoxEditor() Creates ComboBox with the default mutable model and without lists of the visible names and icons. |
SwingComboBoxEditor(MutableComboBoxModel model) Creates ComboBox with the lists of the visible names and icons. |
SwingComboBoxEditor(MutableComboBoxModel model, String[] visibleNames, String[] iconNames) Creates ComboBox with the custom model, list of visible names and icons names. |
| Method Summary |
ComboBoxModel | getModel() Returns model of this ComboBox. |
Object | getValue() Returns selected item. |
Object | getVisibleName(Object value) Fetches visible name from this ComboBox by given key. |
boolean | isValueEditable() Checks whether it is possible to edit values in this ComboBox. |
void | setValue(Object obj) Specifies current value (selected item) for this ComboBox. |
void | setValueEditable(boolean b) Enables/disables ability to edit values of this ComboBox. |
| Methods inherited from class java.beans.PropertyEditorSupport |
isPaintable, paintValue, getJavaInitializationString, getAsText, setAsText, getTags, addPropertyChangeListener, removePropertyChangeListener, firePropertyChange |
| Methods inherited from class java.lang.Object |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize |
SwingComboBoxEditor
public SwingComboBoxEditor()
- Creates ComboBox with the default mutable model and without lists of the visible names and icons.
SwingComboBoxEditor
public SwingComboBoxEditor(MutableComboBoxModel model)
- Creates ComboBox with the lists of the visible names and icons.
SwingComboBoxEditor
public SwingComboBoxEditor(MutableComboBoxModel model, String[] visibleNames, String[] iconNames)
- Creates ComboBox with the custom model, list of visible names and icons names.
getModel
public ComboBoxModel getModel()
- Returns model of this ComboBox.
getValue
public Object getValue()
- Returns selected item. If this ComboBox is editable then fetches value from the editor.
getVisibleName
public Object getVisibleName(Object value)
- Fetches visible name from this ComboBox by given key.
- Parameters:
- value - key (index) of visible value in this ComboBox
- Returns: if value = null then returns first element in this ComboBox; if this ComboBox has visible name with
the specified key then this method returns it, if not - returns given key
isValueEditable
public boolean isValueEditable()
- Checks whether it is possible to edit values in this ComboBox.
- Returns: true of so, false otherwise
setValue
public void setValue(Object obj)
- Specifies current value (selected item) for this ComboBox. If value is null then the selected item will be the first value.
If ComboBox is empty then does nothing.
setValueEditable
public void setValueEditable(boolean b)
- Enables/disables ability to edit values of this ComboBox.
- Parameters:
- b - if true then editing is enabled and new item with empty value is appended for editing into this ComboBox
to Class javax.swing.JComboBox
to Class java.util.Map
to Class java.util.Map