Class AbstractNumberEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- com.inductiveautomation.factorypmi.designer.property.editors.bb.SwingEditorSupport
-
- com.inductiveautomation.factorypmi.designer.property.editors.ConfiguratorEditorSupport
-
- com.inductiveautomation.factorypmi.designer.property.editors.AbstractNumberEditor
-
- All Implemented Interfaces:
BindablePropertyEditor,java.beans.PropertyEditor
- Direct Known Subclasses:
DoubleEditor,FloatEditor,IntegerEditor,LongEditor,ShortEditor
public abstract class AbstractNumberEditor extends ConfiguratorEditorSupport
This abstract editor is the basis for the numeric editors. It handles nulls, which it represents as empty string.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractNumberEditor.NullAcceptableNumberFormatter
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.JFormattedTextFieldformattedTextField-
Fields inherited from class com.inductiveautomation.factorypmi.designer.property.editors.ConfiguratorEditorSupport
addGlue
-
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 AbstractNumberEditor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.ObjectextractSubtype(java.lang.Number number)Return the right kind of number here.java.lang.ObjectgetValue()protected voidinitComponents()This is where you can add your own components to the "panel" field.protected abstract java.text.NumberFormatnewNumberFormat()Override to provide the correct number format for your typevoidsetValue(java.lang.Object value)-
Methods inherited from class com.inductiveautomation.factorypmi.designer.property.editors.ConfiguratorEditorSupport
createDynamicOptsButton, init, isBindableEnabled, setBindableEnabled
-
Methods inherited from class com.inductiveautomation.factorypmi.designer.property.editors.bb.SwingEditorSupport
getBean, getContext, getCustomEditor, getFPMIContext, getPropertyName, init, isCanceled, setAlignment, supportsCustomEditor
-
-
-
-
Method Detail
-
newNumberFormat
protected abstract java.text.NumberFormat newNumberFormat()
Override to provide the correct number format for your type
-
extractSubtype
protected abstract java.lang.Object extractSubtype(java.lang.Number number)
Return the right kind of number here.- Parameters:
number- Will never be null.- Returns:
- The correct kind of number, for example, a Double
-
setValue
public void setValue(java.lang.Object value)
- Specified by:
setValuein interfacejava.beans.PropertyEditor- Overrides:
setValuein classjava.beans.PropertyEditorSupport
-
initComponents
protected void initComponents()
Description copied from class:ConfiguratorEditorSupportThis is where you can add your own components to the "panel" field. It has a box layout and the binding button will be added after this method is called.- Specified by:
initComponentsin classConfiguratorEditorSupport
-
getValue
public java.lang.Object getValue()
- Specified by:
getValuein interfacejava.beans.PropertyEditor- Overrides:
getValuein classjava.beans.PropertyEditorSupport
-
-