org.exoplatform.gwtframework.ui.client.component
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.google.gwt.user.client.ui.Composite
              extended by org.exoplatform.gwtframework.ui.client.component.IconButton
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget
Direct Known Subclasses:
IconButtonControl

public class IconButton
extends com.google.gwt.user.client.ui.Composite
implements com.google.gwt.event.dom.client.HasClickHandlers

Created by The eXo Platform SAS .

Version:
$
Author:
Vitaliy Gulyy

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
protected  com.google.gwt.user.client.Command command
          Command which will be executed when button was pressed.
protected  java.lang.String disabledIcon
          Icon for disabled state.
protected  java.lang.String icon
          Icon for enabled state.
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
IconButton()
          Creates new instance of this IconButton.
IconButton(com.google.gwt.user.client.ui.Image icon, com.google.gwt.user.client.ui.Image disabledIcon)
          Creates a new instance of this IconButton
IconButton(java.lang.String icon, java.lang.String disabledIcon)
          Create IconButton with icons.
IconButton(java.lang.String icon, java.lang.String disabledIcon, com.google.gwt.user.client.Command command)
          Create IconButton with icons and command.
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
           
 com.google.gwt.user.client.Command getCommand()
          Get command which will be executed when button was pressed.
 java.lang.String getDisabledIcon()
          Get icon for disabled state.
 java.lang.String getIcon()
          Get icon for enabled state.
 boolean isEnabled()
          Get is enabled.
 boolean isSelected()
          Get is button selected.
 void setCommand(com.google.gwt.user.client.Command command)
          Set command which will be executed when button was pressed.
 void setDisabledIcon(java.lang.String disabledIcon)
          Set icon as HTML image for disabled state.
 void setEnabled(boolean enabled)
          Set is enabled.
 void setIcon(java.lang.String icon)
          Set icon as HTML image for enabled state.
 void setImageName(java.lang.String imageName)
          Set name of the image which will be received from ImageFactory
 void setSelected(boolean selected)
          Set button is selected.
 void setTitle(java.lang.String title)
          Sets the title associated with this button.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Field Detail

icon

protected java.lang.String icon
Icon for enabled state. Icon must be represented as HTML string. e.g.


disabledIcon

protected java.lang.String disabledIcon
Icon for disabled state. Icon must be represented as HTML string. e.g.


command

protected com.google.gwt.user.client.Command command
Command which will be executed when button was pressed.

Constructor Detail

IconButton

public IconButton(java.lang.String icon,
                  java.lang.String disabledIcon)
Create IconButton with icons. Icons is an HTML image and must be prepared like "" tag Use org.exoplatform.gwtframework.ui.client.util.ImageHelper to create Image from some sources.

Parameters:
icon - icon for enabled state
disabledIcon - icon for disabled state

IconButton

public IconButton()
Creates new instance of this IconButton.


IconButton

public IconButton(com.google.gwt.user.client.ui.Image icon,
                  com.google.gwt.user.client.ui.Image disabledIcon)
Creates a new instance of this IconButton

Parameters:
icon - html image for enabled state
disabledIcon - html image for disabled state

IconButton

public IconButton(java.lang.String icon,
                  java.lang.String disabledIcon,
                  com.google.gwt.user.client.Command command)
Create IconButton with icons and command. Icons is an HTML image and must be prepared like "" tag Use org.exoplatform.gwtframework.ui.client.util.ImageHelper to create Image from some sources.

Parameters:
icon - icon for enabled state
disabledIcon - icon for disabled state
command - command which will be executed when button was pressed.
Method Detail

getCommand

public com.google.gwt.user.client.Command getCommand()
Get command which will be executed when button was pressed.

Returns:
command which will be executed when button was pressed

setCommand

public void setCommand(com.google.gwt.user.client.Command command)
Set command which will be executed when button was pressed.

Parameters:
command - command which will be executed when button was pressed

isEnabled

public boolean isEnabled()
Get is enabled.

Returns:
is enabled

setEnabled

public void setEnabled(boolean enabled)
Set is enabled.

Parameters:
enabled - is enabled

getIcon

public java.lang.String getIcon()
Get icon for enabled state.

Returns:
icon which is uses for enabled state

setIcon

public void setIcon(java.lang.String icon)
Set icon as HTML image for enabled state. Image must be prepared like "" tag Use org.exoplatform.gwtframework.ui.client.util.ImageHelper for creation Image from some sources.

Parameters:
icon - icon

getDisabledIcon

public java.lang.String getDisabledIcon()
Get icon for disabled state.

Returns:
icon which is uses for disabled state

setDisabledIcon

public void setDisabledIcon(java.lang.String disabledIcon)
Set icon as HTML image for disabled state. Image must be prepared like "" tag Use org.exoplatform.gwtframework.ui.client.util.ImageHelper for creation Image from some sources.

Parameters:
disabledIcon - icon which is uses for disabled state

isSelected

public boolean isSelected()
Get is button selected.

Returns:
true if button selected, false otherwise.

setSelected

public void setSelected(boolean selected)
Set button is selected.

Parameters:
selected - is button selected

setImageName

public void setImageName(java.lang.String imageName)
Set name of the image which will be received from ImageFactory

Parameters:
imageName - name of the image

setTitle

public void setTitle(java.lang.String title)
Sets the title associated with this button. The title is the 'tool-tip' displayed to users when they hover over the object.

Overrides:
setTitle in class com.google.gwt.user.client.ui.UIObject
Parameters:
title - the object's new title

addClickHandler

public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
Specified by:
addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlers


Copyright © 2012 eXo Platform SAS. All Rights Reserved.