com.smartgwt.client.widgets
Class IconButton

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.smartgwt.client.widgets.BaseWidget
              extended by com.smartgwt.client.widgets.Canvas
                  extended by com.smartgwt.client.widgets.StatefulCanvas
                      extended by com.smartgwt.client.widgets.Button
                          extended by com.smartgwt.client.widgets.IconButton
All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, IsWidget, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasIconClickHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers
Direct Known Subclasses:
IconMenuButton

public class IconButton
extends Button

A Button subclass that displays an icon, title and optional menuIcon and is capable of horizontal and vertical orientation.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.smartgwt.client.widgets.BaseWidget
config, configOnly, id, isElementSet, scClassName
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
IconButton()
           
IconButton(JavaScriptObject jsObj)
           
IconButton(String title)
           
 
Method Summary
protected  JavaScriptObject create()
           
 String getBaseStyle()
          Default CSS class.
 String getIcon()
          Icon to show to the left of or above the title, according to the button's Orientation.
 int getIconSize()
          The size of the normal icon for this button.
 String getLargeIcon()
          Icon to show above the title when Orientation is "vertical".
 int getLargeIconSize()
          The size of the large icon for this button.
 String getMenuIconSrc()
          Image that shows a menu when clicked.
static IconButton getOrCreateRef(JavaScriptObject jsObj)
           
 String getOrientation()
          The orientation of this IconButton.
 Boolean getShowMenuIcon()
          Whether to show the menu-icon which fires the menuIconClicked notification method when clicked.
 Boolean getShowMenuIconOver()
          Image that shows a menu when clicked.
 void menuIconClick()
          Notification method fired when a user clicks on the menuIcon on this IconButton.
 void setBaseStyle(String baseStyle)
          Default CSS class.
static void setDefaultProperties(IconButton iconButtonProperties)
          Class level method to set the default properties of this class.
 void setIcon(String icon)
          Icon to show to the left of or above the title, according to the button's Orientation.
 void setIconSize(int iconSize)
          The size of the normal icon for this button.
 void setLargeIcon(String largeIcon)
          Icon to show above the title when Orientation is "vertical".
 void setLargeIconSize(int largeIconSize)
          The size of the large icon for this button.
 void setMenuIconSrc(String menuIconSrc)
          Image that shows a menu when clicked.
 void setOrientation(String orientation)
          The orientation of this IconButton.
 void setShowMenuIcon(Boolean showMenuIcon)
          Whether to show the menu-icon which fires the menuIconClicked notification method when clicked.
 void setShowMenuIconOver(Boolean showMenuIconOver)
          Image that shows a menu when clicked.
 
Methods inherited from class com.smartgwt.client.widgets.Button
action, addIconClickHandler, addToRadioGroup, deselect, getActionType, getAlign, getAutoFit, getHiliteAccessKey, getIconAlign, getIconHeight, getIconOrientation, getIconWidth, getRadioGroup, getSelected, getShowDisabled, getShowDisabledIcon, getShowDown, getShowDownIcon, getShowFocused, getShowFocusedIcon, getShowRollOver, getShowRollOverIcon, getShowSelectedIcon, getState, getTitle, getValign, getWrap, isSelected, removeFromRadioGroup, removeFromRadioGroup, select, setActionType, setAlign, setAutoFit, setDefaultProperties, setDisabled, setHiliteAccessKey, setIconAlign, setIconHeight, setIconOrientation, setIconWidth, setRadioGroup, setSelected, setShowDisabled, setShowDisabledIcon, setShowDown, setShowDownIcon, setShowFocused, setShowFocusedIcon, setShowRollOver, setShowRollOverIcon, setShowSelectedIcon, setState, setTitle, setVAlign, setValign, setWrap
 
Methods inherited from class com.smartgwt.client.widgets.StatefulCanvas
getOverCanvasConstructor, getRedrawOnStateChange, getShowFocusedAsOver, getShowOverCanvas, getStateSuffix, setDefaultProperties, setOverCanvasConstructor, setRedrawOnStateChange, setShowFocusedAsOver, setShowOverCanvas, setTitleStyle
 
