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 interfaceFormMeta.IExtendedDescriptionSource
-
Field Summary
Fields Modifier and Type Field Description protected CategorycategoryThe category that the field belongs to.protected booleanenabledControls whether or not the field, if visible, is enabled on an add/edit screenprotected booleanescapeHtmlOnDisplayWhether or not the value of this field should be escaped when displayed.protected SFieldMetafieldprotected java.lang.StringfieldDescriptionKeyprotected java.lang.StringfieldDescriptionKeyAddModeprotected java.lang.StringfieldDescriptionKeyEditModeprotected java.lang.StringfieldNameKeyprotected intfieldOrderThe relative order (within this field's category) that the field should appear.protected booleanrequiredalternate required method.protected booleanshowDefaultWhether or not the field's default value should be shown on an add/edit screenprotected java.util.List<org.apache.wicket.validation.IValidator>validatorsA list of wicket validators that should be applied to the fieldprotected booleanvisibleControls 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 FormMetaaddValidator(org.apache.wicket.validation.IValidator validator)intcompareTo(FormMeta o)CategorygetCategory()IEditorSourcegetEditorSource()org.apache.wicket.model.IModelgetExtendedDescription(SRecordInstance record)Provided for subclasses to have custom logic to look up any record-specific instructions for a fieldFormMeta.IExtendedDescriptionSourcegetExtendedDescriptionSource()SFieldMetagetField()java.lang.StringgetFieldDescriptionKey()java.lang.StringgetFieldDescriptionKeyAddMode()java.lang.StringgetFieldDescriptionKeyEditMode()java.lang.StringgetFieldNameKey()intgetFieldOrder()java.util.List<org.apache.wicket.validation.IValidator>getValidators()org.apache.wicket.markup.html.form.FormComponentinstallValidators(org.apache.wicket.markup.html.form.FormComponent c)booleanisEnabled()booleanisEscapeHTMLOnDisplay()booleanisRequired()booleanisShowDefault()booleanisVisible()org.apache.wicket.ComponentnewEditorComponent(java.lang.String id, RecordEditMode mode, SRecordInstance record)FormMetasetCategory(Category category)FormMetasetCategory(java.lang.String displayKey, int order)FormMetasetEditorSource(IEditorSource editorSource)FormMetasetEnabled(boolean enabled)FormMetasetEscapeHTMLOnDisplay(boolean escapeHtmlOnDisplay)FormMetasetExtendedDescriptionSource(FormMeta.IExtendedDescriptionSource extendedDescriptionSource)FormMetasetFieldDescriptionKey(java.lang.String fieldDescriptionKey)FormMetasetFieldDescriptionKeyAddMode(java.lang.String fieldDescriptionKeyAddMode)FormMetasetFieldDescriptionKeyEditMode(java.lang.String fieldDescriptionKeyEditMode)FormMetasetFieldNameKey(java.lang.String fieldNameKey)FormMetasetFieldOrder(int fieldOrder)FormMetasetRequired(boolean required)Normally, a field is marked as required by using the SMANDATORY field flag.FormMetasetShowDefault(boolean showDefault)FormMetasetVisible(boolean visible)java.lang.StringtoString()
-
-
-
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:
toStringin 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:
compareToin 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)
-
-