| java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.client.ui.FocusWidget com.google.gwt.user.client.ui.ButtonBase com.google.gwt.user.client.ui.CustomButton
All known Subclasses: com.google.gwt.user.client.ui.PushButton, com.google.gwt.user.client.ui.ToggleButton,
CustomButton | abstract public class CustomButton extends ButtonBase implements SourcesKeyboardEvents(Code) | | Custom Button is a base button class with built in support for a set number
of button faces.
Each face has its own style modifier. For example, the state for down and
hovering is assigned the CSS modifier down-hovering. So, if the
button's overall style name is gwt-PushButton then when showing the
down-hovering face, the button's style is
gwt-PushButton-down-hovering. The overall style name can be used to
change the style of the button irrespective of the current face.
Each button face can be assigned is own image, text, or html contents. If no
content is defined for a face, then the face will use the contents of another
face. For example, if down-hovering does not have defined
contents, it will use the contents defined by the down face.
The supported faces are defined below:
|
Method Summary | |
void | finishSetup() Common setup between constructors. | Face | getCurrentFace() Gets the current face of the button. | final public Face | getDownDisabledFace() Gets the downDisabled face of the button. | final public Face | getDownFace() Gets the down face of the button. | final public Face | getDownHoveringFace() Gets the downHovering face of the button. | public String | getHTML() Gets the current face's html. | public int | getTabIndex() | public String | getText() Gets the current face's text. | final public Face | getUpDisabledFace() Gets the upDisabled face of the button. | final public Face | getUpFace() Gets the up face of the button. | final public Face | getUpHoveringFace() Gets the upHovering face of the button. | protected boolean | isDown() | final boolean | isHovering() | protected void | onAttach() Overridden on attach to ensure that a button face has been chosen before
the button is displayed. | public void | onBrowserEvent(Event event) | protected void | onClick() Called when the user finishes clicking on this button. | protected void | onClickCancel() Called when the user aborts a click in progress; for example, by dragging
the mouse outside of the button before releasing the mouse button. | protected void | onClickStart() Called when the user begins to click on this button. | protected void | onDetach() | public void | setAccessKey(char key) | void | setCurrentFace(Face newFace) | protected void | setDown(boolean down) Sets whether this button is down. | final public void | setEnabled(boolean enabled) Sets whether this button is enabled. | public void | setFocus(boolean focused) | public void | setHTML(String html) Sets the current face's html. | final void | setHovering(boolean hovering) Sets whether this button is hovering. | public void | setTabIndex(int index) | public void | setText(String text) Sets the current face's text. | void | toggleDown() Toggle the up/down attribute. |
CustomButton | public CustomButton(Image upImage)(Code) | | Constructor for CustomButton .
Parameters: upImage - image for the default (up) face of the button |
CustomButton | public CustomButton(Image upImage, Image downImage)(Code) | | Constructor for CustomButton .
Parameters: upImage - image for the default (up) face of the button Parameters: downImage - image for the down face of the button |
CustomButton | public CustomButton(Image upImage, Image downImage, ClickListener listener)(Code) | | Constructor for CustomButton .
Parameters: upImage - image for the default (up) face of the button Parameters: downImage - image for the down face of the button Parameters: listener - clickListener |
CustomButton | public CustomButton(Image upImage, ClickListener listener)(Code) | | Constructor for CustomButton .
Parameters: upImage - image for the default (up) face of the button Parameters: listener - the click listener |
CustomButton | public CustomButton(String upText)(Code) | | Constructor for CustomButton .
Parameters: upText - the text for the default (up) face of the button. |
CustomButton | public CustomButton(String upText, ClickListener listener)(Code) | | Constructor for CustomButton .
Parameters: upText - the text for the default (up) face of the button Parameters: listener - the click listener |
CustomButton | public CustomButton(String upText, String downText)(Code) | | Constructor for CustomButton .
Parameters: upText - the text for the default (up) face of the button Parameters: downText - the text for the down face of the button |
CustomButton | public CustomButton(String upText, String downText, ClickListener listener)(Code) | | Constructor for CustomButton .
Parameters: upText - the text for the default (up) face of the button Parameters: downText - the text for the down face of the button Parameters: listener - the click listener |
CustomButton | protected CustomButton()(Code) | | Constructor for CustomButton .
|
finishSetup | void finishSetup()(Code) | | Common setup between constructors.
|
getCurrentFace | Face getCurrentFace()(Code) | | Gets the current face of the button.
the current face |
getDownDisabledFace | final public Face getDownDisabledFace()(Code) | | Gets the downDisabled face of the button.
the downDisabled face |
getDownFace | final public Face getDownFace()(Code) | | Gets the down face of the button.
the down face |
getDownHoveringFace | final public Face getDownHoveringFace()(Code) | | Gets the downHovering face of the button.
the downHovering face |
getHTML | public String getHTML()(Code) | | Gets the current face's html.
current face's html |
getTabIndex | public int getTabIndex()(Code) | | |
getText | public String getText()(Code) | | Gets the current face's text.
current face's text |
getUpDisabledFace | final public Face getUpDisabledFace()(Code) | | Gets the upDisabled face of the button.
the upDisabled face |
getUpFace | final public Face getUpFace()(Code) | | Gets the up face of the button.
the up face |
getUpHoveringFace | final public Face getUpHoveringFace()(Code) | | Gets the upHovering face of the button.
the upHovering face |
isDown | protected boolean isDown()(Code) | | Is this button down?
true if the button is down |
isHovering | final boolean isHovering()(Code) | | Is the mouse hovering over this button?
true if the mouse is hovering |
onAttach | protected void onAttach()(Code) | | Overridden on attach to ensure that a button face has been chosen before
the button is displayed.
|
onBrowserEvent | public void onBrowserEvent(Event event)(Code) | | |
onClick | protected void onClick()(Code) | | Called when the user finishes clicking on this button. The default behavior
is to fire the click event to listeners. Subclasses that override
CustomButton.onClickStart() should override this method to restore the normal
widget display.
|
onClickCancel | protected void onClickCancel()(Code) | | Called when the user aborts a click in progress; for example, by dragging
the mouse outside of the button before releasing the mouse button.
Subclasses that override
CustomButton.onClickStart() should override this
method to restore the normal widget display.
|
onClickStart | protected void onClickStart()(Code) | | Called when the user begins to click on this button. Subclasses may
override this method to display the start of the click visually; such
subclasses should also override
CustomButton.onClick() and
CustomButton.onClickCancel() to restore normal visual state. Each
onClickStart will eventually be followed by either
onClick or onClickCancel , depending on
whether the click is completed.
|
onDetach | protected void onDetach()(Code) | | |
setAccessKey | public void setAccessKey(char key)(Code) | | |
setCurrentFace | void setCurrentFace(Face newFace)(Code) | | |
setDown | protected void setDown(boolean down)(Code) | | Sets whether this button is down.
Parameters: down - true to press the button, false otherwise |
setEnabled | final public void setEnabled(boolean enabled)(Code) | | Sets whether this button is enabled.
Parameters: enabled - true to enable the button, false to disable it |
setFocus | public void setFocus(boolean focused)(Code) | | |
setHTML | public void setHTML(String html)(Code) | | Sets the current face's html.
Parameters: html - html to set |
setHovering | final void setHovering(boolean hovering)(Code) | | Sets whether this button is hovering.
Parameters: hovering - is this button hovering? |
setTabIndex | public void setTabIndex(int index)(Code) | | |
setText | public void setText(String text)(Code) | | Sets the current face's text.
Parameters: text - text to set |
toggleDown | void toggleDown()(Code) | | Toggle the up/down attribute.
|
|
|