Methods inherited from class com.smartgwt.client.widgets.Canvas
addChild, addChild, addChild, addClickHandler, addDoubleClickHandler, addDragMoveHandler, addDragRepositionMoveHandler, addDragRepositionStartHandler, addDragRepositionStopHandler, addDragResizeMoveHandler, addDragResizeStartHandler, addDragResizeStopHandler, addDragStartHandler, addDragStopHandler, addDropHandler, addDropMoveHandler, addDropOutHandler, addDropOverHandler, addFocusChangedHandler, addHoverHandler, addHoverHiddenHandler, addKeyDownHandler, addKeyPressHandler, addMouseDownHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseStillDownHandler, addMouseUpHandler, addMouseWheelHandler, addMovedHandler, addParentMovedHandler, addPeer, addPeer, addResizedHandler, addRightMouseDownHandler, addScrolledHandler, addShowContextMenuHandler, addStyleName, addVisibilityChangedHandler, adjustForContent, animateFade, animateFade, animateFade, animateHide, animateHide, animateHide, animateMove, animateMove, animateMove, animateMove, animateRect, animateRect, animateRect, animateResize, animateResize, animateResize, animateScroll, animateScroll, animateScroll, animateShow, animateShow, animateShow, blur, bringToFront, clear, clickMaskUp, clickMaskUp, contains, contains, containsEvent, containsFocus, containsPoint, containsPoint, convertToCanvasArray, disable, enable, focus, getAbsoluteLeft, getAbsoluteTop, getAccessKey, getAnimateAcceleration, getAnimateFadeTime, getAnimateHideAcceleration, getAnimateHideTime, getAnimateMoveAcceleration, getAnimateMoveTime, getAnimateRectAcceleration, getAnimateRectTime, getAnimateResizeAcceleration, getAnimateResizeTime, getAnimateScrollAcceleration, getAnimateScrollTime, getAnimateShowAcceleration, getAnimateShowEffect, getAnimateShowTime, getAnimateTime, getAppImgDir, getAriaRole, getAutoDraw, getAutoShowParent, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBottom, getById, getCanAcceptDrop, getCanDrag, getCanDragReposition, getCanDragResize, getCanDragScroll, getCanDrop, getCanDropBefore, getCanFocus, getCanHover, getCanSelectText, getCanvasItem, getChildren, getChildrenSnapResizeToGrid, getChildrenSnapToGrid, getContents, getContextMenu, getCursor, getDataPath, getDefaultHeight, getDefaultWidth, getDestroyed, getDestroying, getDisabled, getDisabledCursor, getDoubleClickDelay, getDragAppearance, getDragIntersectStyle, getDragOpacity, getDragRepositionAppearance, getDragRepositionCursor, getDragResizeAppearance, getDragScrollDelay, getDragStartDistance, getDragTarget, getDragType, getDynamicContents, getEdgeBackgroundColor, getEdgeCenterBackgroundColor, getEdgeImage, getEdgeMarginSize, getEdgeOffset, getEdgeOpacity, getEdgeShowCenter, getEdgeSize, getExtraSpace, getFacetId, getFullDataPath, getGroupTitle, getHeight, getHeightAsString, getHoverAlign, getHoverAutoDestroy, getHoverComponent, getHoverDelay, getHoverHeight, getHoverHTML, getHoverMoveWithMouse, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWrap, getHSnapOrigin, getHSnapOrigin, getHSnapPosition, getHSnapPosition, getHtmlPosition, getImgURL, getImgURL, getInnerContentHeight, getInnerContentWidth, getInnerHeight, getInnerWidth, getIsGroup, getLeft, getLeftAsString, getLocateChildrenBy, getLocateChildrenType, getLocatePeersBy, getLocatePeersType, getMargin, getMatchElement, getMaxHeight, getMaxWidth, getMenuConstructor, getMinHeight, getMinWidth, getMouseStillDownDelay, getMouseStillDownInitialDelay, getNextZIndex, getNoDoubleClicks, getOffsetHeight, getOffsetWidth, getOffsetX, getOffsetY, getOpacity, getOverflow, getPadding, getPageBottom, getPageLeft, getPageRect, getPageRight, getPageTop, getParentElement, getPercentBox, getPosition, getPrefix, getPrintHTML, getPrintHTML, getPrompt, getRect, getRedrawOnResize, getResizeBarTarget, getRight, getScrollbarSize, getScrollBottom, getScrollHeight, getScrollLeft, getScrollRight, getScrollTop, getScrollWidth, getShadowDepth, getShadowImage, getShadowOffset, getShadowSoftness, getShouldPrint, getShowCustomScrollbars, getShowDragShadow, getShowEdges, getShowHover, getShowHoverComponents, getShowResizeBar, getShowShadow, getSkinImgDir, getSnapAxis, getSnapEdge, getSnapHDirection, getSnapHGap, getSnapOffsetLeft, getSnapOffsetTop, getSnapOnDrop, getSnapResizeToGrid, getSnapTo, getSnapToGrid, getSnapVDirection, getSnapVGap, getStyleName, getTabIndex, getTooltip, getTop, getTopAsString, getUseOpacityFilter, getValuesManager, getViewportHeight, getViewportWidth, getVisibility, getVisibleHeight, getVisibleWidth, getVSnapOrigin, getVSnapOrigin, getVSnapPosition, getVSnapPosition, getWidth, getWidthAsString, getZIndex, handleHover, hide, hideClickMask, hideClickMask, hideContextMenu, imgHTML, imgHTML, imgHTML, intersects, isDirty, isDisabled, isDrawn, isVisible, keyUp, layoutChildren, linkHTML, linkHTML, markForDestroy, markForRedraw, markForRedraw, moveAbove, moveBelow, moveBy, moveTo, onInit, parentResized, printComponents, redraw, redraw, removeChild, removeChild, resizeBy, resizeTo, resizeTo, scrollBy, scrollByPercent, scrollTo, scrollTo, scrollToBottom, scrollToLeft, scrollToPercent, scrollToRight, scrollToTop, sendToBack, setAccessKey, setAllowExternalFilters, setAnimateAcceleration, setAnimateFadeTime, setAnimateHideAcceleration, setAnimateHideTime, setAnimateMoveAcceleration, setAnimateMoveTime, setAnimateRectAcceleration, setAnimateRectTime, setAnimateResizeAcceleration, setAnimateResizeTime, setAnimateScrollAcceleration, setAnimateScrollTime, setAnimateShowAcceleration, setAnimateShowEffect, setAnimateShowTime, setAnimateTime, setAppImgDir, setAriaRole, setAutoDraw, setAutoHeight, setAutoShowParent, setAutoWidth, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBottom, setCanAcceptDrop, setCanDrag, setCanDragReposition, setCanDragResize, setCanDragScroll, setCanDrop, setCanDropBefore, setCanFocus, setCanHover, setCanSelectText, setCanvasItem, setChildren, setChildrenSnapResizeToGrid, setChildrenSnapToGrid, setContents, setContextMenu, setCursor, setDataPath, setDefaultHeight, setDefaultProperties, setDefaultWidth, setDisabledCursor, setDoubleClickDelay, setDragAppearance, setDragIntersectStyle, setDragOpacity, setDragRepositionAppearance, setDragRepositionCursor, setDragResizeAppearance, setDragScrollDelay, setDragStartDistance, setDragTarget, setDragType, setDropTypes, setDynamicContents, setEdgeBackgroundColor, setEdgeCenterBackgroundColor, setEdgeImage, setEdgeMarginSize, setEdgeOffset, setEdgeOpacity, setEdgeShowCenter, setEdgeSize, setExtraSpace, setFacetId, setGroupTitle, setHeight, setHeight, setHeight100, setHoverAlign, setHoverAutoDestroy, setHoverDelay, setHoverHeight, setHoverMoveWithMouse, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWrap, setHtmlPosition, setImage, setImage, setIsGroup, setKeepInParentRect, setKeepInParentRect, setLayoutAlign, setLayoutAlign, setLeft, setLeft, setLocateChildrenBy, setLocateChildrenType, setLocatePeersBy, setLocatePeersType, setMargin, setMatchElement, setMaxHeight, setMaxWidth, setMenuConstructor, setMinHeight, setMinWidth, setMouseStillDownDelay, setMouseStillDownInitialDelay, setNeverUseFilters, setNoDoubleClicks, setOpacity, setOverflow, setPadding, setPageLeft, setPageTop, setParentElement, setPercentBox, setPosition, setPrefix, setPrompt, setRect, setRect, setRedrawOnResize, setResizeBarTarget, setResizeFrom, setRight, setScrollbarSize, setShadowDepth, setShadowImage, setShadowOffset, setShadowSoftness, setShouldPrint, setShowCustomScrollbars, setShowDragShadow, setShowEdges, setShowHover, setShowHoverComponents, setShowResizeBar, setShowShadow, setSkinImgDir, setSmoothFade, setSnapAxis, setSnapEdge, setSnapHDirection, setSnapHGap, setSnapOffsetLeft, setSnapOffsetTop, setSnapOnDrop, setSnapResizeToGrid, setSnapTo, setSnapToGrid, setSnapVDirection, setSnapVGap, setStyleName, setTabIndex, setTooltip, setTop, setTop, setUseOpacityFilter, setValuesManager, setVisibility, setVisible, setWidth, setWidth, setWidth100, setZIndex, shouldDragScroll, show, showClickMask, showNextTo, showNextTo, showPrintPreview, showPrintPreview, showPrintPreview, showPrintPreview, showRecursively, updateHover, updateHover, updateShadow, visibleAtPoint, willAcceptDrop
 
