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
,java.awt.event.ActionListener
,java.beans.PropertyEditor
,java.util.EventListener
public class SwingEnumEditor extends SwingEditorSupport implements java.awt.event.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
Fields Modifier and Type Field Description javax.swing.JComboBox
combobox
-
Fields 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 Constructor Description SwingEnumEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent evt)
Event is set when a combo selection changes.protected void
init(java.beans.FeatureDescriptor descriptor)
Initializes this property editor with the enumerated items.boolean
isBindableEnabled()
void
setBindableEnabled(boolean b)
void
setValue(java.lang.Object value)
-
Methods inherited from class com.inductiveautomation.factorypmi.designer.property.editors.bb.SwingEditorSupport
getBean, getContext, getCustomEditor, getFPMIContext, getPropertyName, init, isCanceled, setAlignment, supportsCustomEditor
-
-
-
-
Method Detail
-
setValue
public void setValue(java.lang.Object value)
- Specified by:
setValue
in interfacejava.beans.PropertyEditor
- Overrides:
setValue
in classjava.beans.PropertyEditorSupport
-
init
protected void init(java.beans.FeatureDescriptor descriptor)
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
public void actionPerformed(java.awt.event.ActionEvent evt)
Event is set when a combo selection changes.- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
isBindableEnabled
public boolean isBindableEnabled()
- Specified by:
isBindableEnabled
in interfaceBindablePropertyEditor
-
setBindableEnabled
public void setBindableEnabled(boolean b)
- Specified by:
setBindableEnabled
in interfaceBindablePropertyEditor
-
-