com.smartgwt.client.widgets.form.fields
Class FormItemIcon

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.widgets.form.fields.FormItemIcon
All Implemented Interfaces:
HasHandlers, HasFormItemClickHandlers
Direct Known Subclasses:
PickerIcon

public class FormItemIcon
extends DataClass
implements HasFormItemClickHandlers

Form item icon descriptor objects used by Form Items to specify the appearance and behavior of icons displayed after the item in the page flow.

See Also:
com.smartgwt.client.widgets.form.fields.FormItem#getIcons

Field Summary
 
Fields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
FormItemIcon()
           
FormItemIcon(JavaScriptObject jsObj)
           
 
Method Summary
 HandlerRegistration addFormItemClickHandler(FormItemClickHandler handler)
          Add a formItemClick handler.
 boolean equals(Object o)
           
 String getBaseStyle()
          Base CSS style.
 Boolean getDisableOnReadOnly()
          If canEdit is set to false, should this icon be disabled.
 Integer getHeight()
          If set, this property determines the height of this icon in px.
 Integer getHspace()
          If set, this property determines the number of pixels space to be displayed on the left of this form item icon.
If unset the form item's iconHSpace property will be used instead.
 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 pickerNavigationBar.
 String getName()
          Identifier for this form item icon.
 Boolean getNeverDisable()
          If icon.neverDisable is true, when this form item is disabled, the icon will remain enabled.