Methods inherited from class com.smartgwt.client.widgets.BaseWidget
addDrawHandler, destroy, doAddHandler, doInit, doOnRender, draw, equals, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsFloatArray, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getConfig, getDOM, getElement, getElement, getHandlerCount, getID, getInnerHTML, getJsObj, getOrCreateJsObj, getRef, getScClassName, hashCode, isConfigOnly, isCreated, onDestroy, onDraw, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setDragTracker, setElement, setHtmlElement, setID, setNullProperty, setPosition, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setScClassName, toString
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getStyleElement, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

IconButton

public IconButton()

IconButton

public IconButton(JavaScriptObject jsObj)

IconButton

public IconButton(String title)
Method Detail

getOrCreateRef

public static IconButton getOrCreateRef(JavaScriptObject jsObj)

create

protected JavaScriptObject create()
Overrides:
create in class Button

setBaseStyle

public void setBaseStyle(String baseStyle)
Default CSS class.

Overrides:
setBaseStyle in class Button
Parameters:
baseStyle - baseStyle Default value is "iconButton"

getBaseStyle

public String getBaseStyle()
Default CSS class.

Overrides:
getBaseStyle in class Button
Returns:
String

setIcon

public void setIcon(String icon)
Icon to show to the left of or above the title, according to the button's Orientation.

