Class SwingEnumEditor
java.lang.Object
java.beans.PropertyEditorSupport
com.inductiveautomation.factorypmi.designer.property.editors.bb.SwingEditorSupport
com.inductiveautomation.factorypmi.designer.property.editors.bb.SwingEnumEditor
- All Implemented Interfaces:
BindablePropertyEditor,ActionListener,PropertyEditor,EventListener
public class SwingEnumEditor
extends SwingEditorSupport
implements ActionListener, BindablePropertyEditor
A property editor for a swing enumerated type. Handles the case in which the PropertyDescriptor has a value for
"enumerationValues". Note: the init() method must be called before the set/get methods can be called.
-
Field Summary
FieldsFields inherited from class com.inductiveautomation.factorypmi.designer.property.editors.bb.SwingEditorSupport
bean, BUTTON_MARGIN, canceled, fpmi, LARGE_DIMENSION, MEDIUM_DIMENSION, modelColumn, modelRow, panel, propertyName, SMALL_DIMENSION, tableModel, TINY_DIMENSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEvent is set when a combo selection changes.protected voidinit(FeatureDescriptor descriptor) Initializes this property editor with the enumerated items.booleanvoidsetBindableEnabled(boolean b) voidMethods inherited from class com.inductiveautomation.factorypmi.designer.property.editors.bb.SwingEditorSupport
getBean, getContext, getCustomEditor, getFPMIContext, getPropertyName, init, isCanceled, setAlignment, supportsCustomEditorMethods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getJavaInitializationString, getSource, getTags, getValue, isPaintable, paintValue, removePropertyChangeListener, setAsText, setSource
-
Field Details
-
combobox
-
-
Constructor Details
-
SwingEnumEditor
public SwingEnumEditor()
-
-
Method Details
-
setValue
- Specified by:
setValuein interfacePropertyEditor- Overrides:
setValuein classPropertyEditorSupport
-
init
Initializes this property editor with the enumerated items. Instances can be shared but there are issues.This method does a lot of jiggery pokery since enumerated types are unlike any other homogenous types. Enumerated types may not represent the same set of values.
One method would be to empty the list of values which would have the side effect of firing notification events. Another method would be to recreate the combobox.
- Overrides:
initin classSwingEditorSupport
-
actionPerformed
Event is set when a combo selection changes.- Specified by:
actionPerformedin interfaceActionListener
-
isBindableEnabled
public boolean isBindableEnabled()- Specified by:
isBindableEnabledin interfaceBindablePropertyEditor
-
setBindableEnabled
public void setBindableEnabled(boolean b) - Specified by:
setBindableEnabledin interfaceBindablePropertyEditor
-