static FormItemIcon getOrCreateRef(JavaScriptObject jsObj)
           
 String getPrompt()
          If set, this property will be displayed as a prompt (and tooltip text) for this form item icon.
 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?
 Boolean getShowFocusedWithItem()
          If this icon will be updated to show focus (see showFocused, 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.
 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?
 Boolean getShowRTL()
          Should this icon's 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.
 String getSrc()
          If set, this property determines this icon's image source.
 Integer getTabIndex()
          TabIndex for this formItemIcon.
 Integer getWidth()
          If set, this property determines the width of this icon in px.
 int hashCode()
           
 void keyPress(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(String baseStyle)
          Base CSS style.
 void setDisableOnReadOnly(Boolean disableOnReadOnly)
          If canEdit is set to false, should this icon be disabled.
 void setHeight(Integer height)
          If set, this property determines the height of this icon in px.
 void setHspace(Integer hspace)
          If set, this property determines the number of pixels space to be displayed on the left of this form item icon.
If unset the form item's iconHSpace property will be used instead.
 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 pickerNavigationBar.
 void setName(String name)
          Identifier for this form item icon.
 void setNeverDisable(Boolean neverDisable)
          If icon.neverDisable is true, when this form item is disabled, the icon will remain enabled.
 void setPrompt(String prompt)
          If set, this property will be displayed as a prompt (and tooltip text) for this form item icon.
 void setShowFocused(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(Boolean showFocusedWithItem)
          If this icon will be updated to show focus (see showFocused, 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(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(Boolean showRTL)
          Should this icon's 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.
 void setSrc(String src)
          If set, this property determines this icon's image source.
 void setTabIndex(Integer tabIndex)
          TabIndex for this formItemIcon.
 void setWidth(Integer width)
          If set, this property determines the width of this icon in px.
 
Methods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, 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
 
Methods inherited from class com.smartgwt.client.core.JsObject
getJsObj, isCreated, setJavaScriptObject, setJsObj
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

FormItemIcon

public FormItemIcon()

FormItemIcon

public FormItemIcon(JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static FormItemIcon getOrCreateRef(JavaScriptObject jsObj)

setBaseStyle

public void setBaseStyle(String baseStyle)
Base CSS style. If set, as the component changes state and/or is focused, suffixes will be added to the base style. Possible suffixes include "Over" if the user mouses over the icon and 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

Parameters:
baseStyle - See CSSStyleName . Default value is null

getBaseStyle

public String getBaseStyle()
Base CSS style. If set, as the component changes state and/or is focused, suffixes will be added to the base style. Possible suffixes include "Over" if the user mouses over the icon and 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.

Returns:
See CSSStyleName

setDisableOnReadOnly

public void setDisableOnReadOnly(Boolean disableOnReadOnly)
If canEdit is set to false, should this icon be disabled. If unset this is determined by 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

Parameters:
disableOnReadOnly - Default value is null

getDisableOnReadOnly

public Boolean getDisableOnReadOnly()
If canEdit is set to false, should this icon be disabled. If unset this is determined by 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.

Returns:
Boolean

setHeight

public void setHeight(Integer height)
If set, this property determines the height of this icon in px. If unset the form item's iconHeight property will be used instead.

Parameters:
height - Default value is null
See Also:
FormItem.setIconHeight(int)

getHeight

public Integer getHeight()
If set, this property determines the height of this icon in px. If unset the form item's iconHeight property will be used instead.

Returns:
Integer
See Also:
FormItem.getIconHeight()

setHspace

public void setHspace(Integer hspace)
If set, this property determines the number of pixels space to be displayed on the left of this form item icon.
If unset the form item's iconHSpace property will be used instead.

Parameters:
hspace - Default value is null
See Also:
FormItem.setIconHSpace(java.lang.Integer)

getHspace

public Integer getHspace()
If set, this property determines the number of pixels space to be displayed on the left of this form item icon.
If unset the form item's iconHSpace property will be used instead.

Returns:
Integer
See Also:
FormItem.getIconHSpace()

setIconPlacement

public 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 pickerNavigationBar.

If not explicitly specified at the icon level, this will be picked up from iconPlacement.

For mobile browsing with limited available screen space, icons rendered in the navigation bar may be easier for the user to interact with.

Parameters:
iconPlacement - Default value is null

getIconPlacement

public 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 pickerNavigationBar.

If not explicitly specified at the icon level, this will be picked up from iconPlacement.

For mobile browsing with limited available screen space, icons rendered in the navigation bar may be easier for the user to interact with.

Returns:
PickListItemIconPlacement

setName

public void setName(String name)
Identifier for this form item icon. This identifier (if set) should be unique within this form item and may be used to get a pointer to the icon object via FormItem.getIcon.

Parameters:
name - Default value is null

getName

public String getName()
Identifier for this form item icon. This identifier (if set) should be unique within this form item and may be used to get a pointer to the icon object via FormItem.getIcon.

Returns:
String

setNeverDisable

public void setNeverDisable(Boolean neverDisable)
If 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 disableIconsOnReadOnly and disableOnReadOnly

Note : This is an advanced setting

Parameters:
neverDisable - Default value is null

getNeverDisable

public Boolean getNeverDisable()
If 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 disableIconsOnReadOnly and disableOnReadOnly

Returns:
Boolean

setPrompt

public void setPrompt(String prompt)
If set, this property will be displayed as a prompt (and tooltip text) for this form item icon.

If unset the form item's iconPrompt property will be used instead.

Note : This is an advanced setting

Parameters:
prompt - See HTMLString . Default value is null
See Also:
FormItem.setIconPrompt(java.lang.String)

getPrompt

public String getPrompt()
If set, this property will be displayed as a prompt (and tooltip text) for this form item icon.

If unset the form item's iconPrompt property will be used instead.

Returns:
See HTMLString
See Also:
FormItem.getIconPrompt()

setShowFocused

public void setShowFocused(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?

Note : This is an advanced setting

Parameters:
showFocused - Default value is null
See Also:
FormItem.setShowFocusedIcons(java.lang.Boolean), setShowFocusedWithItem(java.lang.Boolean)

getShowFocused

public 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?

Returns:
Boolean
See Also:
FormItem.getShowFocusedIcons(), getShowFocusedWithItem()

setShowFocusedWithItem

public void setShowFocusedWithItem(Boolean showFocusedWithItem)
If this icon will be updated to show focus (see showFocused, 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

Parameters:
showFocusedWithItem - Default value is null
See Also:
FormItem.setShowFocusedIcons(java.lang.Boolean), setShowFocused(java.lang.Boolean)

getShowFocusedWithItem

public Boolean getShowFocusedWithItem()
If this icon will be updated to show focus (see showFocused, 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.

Returns:
Boolean
See Also:
FormItem.getShowFocusedIcons(), getShowFocused()

setShowOver

public void setShowOver(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?

Note : This is an advanced setting

Parameters:
showOver - Default value is null
See Also:
FormItem.setShowOverIcons(java.lang.Boolean)

getShowOver

public 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?

Returns:
Boolean
See Also:
FormItem.getShowOverIcons()

setShowRTL

public void setShowRTL(Boolean showRTL)
Should this icon's 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

Parameters:
showRTL - Default value is null

getShowRTL

public Boolean getShowRTL()
Should this icon's 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.

Returns:
Boolean

setSrc

public void setSrc(String src)
If set, this property determines this icon's image source. If unset the form item's defaultIconSrc property will be used instead.
As with 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.

Parameters:
src - See SCImgURL . Default value is null
See Also:
FormItem.setDefaultIconSrc(java.lang.String), Icons Example

getSrc

public String getSrc()
If set, this property determines this icon's image source. If unset the form item's defaultIconSrc property will be used instead.
As with 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.

Returns:
See SCImgURL
See Also:
FormItem.getDefaultIconSrc(), Icons Example

setTabIndex

public void setTabIndex(Integer tabIndex)
TabIndex for this formItemIcon.

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 globalTabIndex.

Note : This is an advanced setting

Parameters:
tabIndex - Default value is null

getTabIndex

public Integer getTabIndex()
TabIndex for this formItemIcon.

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 globalTabIndex.

Returns:
Integer

setWidth

public void setWidth(Integer width)
If set, this property determines the width of this icon in px. If unset the form item's iconWidth property will be used instead.

Parameters:
width - Default value is null
See Also:
FormItem.setIconWidth(int)

getWidth

public Integer getWidth()
If set, this property determines the width of this icon in px. If unset the form item's iconWidth property will be used instead.

Returns:
Integer
See Also:
FormItem.getIconWidth()

addFormItemClickHandler

public HandlerRegistration addFormItemClickHandler(FormItemClickHandler handler)
Add a formItemClick handler.

Called when this icon is clicked. The default action is to call FormItem.showPicker.

Specified by:
addFormItemClickHandler in interface HasFormItemClickHandlers
Parameters:
handler - the formItemClick handler
Returns:
HandlerRegistration used to remove this handler

keyPress

public void keyPress(String keyName,
                     char character,
                     DynamicForm form,
                     FormItem item,
                     FormItemIcon icon)
StringMethod action to fire when this icon has focus and receives a keypress event. If unset the form item's iconKeyPress method will be fired instead (if specified).

Parameters:
keyName - Name of the key pressed
character - character produced by the keypress
form - The Dynamic Form to which this icon's item belongs.
item - The Form Item containing this icon
icon - A pointer to the form item icon

equals

public boolean equals(Object o)
Overrides:
equals in class JsObject

hashCode

public int hashCode()
Overrides:
hashCode in class JsObject

setShowIfCondition

public void setShowIfCondition(FormItemIfFunction showIf)
Set showIf condition.

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.

Parameters:
handler - the showIf handler