Class FormMeta
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.localdb.persistence.FormMeta
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<FormMeta>
public class FormMeta extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<FormMeta>
This class encapsulates all of the additional information that we add to each persistent field so that we can automatically create web UIs that deal with the fields.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FormMeta.IExtendedDescriptionSource
-
Field Summary
Fields Modifier and Type Field Description protected Category
category
The category that the field belongs to.protected boolean
enabled
Controls whether or not the field, if visible, is enabled on an add/edit screenprotected boolean
escapeHtmlOnDisplay
Whether or not the value of this field should be escaped when displayed.protected SFieldMeta
field
protected java.lang.String
fieldDescriptionKey
protected java.lang.String
fieldDescriptionKeyAddMode
protected java.lang.String
fieldDescriptionKeyEditMode
protected java.lang.String
fieldNameKey
protected int
fieldOrder
The relative order (within this field's category) that the field should appear.protected boolean
required
alternate required method.protected boolean
showDefault
Whether or not the field's default value should be shown on an add/edit screenprotected java.util.List<org.apache.wicket.validation.IValidator>
validators
A list of wicket validators that should be applied to the fieldprotected boolean
visible
Controls whether or not the field is visible on an add/edit screen
-
Constructor Summary
Constructors Constructor Description FormMeta(SFieldMeta field)
FormMeta(SFieldMeta field, IEditorSource editorSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormMeta
addValidator(org.apache.wicket.validation.IValidator validator)
int
compareTo(FormMeta o)
Category
getCategory()
IEditorSource
getEditorSource()
org.apache.wicket.model.IModel
getExtendedDescription(SRecordInstance record)
Provided for subclasses to have custom logic to look up any record-specific instructions for a fieldFormMeta.IExtendedDescriptionSource
getExtendedDescriptionSource()
SFieldMeta
getField()
java.lang.String
getFieldDescriptionKey()
java.lang.String
getFieldDescriptionKeyAddMode()
java.lang.String
getFieldDescriptionKeyEditMode()
java.lang.String
getFieldNameKey()
int
getFieldOrder()
java.util.List<org.apache.wicket.validation.IValidator>
getValidators()
org.apache.wicket.markup.html.form.FormComponent
installValidators(org.apache.wicket.markup.html.form.FormComponent c)
boolean
isEnabled()
boolean
isEscapeHTMLOnDisplay()
boolean
isRequired()
boolean
isShowDefault()
boolean
isVisible()
org.apache.wicket.Component
newEditorComponent(java.lang.String id, RecordEditMode mode, SRecordInstance record)
FormMeta
setCategory(Category category)
FormMeta
setCategory(java.lang.String displayKey, int order)
FormMeta
setEditorSource(IEditorSource editorSource)
FormMeta
setEnabled(boolean enabled)
FormMeta
setEscapeHTMLOnDisplay(boolean escapeHtmlOnDisplay)
FormMeta
setExtendedDescriptionSource(FormMeta.IExtendedDescriptionSource extendedDescriptionSource)
FormMeta
setFieldDescriptionKey(java.lang.String fieldDescriptionKey)
FormMeta
setFieldDescriptionKeyAddMode(java.lang.String fieldDescriptionKeyAddMode)
FormMeta
setFieldDescriptionKeyEditMode(java.lang.String fieldDescriptionKeyEditMode)
FormMeta
setFieldNameKey(java.lang.String fieldNameKey)
FormMeta
setFieldOrder(int fieldOrder)
FormMeta
setRequired(boolean required)
Normally, a field is marked as required by using the SMANDATORY field flag.FormMeta
setShowDefault(boolean showDefault)
FormMeta
setVisible(boolean visible)
java.lang.String
toString()
-
-
-
Field Detail
-
field
protected SFieldMeta field
-
fieldNameKey
protected java.lang.String fieldNameKey
-
fieldDescriptionKey
protected java.lang.String fieldDescriptionKey
-
fieldDescriptionKeyAddMode
protected java.lang.String fieldDescriptionKeyAddMode
-
fieldDescriptionKeyEditMode
protected java.lang.String fieldDescriptionKeyEditMode
-
showDefault
protected boolean showDefault
Whether or not the field's default value should be shown on an add/edit screen
-
visible
protected boolean visible
Controls whether or not the field is visible on an add/edit screen
-
enabled
protected boolean enabled
Controls whether or not the field, if visible, is enabled on an add/edit screen
-
required
protected boolean required
alternate required method. see setter docs.
-
escapeHtmlOnDisplay
protected boolean escapeHtmlOnDisplay
Whether or not the value of this field should be escaped when displayed.
-
fieldOrder
protected int fieldOrder
The relative order (within this field's category) that the field should appear. Lower numbers appear first. Set automatically based on the order that the field is added to the category.
-
validators
protected java.util.List<org.apache.wicket.validation.IValidator> validators
A list of wicket validators that should be applied to the field
-
category
protected Category category
The category that the field belongs to.
-
-
Constructor Detail
-
FormMeta
public FormMeta(SFieldMeta field)
-
FormMeta
public FormMeta(SFieldMeta field, IEditorSource editorSource)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getField
public SFieldMeta getField()
-
addValidator
public FormMeta addValidator(org.apache.wicket.validation.IValidator validator)
-
getValidators
public java.util.List<org.apache.wicket.validation.IValidator> getValidators()
-
isVisible
public boolean isVisible()
-
setVisible
public FormMeta setVisible(boolean visible)
-
isRequired
public boolean isRequired()
-
setRequired
public FormMeta setRequired(boolean required)
Normally, a field is marked as required by using the SMANDATORY field flag. But sometimes we can't use that flag because it adds a NOT_NULL constraint to the DB, which isn't acceptable for legacy reasons, and so a field can set this flag on the FormMeta in order to still have the UI treat the field as required.
-
getCategory
public Category getCategory()
-
setCategory
public FormMeta setCategory(java.lang.String displayKey, int order)
-
getFieldOrder
public int getFieldOrder()
-
setFieldOrder
public FormMeta setFieldOrder(int fieldOrder)
-
getFieldNameKey
public java.lang.String getFieldNameKey()
-
setFieldNameKey
public FormMeta setFieldNameKey(java.lang.String fieldNameKey)
-
getFieldDescriptionKey
public java.lang.String getFieldDescriptionKey()
-
setFieldDescriptionKey
public FormMeta setFieldDescriptionKey(java.lang.String fieldDescriptionKey)
-
getExtendedDescription
public org.apache.wicket.model.IModel getExtendedDescription(SRecordInstance record)
Provided for subclasses to have custom logic to look up any record-specific instructions for a field
-
newEditorComponent
public org.apache.wicket.Component newEditorComponent(java.lang.String id, RecordEditMode mode, SRecordInstance record)
-
getEditorSource
public IEditorSource getEditorSource()
-
setEditorSource
public FormMeta setEditorSource(IEditorSource editorSource)
-
isShowDefault
public boolean isShowDefault()
-
setShowDefault
public FormMeta setShowDefault(boolean showDefault)
-
installValidators
public org.apache.wicket.markup.html.form.FormComponent installValidators(org.apache.wicket.markup.html.form.FormComponent c)
-
compareTo
public int compareTo(FormMeta o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<FormMeta>
-
getFieldDescriptionKeyAddMode
public java.lang.String getFieldDescriptionKeyAddMode()
-
setFieldDescriptionKeyAddMode
public FormMeta setFieldDescriptionKeyAddMode(java.lang.String fieldDescriptionKeyAddMode)
-
getFieldDescriptionKeyEditMode
public java.lang.String getFieldDescriptionKeyEditMode()
-
setFieldDescriptionKeyEditMode
public FormMeta setFieldDescriptionKeyEditMode(java.lang.String fieldDescriptionKeyEditMode)
-
getExtendedDescriptionSource
public FormMeta.IExtendedDescriptionSource getExtendedDescriptionSource()
-
setExtendedDescriptionSource
public FormMeta setExtendedDescriptionSource(FormMeta.IExtendedDescriptionSource extendedDescriptionSource)
-
isEnabled
public boolean isEnabled()
-
setEnabled
public FormMeta setEnabled(boolean enabled)
-
isEscapeHTMLOnDisplay
public boolean isEscapeHTMLOnDisplay()
-
setEscapeHTMLOnDisplay
public FormMeta setEscapeHTMLOnDisplay(boolean escapeHtmlOnDisplay)
-
-