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 TypeMethodDescriptionvoid
Event is set when a combo selection changes.protected void
init
(FeatureDescriptor descriptor) Initializes this property editor with the enumerated items.boolean
void
setBindableEnabled
(boolean b) void
Methods inherited from class com.inductiveautomation.factorypmi.designer.property.editors.bb.SwingEditorSupport
getBean, getContext, getCustomEditor, getFPMIContext, getPropertyName, init, isCanceled, setAlignment, supportsCustomEditor
Methods 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:
setValue
in interfacePropertyEditor
- Overrides:
setValue
in 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:
init
in classSwingEditorSupport
-
actionPerformed
Event is set when a combo selection changes.- Specified by:
actionPerformed
in interfaceActionListener
-
isBindableEnabled
public boolean isBindableEnabled()- Specified by:
isBindableEnabled
in interfaceBindablePropertyEditor
-
setBindableEnabled
public void setBindableEnabled(boolean b) - Specified by:
setBindableEnabled
in interfaceBindablePropertyEditor
-