Package ca.corbett.extras.properties
Class LongTextProperty
java.lang.Object
ca.corbett.extras.properties.AbstractProperty
ca.corbett.extras.properties.LongTextProperty
Represents a property that can store a long text (multi-line) value.
The options for creating a LongTextProperty exactly match those for
containing a LongTextField, as that is the underlying FormField
for this property type.
- Since:
- sc-util 1.8
- Author:
- scorbett
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected intprotected LongTextField.TextFieldTypeprotected Stringprotected intFields inherited from class ca.corbett.extras.properties.AbstractProperty
categoryName, DEFAULT_CATEGORY, DEFAULT_PROPERTY_NAME, extraAttributes, fullyQualifiedName, helpText, isEnabled, isExposed, isInitiallyEditable, isInitiallyVisible, propertyLabel, propertyName, subCategoryName -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLongTextProperty(String name, String label, LongTextField.TextFieldType fieldType, int x, int y) Invoked internally by the static factory methods. -
Method Summary
Modifier and TypeMethodDescriptionprotected FormFieldDescendant classes must implement this method to generate a FormField associated with this property.getValue()booleanbooleanvoidloadFromFormField(FormField field) Populates this Property's value(s) from the given form field, assuming the field is of the correct type.voidloadFromProps(Properties props) Loads the value(s) for this property from the given Properties instance, overwriting any current value.static LongTextPropertyofDynamicSizingMultiLine(String name, String label) Creates a multi-line TextField which will automatically expand to fill the width of whatever FormPanel it is added to.static LongTextPropertyofFixedPixelSizeMultiLine(String name, String label, int width, int height) Creates a TextProperty with the specified pixel dimensions.static LongTextPropertyofFixedSizeMultiLine(String name, String label, int rows, int cols) Creates a TextProperty with the specified number of rows and columns.voidsaveToProps(Properties props) Saves the current value(s) of this property to the given Properties instance.setAllowBlank(boolean allow) setAllowPopoutEditing(boolean allow) Methods inherited from class ca.corbett.extras.properties.AbstractProperty
addAllExtraAttributes, addFormFieldChangeListener, clearExtraAttribute, clearExtraAttributes, equals, fireFormFieldChangedEvent, generateFormField, generateFormField, getCategoryName, getExtraAttribute, getFullyQualifiedName, getHelpText, getPropertyLabel, getPropertyName, getSubCategoryName, hashCode, isEnabled, isExposed, isInitiallyEditable, isInitiallyVisible, removeAllListeners, removeFormFieldChangeListener, setAllExtraAttributes, setEnabled, setExposed, setExtraAttribute, setHelpText, setInitiallyEditable, setInitiallyVisible, setPropertyLabel
-
Field Details
-
value
-
textFieldType
-
width
protected int width -
height
protected int height -
allowBlank
protected boolean allowBlank -
allowPopoutEditing
protected boolean allowPopoutEditing
-
-
Constructor Details
-
LongTextProperty
protected LongTextProperty(String name, String label, LongTextField.TextFieldType fieldType, int x, int y) Invoked internally by the static factory methods.
-
-
Method Details
-
ofFixedSizeMultiLine
Creates a TextProperty with the specified number of rows and columns. If rows is 1, a single-line TextField is created. Otherwise, a multi-line TextField is created. -
ofFixedPixelSizeMultiLine
public static LongTextProperty ofFixedPixelSizeMultiLine(String name, String label, int width, int height) Creates a TextProperty with the specified pixel dimensions. Generally, you should avoid specifying pixel dimensions for UI components, as it doesn't scale well with font size changes or Look and Feel changes. -
ofDynamicSizingMultiLine
Creates a multi-line TextField which will automatically expand to fill the width of whatever FormPanel it is added to. -
getValue
-
setValue
-
setAllowBlank
-
isAllowBlank
public boolean isAllowBlank() -
setAllowPopoutEditing
-
isAllowPopoutEditing
public boolean isAllowPopoutEditing() -
saveToProps
Description copied from class:AbstractPropertySaves the current value(s) of this property to the given Properties instance.- Specified by:
saveToPropsin classAbstractProperty- Parameters:
props- Any Properties instance which will receive the value(s) of this property.
-
loadFromProps
Description copied from class:AbstractPropertyLoads the value(s) for this property from the given Properties instance, overwriting any current value. The current value of this property will be used as a default value in the event that this property does not exist in the given Properties instance.- Specified by:
loadFromPropsin classAbstractProperty- Parameters:
props- Any Properties instance which contains value(s) for this property.
-
generateFormFieldImpl
Description copied from class:AbstractPropertyDescendant classes must implement this method to generate a FormField associated with this property. The generateFormField() method in this class will call this abstract method to create the FormField, which will then be augmented with our fully qualified name, read-only state, help text, and extra attributes.- Specified by:
generateFormFieldImplin classAbstractProperty- Returns:
- A FormField associated with this property.
-
loadFromFormField
Description copied from class:AbstractPropertyPopulates this Property's value(s) from the given form field, assuming the field is of the correct type.- Specified by:
loadFromFormFieldin classAbstractProperty- Parameters:
field- The FormField containing a value for this property.
-