public class FormItemIcon extends DataClass implements HasFormItemClickHandlers
com.smartgwt.client.widgets.form.fields.FormItem#getIcons
factoryCreated, factoryProperties, readOnly
Constructor and Description |
---|
FormItemIcon() |
FormItemIcon(com.google.gwt.core.client.JavaScriptObject jsObj) |
Modifier and Type | Method and Description |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addFormItemClickHandler(FormItemClickHandler handler)
Add a formItemClick handler.
|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getBaseStyle()
Base CSS style.
|
java.lang.Boolean |
getDisabled()
Whether this icon is disabled.
|
java.lang.Boolean |
getDisableOnReadOnly()
If
FormItem.canEdit is set to false, should this
icon be disabled. |
java.lang.Integer |
getHeight()
If set, this property determines the height of this icon in px.
|
java.lang.Integer |
getHspace()
If set, this property determines the number of pixels space to be displayed on the left of this form item icon, or for
inline icons whose inlineIconAlign is Alignment.LEFT , on the right of this form item icon. |
PickListItemIconPlacement |
getIconPlacement()
For PickList items with
PickListItemIconPlacement set such that the pickList does not
render near-origin, should this icon be rendered inline within the formItem itself, or within the ComboBoxItem.pickerNavigationBar . |
java.lang.Boolean |
getInline()
When set, this icon is rendered inside the
textBox area of the FormItem (where input occurs in a TextItem or ComboBoxItem ) as
opposed to as a trailing icon. |
Alignment |
getInlineIconAlign()
Horizontal alignment for icons marked
inline . |
java.lang.String |
getName()
Identifier for this form item icon.
|
java.lang.Boolean |
getNeverDisable()
If
icon.neverDisable is true, when this form item is disabled, the icon will remain enabled. |
static FormItemIcon |
getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj) |
java.lang.String |
getPrompt()
If set, this property will be displayed as a prompt (and tooltip text) for this form item icon.
|
java.lang.Boolean |
getShowFocused()
Should this icon's image and/or
baseStyle
switch to the appropriate "Focused" value when the user puts focus on the form item or icon? |
java.lang.Boolean |
getShowFocusedWithItem()
If this icon will be updated to show focus (see
showFocused , FormItem.showFocusedIcons ), this property governs
whether the focused state should be shown when the item as a whole receives focus or just if the icon receives focus. |
java.lang.Boolean |
getShowOver()
Should this icon's image and/or
baseStyle
switch to the appropriate "Over" value when the user rolls over or focuses on the icon? |
java.lang.Boolean |
getShowRTL()
|
java.lang.String |
getSrc()
If set, this property determines this icon's image source.
|
java.lang.Integer |
getTabIndex()
TabIndex for this formItemIcon.
|
java.lang.Integer |
getWidth()
If set, this property determines the width of this icon in px.
|
int |
hashCode() |
void |
keyPress(java.lang.String keyName,
char character,
DynamicForm form,
FormItem item,
FormItemIcon icon)
StringMethod action to fire when this icon has focus and receives a keypress event.
|
void |
setBaseStyle(java.lang.String baseStyle)
Base CSS style.
|
void |
setDisabled(java.lang.Boolean disabled)
Whether this icon is disabled.
|
void |
setDisableOnReadOnly(java.lang.Boolean disableOnReadOnly)
If
FormItem.canEdit is set to false, should this
icon be disabled. |
void |
setHeight(java.lang.Integer height)
If set, this property determines the height of this icon in px.
|
void |
setHspace(java.lang.Integer hspace)
If set, this property determines the number of pixels space to be displayed on the left of this form item icon, or for
inline icons whose inlineIconAlign is Alignment.LEFT , on the right of this form item icon. |
void |
setIconPlacement(PickListItemIconPlacement iconPlacement)
For PickList items with
PickListItemIconPlacement set such that the pickList does not
render near-origin, should this icon be rendered inline within the formItem itself, or within the ComboBoxItem.pickerNavigationBar . |
void |
setInline(java.lang.Boolean inline)
When set, this icon is rendered inside the
textBox area of the FormItem (where input occurs in a TextItem or ComboBoxItem ) as
opposed to as a trailing icon. |
void |
setInlineIconAlign(Alignment inlineIconAlign)
Horizontal alignment for icons marked
inline . |
void |
setName(java.lang.String name)
Identifier for this form item icon.
|
void |
setNeverDisable(java.lang.Boolean neverDisable)
If
icon.neverDisable is true, when this form item is disabled, the icon will remain enabled. |
void |
setPrompt(java.lang.String prompt)
If set, this property will be displayed as a prompt (and tooltip text) for this form item icon.
|
void |
setShowFocused(java.lang.Boolean showFocused)
Should this icon's image and/or
baseStyle
switch to the appropriate "Focused" value when the user puts focus on the form item or icon? |
void |
setShowFocusedWithItem(java.lang.Boolean showFocusedWithItem)
If this icon will be updated to show focus (see
showFocused , FormItem.showFocusedIcons ), this property governs
whether the focused state should be shown when the item as a whole receives focus or just if the icon receives focus. |
void |
setShowIfCondition(FormItemIfFunction showIf)
Set showIf condition.
|
void |
setShowOver(java.lang.Boolean showOver)
Should this icon's image and/or
baseStyle
switch to the appropriate "Over" value when the user rolls over or focuses on the icon? |
void |
setShowRTL(java.lang.Boolean showRTL)
|
void |
setSrc(java.lang.String src)
If set, this property determines this icon's image source.
|
void |
setTabIndex(java.lang.Integer tabIndex)
TabIndex for this formItemIcon.
|
void |
setWidth(java.lang.Integer width)
If set, this property determines the width of this icon in px.
|
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getReadOnly, isFactoryCreated, logConfiguration, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated, setReadOnly
getJsObj, isCreated, setJavaScriptObject, setJsObj
public FormItemIcon()
public FormItemIcon(com.google.gwt.core.client.JavaScriptObject jsObj)
public static FormItemIcon getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)
public void setBaseStyle(java.lang.String baseStyle)
this.showOver
is true, "Disabled" if the icon is
disabled, and "Focused". In addition, if showRTL
is enabled, then an "RTL" suffix will be added.
Note : This is an advanced setting
baseStyle
- See CSSStyleName
. Default value is nullpublic java.lang.String getBaseStyle()
this.showOver
is true, "Disabled" if the icon is
disabled, and "Focused". In addition, if showRTL
is enabled, then an "RTL" suffix will be added.CSSStyleName
public void setDisabled(java.lang.Boolean disabled)
FormItem.setIconDisabled()
method. Note that if the
formItem containing this icon is disabled, the icon will behave in a disabled manner regardless of the setting of the
icon.disabled property.disabled
- Default value is nullFormItem.setIconDisabled(java.lang.String, boolean)
,
Appearance overview and related methods
public java.lang.Boolean getDisabled()
FormItem.setIconDisabled()
method. Note that if the
formItem containing this icon is disabled, the icon will behave in a disabled manner regardless of the setting of the
icon.disabled property.FormItem.setIconDisabled(java.lang.String, boolean)
,
Appearance overview and related methods
public void setDisableOnReadOnly(java.lang.Boolean disableOnReadOnly)
FormItem.canEdit
is set to false, should this
icon be disabled. If unset this is determined by FormItem.disableIconsOnReadOnly
. Note that
if neverDisable
is set to true, the icons
will be rendered enabled regardless of this setting and whether the item is editable.
Note : This is an advanced setting
disableOnReadOnly
- Default value is nullpublic java.lang.Boolean getDisableOnReadOnly()
FormItem.canEdit
is set to false, should this
icon be disabled. If unset this is determined by FormItem.disableIconsOnReadOnly
. Note that
if neverDisable
is set to true, the icons
will be rendered enabled regardless of this setting and whether the item is editable.public void setHeight(java.lang.Integer height)
iconHeight
property will be used instead.height
- Default value is nullFormItem.setIconHeight(int)
public java.lang.Integer getHeight()
iconHeight
property will be used instead.FormItem.getIconHeight()
public void setHspace(java.lang.Integer hspace)
inline
icons whose inlineIconAlign
is Alignment.LEFT
, on the right of this form item icon. Must be non-negative. If unset, the form
item's iconHSpace
will be used instead.hspace
- Default value is nullpublic java.lang.Integer getHspace()
inline
icons whose inlineIconAlign
is Alignment.LEFT
, on the right of this form item icon. Must be non-negative. If unset, the form
item's iconHSpace
will be used instead.public void setIconPlacement(PickListItemIconPlacement iconPlacement)
PickListItemIconPlacement
set such that the pickList does not
render near-origin, should this icon be rendered inline within the formItem itself, or within the ComboBoxItem.pickerNavigationBar
. If not explicitly specified at the icon level, this will be picked up from PickList.iconPlacement.
For mobile browsing with limited available screen space, icons rendered in the navigation bar may be easier for the user to interact with.
iconPlacement
- Default value is nullpublic PickListItemIconPlacement getIconPlacement()
PickListItemIconPlacement
set such that the pickList does not
render near-origin, should this icon be rendered inline within the formItem itself, or within the ComboBoxItem.pickerNavigationBar
. If not explicitly specified at the icon level, this will be picked up from PickList.iconPlacement.
For mobile browsing with limited available screen space, icons rendered in the navigation bar may be easier for the user to interact with.
public void setInline(java.lang.Boolean inline)
textBox
area of the FormItem
(where input occurs in a TextItem
or ComboBoxItem
) as
opposed to as a trailing icon. Use inlineIconAlign
to control alignment of the icon. Multiple icons can be inlined on both the left and right side of the
textBox
area. hspace
is honored for
spacing between multiple adjacent icons.
Inline icons are not supported for Internet Explorer 10 and earlier, or
when the FormItem
is not a TextItem
or ComboBoxItem
. When unsupported, the icon
will fall back to non-inline mode.
The picker icon
, if any, cannot be inlined.
inline
- Default value is falsepublic java.lang.Boolean getInline()
textBox
area of the FormItem
(where input occurs in a TextItem
or ComboBoxItem
) as
opposed to as a trailing icon. Use inlineIconAlign
to control alignment of the icon. Multiple icons can be inlined on both the left and right side of the
textBox
area. hspace
is honored for
spacing between multiple adjacent icons.
Inline icons are not supported for Internet Explorer 10 and earlier, or
when the FormItem
is not a TextItem
or ComboBoxItem
. When unsupported, the icon
will fall back to non-inline mode.
The picker icon
, if any, cannot be inlined.
public void setInlineIconAlign(Alignment inlineIconAlign)
inline
.
By default, the first icon that specifies inline is aligned left, and the second and all subsequent icons to the right.
"center"
alignment is invalid and will be ignored.
In RTL mode, the alignment is automatically
mirrored; inlineIconAlign:"left"
results in the icon being placed on the right and
inlineIconAlign:"right"
results in the icon being placed on the left.
inlineIconAlign
- Default value is nullpublic Alignment getInlineIconAlign()
inline
.
By default, the first icon that specifies inline is aligned left, and the second and all subsequent icons to the right.
"center"
alignment is invalid and will be ignored.
In RTL mode, the alignment is automatically
mirrored; inlineIconAlign:"left"
results in the icon being placed on the right and
inlineIconAlign:"right"
results in the icon being placed on the left.
public void setName(java.lang.String name)
FormItem.getIcon()
.name
- Default value is nullpublic java.lang.String getName()
FormItem.getIcon()
.public void setNeverDisable(java.lang.Boolean neverDisable)
icon.neverDisable
is true, when this form item is disabled, the icon will remain enabled. Note that
disabling the entire form will disable all items, together with their icons including those marked as neverDisable -
this property only has an effect if the form is enabled and a specific item is disabled within it. If this property
is true, the icons will also remain enabled if a form item is marked as canEdit:false
. For finer grained control over whether icons
are enabled for read-only icons see FormItem.disableIconsOnReadOnly
and disableOnReadOnly
Note : This is an advanced setting
neverDisable
- Default value is nullpublic java.lang.Boolean getNeverDisable()
icon.neverDisable
is true, when this form item is disabled, the icon will remain enabled. Note that
disabling the entire form will disable all items, together with their icons including those marked as neverDisable -
this property only has an effect if the form is enabled and a specific item is disabled within it. If this property
is true, the icons will also remain enabled if a form item is marked as canEdit:false
. For finer grained control over whether icons
are enabled for read-only icons see FormItem.disableIconsOnReadOnly
and disableOnReadOnly
public void setPrompt(java.lang.String prompt)
If unset the form
item's iconPrompt
property will be used instead.
Note : This is an advanced setting
prompt
- See HTMLString
. Default value is nullFormItem.setIconPrompt(java.lang.String)
public java.lang.String getPrompt()
If unset the form
item's iconPrompt
property will be used instead.
HTMLString
FormItem.getIconPrompt()
public void setShowFocused(java.lang.Boolean showFocused)
baseStyle
switch to the appropriate "Focused" value when the user puts focus on the form item or icon?
Note : This is an advanced setting
showFocused
- Default value is nullFormItem.setShowFocusedIcons(java.lang.Boolean)
,
setShowFocusedWithItem(java.lang.Boolean)
public java.lang.Boolean getShowFocused()
baseStyle
switch to the appropriate "Focused" value when the user puts focus on the form item or icon?FormItem.getShowFocusedIcons()
,
getShowFocusedWithItem()
public void setShowFocusedWithItem(java.lang.Boolean showFocusedWithItem)
showFocused
, FormItem.showFocusedIcons
), this property governs
whether the focused state should be shown when the item as a whole receives focus or just if the icon receives focus. If
this property is unset, default behavior is to show focused state when the item receives focus.
Note : This is an advanced setting
showFocusedWithItem
- Default value is nullFormItem.setShowFocusedIcons(java.lang.Boolean)
,
setShowFocused(java.lang.Boolean)
public java.lang.Boolean getShowFocusedWithItem()
showFocused
, FormItem.showFocusedIcons
), this property governs
whether the focused state should be shown when the item as a whole receives focus or just if the icon receives focus. If
this property is unset, default behavior is to show focused state when the item receives focus.FormItem.getShowFocusedIcons()
,
getShowFocused()
public void setShowOver(java.lang.Boolean showOver)
baseStyle
switch to the appropriate "Over" value when the user rolls over or focuses on the icon?
Note : This is an advanced setting
showOver
- Default value is nullFormItem.setShowOverIcons(java.lang.Boolean)
public java.lang.Boolean getShowOver()
baseStyle
switch to the appropriate "Over" value when the user rolls over or focuses on the icon?FormItem.getShowOverIcons()
public void setShowRTL(java.lang.Boolean showRTL)
src
and/or baseStyle
switch to the appropriate RTL value when
the FormItem is in RTL mode? If true, then the image URL for all states will have "_rtl" added before the extension.
Also, if baseStyle is set, all style names will have an "RTL" suffix. This should only be enabled if RTL media is
available. For example, if an icon's src is "[SKINIMG]formItemIcons/myFormIcon.png" and the baseStyle is "myFormIcon", then in the "Down" state, Smart GWT will use "[SKINIMG]formItemIcons/myFormIcon_Down_rtl.png" for the image source and "myFormIconDownRTL" for the style name.
Note : This is an advanced setting
showRTL
- Default value is nullpublic java.lang.Boolean getShowRTL()
src
and/or baseStyle
switch to the appropriate RTL value when
the FormItem is in RTL mode? If true, then the image URL for all states will have "_rtl" added before the extension.
Also, if baseStyle is set, all style names will have an "RTL" suffix. This should only be enabled if RTL media is
available. For example, if an icon's src is "[SKINIMG]formItemIcons/myFormIcon.png" and the baseStyle is "myFormIcon", then in the "Down" state, Smart GWT will use "[SKINIMG]formItemIcons/myFormIcon_Down_rtl.png" for the image source and "myFormIconDownRTL" for the style name.
public void setSrc(java.lang.String src)
defaultIconSrc
property
will be used instead.defaultIconSrc
this URL will be modified by adding "_Over" or "_Disabled"
if appropriate to show the icon's over or disabled state. If showRTL
is enabled, then "_rtl" will be added to the
source URL before the extension.
The special value "blank" means that no image will be shown for this icon. This is
particularly useful together with baseStyle
to
implement spriting of the different icon states.
src
- See SCImgURL
. Default value is nullFormItem.setDefaultIconSrc(java.lang.String)
,
Icons Examplepublic java.lang.String getSrc()
defaultIconSrc
property
will be used instead.defaultIconSrc
this URL will be modified by adding "_Over" or "_Disabled"
if appropriate to show the icon's over or disabled state. If showRTL
is enabled, then "_rtl" will be added to the
source URL before the extension.
The special value "blank" means that no image will be shown for this icon. This is
particularly useful together with baseStyle
to
implement spriting of the different icon states.
SCImgURL
FormItem.getDefaultIconSrc()
,
Icons Examplepublic void setTabIndex(java.lang.Integer tabIndex)
Set to -1 to remove the icon from the tab order, but be cautious doing so: if the icon triggers important application functionality that cannot otherwise be accessed via the keyboard, it would be a violation of accessibility standard to remove the icon from the tab order.
Any usage other than setting to -1 is
extremely advanced in the same way as using FormItem.globalTabIndex
.
Note : This is an advanced setting
tabIndex
- Default value is nullpublic java.lang.Integer getTabIndex()
Set to -1 to remove the icon from the tab order, but be cautious doing so: if the icon triggers important application functionality that cannot otherwise be accessed via the keyboard, it would be a violation of accessibility standard to remove the icon from the tab order.
Any usage other than setting to -1 is
extremely advanced in the same way as using FormItem.globalTabIndex
.
public void setWidth(java.lang.Integer width)
iconWidth
property will be used instead.width
- Default value is nullFormItem.setIconWidth(int)
public java.lang.Integer getWidth()
iconWidth
property will be used instead.FormItem.getIconWidth()
public com.google.gwt.event.shared.HandlerRegistration addFormItemClickHandler(FormItemClickHandler handler)
Called when this icon is clicked. The default action is to call FormItem.showPicker()
.
addFormItemClickHandler
in interface HasFormItemClickHandlers
handler
- the formItemClick handlerHandlerRegistration
used to remove this handlerpublic void keyPress(java.lang.String keyName, char character, DynamicForm form, FormItem item, FormItemIcon icon)
iconKeyPress
method will be fired instead (if specified).keyName
- Name of the key pressedcharacter
- character produced by the keypressform
- The Dynamic Form to which this icon's item belongs.item
- The Form Item containing this iconicon
- A pointer to the form item iconpublic void setShowIfCondition(FormItemIfFunction showIf)
If specified, icon.showIf
will be evaluated when the form item is drawn or redrawn. Return true if the icon
should be visible, or false if it should be hidden. Note that if FormItem.showIcon
or FormItem.hideIcon
is called, this method will be overridden.
handler
- the showIf handler