When specifying titleOrientation = "vertical", this icon will be stretched to the largeIconSize unless a largeIcon is specified.

Overrides:
setIcon in class Button
Parameters:
icon - icon Default value is null
See Also:
ButtonIcon overview and related methods, Icons Example

getIcon

public String getIcon()
Icon to show to the left of or above the title, according to the button's Orientation.

When specifying titleOrientation = "vertical", this icon will be stretched to the largeIconSize unless a largeIcon is specified.

Overrides:
getIcon in class Button
Returns:
String
See Also:
ButtonIcon overview and related methods, Icons Example

setIconSize

public void setIconSize(int iconSize)
The size of the normal icon for this button.

Overrides:
setIconSize in class Button
Parameters:
iconSize - iconSize Default value is 16
See Also:
ButtonIcon overview and related methods

getIconSize

public int getIconSize()
The size of the normal icon for this button.

Overrides:
getIconSize in class Button
Returns:
int
See Also:
ButtonIcon overview and related methods

setLargeIcon

public void setLargeIcon(String largeIcon)
Icon to show above the title when Orientation is "vertical".

If a largeIcon is not specified, the normal icon will be stretched to the largeIconSize.

Parameters:
largeIcon - largeIcon Default value is null

getLargeIcon

public String getLargeIcon()
Icon to show above the title when Orientation is "vertical".

If a largeIcon is not specified, the normal icon will be stretched to the largeIconSize.

Returns:
String

setLargeIconSize

public void setLargeIconSize(int largeIconSize)
The size of the large icon for this button. If largeIcon is not specified, the normal icon will be stretched to this size.

Parameters:
largeIconSize - largeIconSize Default value is 32

getLargeIconSize

public int getLargeIconSize()
The size of the large icon for this button. If largeIcon is not specified, the normal icon will be stretched to this size.

Returns:
int

setMenuIconSrc

public void setMenuIconSrc(String menuIconSrc)
Image that shows a menu when clicked.

Parameters:
menuIconSrc - menuIconSrc Default value is "[SKINIMG]/Menu/submenu_down.png"

getMenuIconSrc

public String getMenuIconSrc()
Image that shows a menu when clicked.

Returns:
String

setOrientation

public void setOrientation(String orientation)
The orientation of this IconButton. The default value, "horizontal", renders icon, title and potentially menuIcon from left to right: "vertical" does the same from top to bottom.

Parameters:
orientation - orientation Default value is "horizontal"

getOrientation

public String getOrientation()
The orientation of this IconButton. The default value, "horizontal", renders icon, title and potentially menuIcon from left to right: "vertical" does the same from top to bottom.

Returns:
String

setShowMenuIcon

public void setShowMenuIcon(Boolean showMenuIcon)
Whether to show the menu-icon which fires the menuIconClicked notification method when clicked.

Parameters:
showMenuIcon - showMenuIcon Default value is false

getShowMenuIcon

public Boolean getShowMenuIcon()
Whether to show the menu-icon which fires the menuIconClicked notification method when clicked.

Returns:
Boolean

setShowMenuIconOver

public void setShowMenuIconOver(Boolean showMenuIconOver)
Image that shows a menu when clicked.

Parameters:
showMenuIconOver - showMenuIconOver Default value is false

getShowMenuIconOver

public Boolean getShowMenuIconOver()
Image that shows a menu when clicked.

Returns:
Boolean

menuIconClick

public void menuIconClick()
Notification method fired when a user clicks on the menuIcon on this IconButton.


setDefaultProperties

public static void setDefaultProperties(IconButton iconButtonProperties)
Class level method to set the default properties of this class. If set, then all subsequent instances of this class will automatically have the default properties that were set when this method was called. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

Note: This method is intended for setting default attributes only and will effect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead.

Parameters:
iconButtonProperties - properties that should be used as new defaults when instances of this class are created