Class StaticTextItem
- All Implemented Interfaces:
Animatable<StaticTextItem>
,CanDrop<StaticTextItem>
,Clickable<StaticTextItem>
,StaticFormItem
,SupportHelpIcon<StaticTextItem>
,Draggable<StaticTextItem>
,Focusable<StaticTextItem>
,HandleHotKey<StaticTextItem>
,HandleMouseEvents<StaticTextItem>
,Touchable<StaticTextItem>
Static text form item component
The static text item is a special form item, that cannot have its value changed by the user. It looks like standard text on the interface, but it has every attribute of a form item.
The Form
component handles this static text item component completely.
Supported events:
AnimationStart
AnimationEnd
,
Click
,
DoubleClick
,
MouseDown
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
TouchCancel
,
TouchEnd
,
TouchMove
,
TouchStart
,
Drop
,
DragStart
,
DragEnd
HotKey
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Field Summary
Fields inherited from class com.jbstrap.ui.components.form.FormItem
appends, clearButton, column, defaultState, defaultValue, description, formItemSize, helpIcon, label, labelPosition, labelSizes, modified, originalValue, params, prepends, required, showLabel, state, tabIndex, value, visible
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
ConstructorDescriptionStaticTextItem
(DataDescriptorColumn column) Creates a form item, based on the specified DataDescriptor column.StaticTextItem
(DataDescriptorColumn column, String language) Creates a form item, based on the specified DataDescriptor column and using the specified language code.StaticTextItem
(String name, String label) Creates a static text form item, with the specified name and labelStaticTextItem
(String name, String label, String language) Creates a static text form item, with the specified name and label, with the specified language code. -
Method Summary
Modifier and TypeMethodDescriptionvoid
drawEditor
(StringWriter writer) Draws the editor component.setDefaultValue
(Object defaultValue) Sets the default value of the static text item.Sets the value of the form item.Methods inherited from class com.jbstrap.ui.components.form.FormItem
_addComponent, _setReverseShow, _setState, addComponent, addRecalcOnChangeColumn, addRecalcOnChangeColumns, addRecalcOnChangeColumns, addValueChangeHandler, afterDraw, clearValue, convertValueToJavaScript, convertValueToJavaScript, drawComponent, enableClearButton, eraseValue, getCalculateValue, getColumn, getComponents, getDataType, getDefaultState, getDescription, getFormItemSize, getLabel, getLabelPosition, getLabelSize, getLabelSize, getName, getOriginalValue, getParam, getParamAsBoolean, getParamAsDate, getParamAsDate, getParamAsDouble, getParamAsInteger, getParamAsLong, getParamAsNumber, getParamAsString, getRecalcOnChangeColumnsList, getState, getTabIndex, getValue, getValueAsBoolean, getValueAsDate, getValueAsDouble, getValueAsFloat, getValueAsInteger, getValueAsLong, getValueAsString, init, isAssignable, isAutoCalculate, isModified, isReadOnly, isRequired, isReverseShow, isShowLabel, isVisible, onFormItemValueChanged, onHotKeyEventHandler, onShow, redraw, removeParam, resetState, runAfterDrawOnAddon, runOnHideOnAddon, runOnShowOnAddon, setCalculateValue, setDataType, setDataType, setDescription, setEnabled, setFocus, setFormItemSize, setLabel, setLabelPosition, setLabelSize, setLabelSize, setMargin, setModified, setObjectValue, setOriginalObjectValue, setOriginalValue, setPadding, setParam, setParams, setReadOnly, setRequired, setShowLabel, setState, setTabIndex, setVisible, triggerFormChange, writeHTML
Methods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getLanguageCode, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, onHide, openTag, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setName, setOverflow, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClass
Methods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimation
Methods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandler
Methods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandler
Methods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.Focusable
addFocusHandler, addFocusInHandler, addFocusOutHandler, addLosesFocusHandler
Methods inherited from interface com.jbstrap.ui.HandleHotKey
addHotKey, addHotKey, removeHotKey, removeHotKeys
Methods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler
Methods inherited from interface com.jbstrap.ui.components.form.SupportHelpIcon
getHelpIcon, getHelpText, setHelpIcon, setHelpText
Methods inherited from interface com.jbstrap.ui.Touchable
addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler
-
Constructor Details
-
StaticTextItem
Creates a static text form item, with the specified name and label- Parameters:
name
- The form item namelabel
- The form item label. Ifnull
, the item won't have one.- Throws:
NullPointerException
- If the name isnull
-
StaticTextItem
Creates a static text form item, with the specified name and label, with the specified language code.- Parameters:
name
- The form item namelabel
- The form item label. Ifnull
, the item won't have one.language
- The language code, that the form item will use. If not specified, ornull
, the framework will use the default language. The default language can be set with theJBStrapParamType.DEFAULT_LANGUAGE
JBStrap parameter.- Throws:
NullPointerException
- If the name isnull
-
StaticTextItem
Creates a form item, based on the specified DataDescriptor column.
The method creates and sets the static form item, based on the DataDescriptor column, specified in the parameters. The following parameters from the DataDescriptor column are used:
DataDescriptorColumn.getTitle
- The title set in the DataDescriptor column will be used by the input field as its label.DataDescriptorColumn.isNullable()
- If the field can anull
value, the field will be marked as not mandatory. If it cannot have anull
value, the field will be marked as mandatory.MetaParamName.SIZE
- The value specified here defines the size of the input field. (Applicable values: SMALL, MEDIUM, LARGE)MetaParamName.STATE
- The value specified here defines the state of the input field. (Applicable values: DEFAULT, ERROR, WARNING, SUCCESS, INFO)MetaParamName.DEFAULT_VALUE
- The value specified here defines the field's default value. The value must have the type of field, in this case, it must be a text value.MetaParamName.ENABLED
- Iffalse
, the field will be disabled (it will be created in an unusable state.) Otherwise, the field will be enabled when created.MetaParamName.HELP
- If the parameter is specified, an icon will be displayed next to the field. If the user moves over the icon, the text specified here will be displayed, as a help text.MetaParamName.HELP_ICON
- If the icon name is specified (from theIcon
enum), then this icon will replace the default "?" icon.MetaParamName.DESCRIPTION
- The text specified here will appear below the field, in a smaller, italic font.
- Parameters:
column
- The DataDescriptor column, that will be used as a basis for the form item.- Throws:
NullPointerException
- If the column was specified asnull
-
StaticTextItem
Creates a form item, based on the specified DataDescriptor column and using the specified language code.
The method creates and sets the static form item, based on the DataDescriptor column, specified in the parameters. The following parameters from the DataDescriptor column are used:
DataDescriptorColumn.getTitle
- The title set in the DataDescriptor column will be used by the input field as its label.DataDescriptorColumn.isNullable()
- If the field can anull
value, the field will be marked as not mandatory. If it cannot have anull
value, the field will be marked as mandatory.MetaParamName.SIZE
- The value specified here defines the size of the input field. (Applicable values: SMALL, MEDIUM, LARGE)MetaParamName.STATE
- The value specified here defines the state of the input field. (Applicable values: DEFAULT, ERROR, WARNING, SUCCESS, INFO)MetaParamName.DEFAULT_VALUE
- The value specified here defines the field's default value. The value must have the type of field, in this case, it must be a text value.MetaParamName.ENABLED
- Iffalse
, the field will be disabled (it will be created in an unusable state.) Otherwise, the field will be enabled when created.MetaParamName.HELP
- If the parameter is specified, an icon will be displayed next to the field. If the user moves over the icon, the text specified here will be displayed, as a help text.MetaParamName.HELP_ICON
- If the icon name is specified (from theIcon
enum), then this icon will replace the default "?" icon.MetaParamName.DESCRIPTION
- The text specified here will appear below the field, in a smaller, italic font.
- Parameters:
column
- The DataDescriptor column, that will be used as a basis for the form item.language
- The language code, that the form item will use. If not specified, ornull
, the framework will use the default language. The default language can be set with theJBStrapParamType.DEFAULT_LANGUAGE
JBStrap parameter.- Throws:
NullPointerException
- If the column was specified asnull
-
-
Method Details
-
setValue
Sets the value of the form item. The value set here will be displayed on the component as a text value- Overrides:
setValue
in classFormItem<Object,
StaticTextItem> - Parameters:
value
- The component value- Returns:
- The static text item
-
drawEditor
Description copied from class:FormItem
Draws the editor component.
You do not need to use this method during development, but all components extending the form item must implement it. Use the method to generate the input field’s HTML code. This code is then inserted into the corresponding DOM code when drawing the form item.
- Specified by:
drawEditor
in classFormItem<Object,
StaticTextItem> - Parameters:
writer
- The HTML string writer class instance; write here the HTML code for the input field
-
setDefaultValue
Sets the default value of the static text item.- Specified by:
setDefaultValue
in classFormItem<Object,
StaticTextItem> - Parameters:
defaultValue
- The default value of the static text item.- Returns:
- The static text component
-