|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.gwtext.client.widgets.Component
com.gwtext.client.widgets.Button
public class Button
Simple Button class.
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 |
---|
Fields inherited from class com.gwtext.client.widgets.Component |
---|
config, id |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Button()
Create a new Button. |
|
Button(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
Button(java.lang.String text)
Create a new Button |
|
Button(java.lang.String text,
ButtonListener listener)
Create a new Button. |
|
Button(java.lang.String text,
ButtonListener listener,
java.lang.String icon)
Create a new Button. |
|
Button(java.lang.String text,
Menu menu)
Create a new Button. |
Method Summary | |
---|---|
void |
addListener(ButtonListener listener)
Add a Button listener. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject config)
|
void |
focus()
Focus the button. |
boolean |
getBindToForm()
|
com.google.gwt.user.client.Element |
getButtonElement()
An Ext Button consists of a table that wraps a button element. |
java.lang.String |
getClickEvent()
|
protected com.google.gwt.core.client.JavaScriptObject |
getConfigPrototype()
|
boolean |
getHandleMouseEvents()
False to disable visual cues on mouseover, mouseout and mousedown (defaults to true). |
java.lang.String |
getIcon()
|
java.lang.String |
getIconCls()
|
java.lang.String |
getMenuAlign()
The position to align the menu to. |
int |
getMinWidth()
The minimum width for this button. |
Panel |
getOwnerCt()
The Button's owner Panel, null before rendered. |
int |
getTabIndex()
|
java.lang.String |
getText()
|
java.lang.String |
getToggleGroup()
|
java.lang.String |
getTooltip()
|
java.lang.String |
getTooltipType()
The type of tooltip to use. |
java.lang.String |
getType()
The button's type, corresponding to the DOM input element type attribute. |
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
boolean |
hasVisibleMenu()
Returns true if the button has a menu and it is visible. |
void |
hideMenu()
Hide this button's menu (if it has one). |
boolean |
isDisabled()
Returns true if button is disabled. |
boolean |
isEnableToggle()
|
boolean |
isPressed()
True if the Button is pressed. |
boolean |
isRepeat()
|
void |
setClickEvent(java.lang.String clickEvent)
The type of event to map to the button's event handler (defaults to 'click') |
void |
setEnableToggle(boolean enableToggle)
True to enable pressed/not pressed toggling (defaults to false). |
void |
setFormBind(boolean bindToForm)
You can bind your form buttons to the valid state of the form. |
void |
setHandleMouseEvents(boolean handleMouseEvents)
False to disable visual cues on mouseover, mouseout and mousedown (defaults to true). |
void |
setHidden(boolean hidden)
True to start hidden or hide rendered button (defaults to false). |
void |
setIcon(java.lang.String icon)
The path to an image to display in the button (the image will be set as the background-image CSS property of the button by default, so if you want a mixed icon/text button, set cls:"x-btn-text-icon") |
void |
setIconCls(java.lang.String iconCls)
A css class which sets a background image to be used as the icon for this button (defaults to undefined). |
void |
setMenu(Menu menu)
Assign a button menu. |
void |
setMenuAlign(java.lang.String anchorPosition)
The position to align the menu to. |
void |
setMinWidth(int minWidth)
The minimum width for this button. |
void |
setPressed(boolean pressed)
True to start pressed (only if enableToggle = true). |
void |
setRepeat(boolean repeat)
True to repeat fire the click event while the mouse is down. |
void |
setRepeat(ClickRepeaterConfig qconfig)
Fire click event when mouse is down. |
void |
setTabIndex(int tabIndex)
Set a DOM tabIndex for this button. |
void |
setTemplate(Template template)
A Template with which to create the Button's main element. |
void |
setText(java.lang.String text)
The button text. |
void |
setToggleGroup(java.lang.String toggleGroup)
The group this toggle button is a member of (only 1 per group can be pressed, only applies if enableToggle = true). |
void |
setTooltip(QuickTipsConfig qtipConfig)
The tooltip for the button. |
void |
setTooltip(java.lang.String tooltip)
The tooltip for the button. |
void |
setTooltip(java.lang.String title,
java.lang.String text)
The tooltip for the button. |
void |
setTooltipType(boolean quickTip)
The type of tooltip to use. |
void |
setType(java.lang.String type)
The button's type, corresponding to the DOM input element type attribute. |
void |
showMenu()
Show this button's menu (if it has one). |
void |
toggle()
Toggle the current state. |
void |
toggle(boolean state)
Toggle the button to the passed state. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Button()
public Button(java.lang.String text)
text
- the button labelpublic Button(java.lang.String text, Menu menu)
text
- the Button labelmenu
- the Button menupublic Button(java.lang.String text, ButtonListener listener)
text
- the button labellistener
- the Button listener.ButtonListenerAdapter
public Button(java.lang.String text, ButtonListener listener, java.lang.String icon)
text
- the button labellistener
- the Button listenericon
- the button iconButtonListenerAdapter
,
setIcon(String)
public Button(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
getConfigPrototype
in class Component
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
create
in class Component
public boolean isDisabled()
isDisabled
in class Component
public void focus()
focus
in class Component
public com.google.gwt.user.client.Element getButtonElement()
public Panel getOwnerCt()
public boolean hasVisibleMenu()
public void hideMenu()
public void showMenu()
public void toggle()
public void toggle(boolean state)
state
- true to toggle pressedpublic void addListener(ButtonListener listener)
listener
- the listenerpublic java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class Component
public void setClickEvent(java.lang.String clickEvent) throws java.lang.IllegalStateException
clickEvent
- the click event
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getClickEvent()
public void setEnableToggle(boolean enableToggle)
enableToggle
- true to enable togglepublic boolean isEnableToggle()
public void setFormBind(boolean bindToForm)
bindToForm
- to to bind to form's valid statepublic boolean getBindToForm()
public void setHandleMouseEvents(boolean handleMouseEvents) throws java.lang.IllegalStateException
handleMouseEvents
- false to diable visual cues
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic boolean getHandleMouseEvents()
public void setHidden(boolean hidden)
hidden
- true for hiddenpublic void setIcon(java.lang.String icon)
icon
- the iconpublic java.lang.String getIcon()
public void setIconCls(java.lang.String iconCls)
iconCls
- the icon CSS classpublic java.lang.String getIconCls()
public void setMenu(Menu menu) throws java.lang.IllegalStateException
menu
- the button menu
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMenuAlign(java.lang.String anchorPosition)
anchorPosition
- the element's anchor positionpublic java.lang.String getMenuAlign()
public void setMinWidth(int minWidth) throws java.lang.IllegalStateException
minWidth
- the min width
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic int getMinWidth()
public void setPressed(boolean pressed)
pressed
- true for pressedpublic boolean isPressed()
toggle(boolean)
public void setRepeat(boolean repeat)
repeat
- true to repeatpublic boolean isRepeat()
public void setRepeat(ClickRepeaterConfig qconfig)
qconfig
- the click repeat configurationpublic void setTabIndex(int tabIndex) throws java.lang.IllegalStateException
tabIndex
- the tab index
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic int getTabIndex()
public void setTemplate(Template template)
Template
with which to create the Button's main element. This Template must
contain numeric substitution parameter 0 if it is to display the text property. Changing the template could
require code modifications if required elements (e.g. a button) aren't present.
The defaut tempalte is
<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>
<td class="x-btn-left"><i> </i></td><td class="x-btn-center"><em unselectable="on"><button class="x-btn-text" type="{1}">{0}</button></em></td><td class="x-btn-right"><i> </i></td>
</tr></tbody></table>
template
- the button templatepublic void setText(java.lang.String text)
text
- the buttons textpublic java.lang.String getText()
public void setToggleGroup(java.lang.String toggleGroup) throws java.lang.IllegalStateException
toggleGroup
- the button's toggle group
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getToggleGroup()
public void setTooltip(java.lang.String tooltip)
tooltip
- the tooltippublic java.lang.String getTooltip()
public void setTooltip(java.lang.String title, java.lang.String text)
title
- the tootlip titletext
- the tootlip textpublic void setTooltip(QuickTipsConfig qtipConfig) throws java.lang.IllegalStateException
qtipConfig
- the tooltip config
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTooltipType(boolean quickTip) throws java.lang.IllegalStateException
quickTip
- true for quicktips, false for the "title" attribute.
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getTooltipType()
public void setType(java.lang.String type) throws java.lang.IllegalStateException
type
- the button type
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic java.lang.String getType()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |