|
|||||||||
| 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.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.button.Button
public class Button
A button component.
| 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 El |
buttonEl
|
protected java.lang.String |
buttonSelector
|
protected java.lang.String |
html
|
protected com.google.gwt.user.client.ui.AbstractImagePrototype |
icon
|
protected Menu |
menu
|
protected Style.ButtonScale |
scale
|
protected Template |
template
|
| Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width |
| Fields inherited from class com.extjs.gxt.ui.client.widget.Component |
|---|
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Button()
Creates a new button. |
|
Button(java.lang.String html)
Creates a new button with the given HTML. |
|
Button(java.lang.String html,
com.google.gwt.user.client.ui.AbstractImagePrototype icon)
Creates a new button with the given HTML and icon. |
|
Button(java.lang.String html,
com.google.gwt.user.client.ui.AbstractImagePrototype icon,
SelectionListener<ButtonEvent> listener)
Creates a new button with the given HTML, icon and specified selection listener. |
|
Button(java.lang.String html,
SelectionListener<ButtonEvent> listener)
Creates a new button with the given HTML and specified selection listener. |
|
| Method Summary | |
|---|---|
void |
addSelectionListener(SelectionListener<ButtonEvent> listener)
Adds a selection listener. |
protected void |
afterRender()
Called after the component has been rendered and is attached for the first time. |
protected void |
alignIcon(com.google.gwt.user.client.Element icon)
|
protected void |
autoWidth()
|
protected ComponentEvent |
createComponentEvent(com.google.gwt.user.client.Event event)
|
Style.ButtonArrowAlign |
getArrowAlign()
Returns the button's arrow alignment. |
protected El |
getFocusEl()
|
java.lang.String |
getHtml()
Returns the button's HTML content. |
com.google.gwt.user.client.ui.AbstractImagePrototype |
getIcon()
Returns the button's icon. |
Style.IconAlign |
getIconAlign()
Returns the button's icon alignment. |
Menu |
getMenu()
Returns the button's menu (if it has one). |
java.lang.String |
getMenuAlign()
Returns the button's menu alignment. |
protected java.lang.String |
getMenuClass()
|
int |
getMinWidth()
Returns the button's minimum width. |
boolean |
getMouseEvents()
Returns true if mouse over effect is disabled. |
Style.ButtonScale |
getScale()
Returns the buttons scale. |
java.lang.String |
getType()
|
void |
hideMenu()
Hide this button's menu (if it has one). |
protected void |
notifyShow()
|
protected void |
onBlur(ButtonEvent e)
|
protected void |
onClick(ComponentEvent ce)
|
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
protected void |
onDetach()
|
protected void |
onDisable()
|
protected void |
onEnable()
|
protected void |
onFocus(ComponentEvent ce)
|
protected void |
onKeyPress(ButtonEvent be)
|
protected void |
onMenuHide(ComponentEvent ce)
|
protected void |
onMenuShow(ComponentEvent ce)
|
protected void |
onMouseDown(ComponentEvent ce)
|
protected void |
onMouseOut(ComponentEvent ce)
|
protected void |
onMouseOver(ComponentEvent ce)
|
protected void |
onMouseUp(ComponentEvent ce)
|
protected void |
onRender(com.google.gwt.user.client.Element target,
int index)
Subclasses must override and ensure setElement is called for lazy rendered components. |
protected void |
onResize(int width,
int height)
Called after the component is resized, this method is empty by default but can be implemented by any subclass that needs to perform custom logic after a resize occurs. |
void |
removeSelectionListener(SelectionListener<ButtonEvent> listener)
Removes a previously added listener. |
protected void |
setAriaState(java.lang.String stateName,
java.lang.String stateValue)
|
void |
setArrowAlign(Style.ButtonArrowAlign arrowAlign)
Sets the arrow alignment (defaults to RIGHT). |
void |
setHtml(java.lang.String html)
Sets the button's text as HTML. |
void |
setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype icon)
Sets the button's icon style. |
void |
setIconAlign(Style.IconAlign iconAlign)
Sets the icon alignment (defaults to LEFT). |
void |
setIconStyle(java.lang.String icon)
Sets the icon style. |
void |
setMenu(Menu menu)
Sets the button's menu. |
void |
setMenuAlign(java.lang.String menuAlign)
Sets the position to align the menu to, see El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[]) for more
details (defaults to 'tl-bl?', pre-render). |
void |
setMinWidth(int minWidth)
Sets he minimum width for this button (used to give a set of buttons a common width) |
void |
setMouseEvents(boolean handleMouseEvents)
False to disable visual cues on mouseover, mouseout and mousedown (defaults to true). |
void |
setScale(Style.ButtonScale scale)
Sets the button scale. |
void |
setTabIndex(int index)
Sets the button's tab index. |
void |
setText(java.lang.String text)
Sets the button's text. |
void |
setType(java.lang.String type)
Submit, reset or button (defaults to 'button'). |
void |
showMenu()
Show this button's menu (if it has one). |
| Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onHide, onPosition, onShow, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData, unsinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, resolvePotentialElement, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected El buttonEl
protected java.lang.String buttonSelector
protected com.google.gwt.user.client.ui.AbstractImagePrototype icon
protected Menu menu
protected Style.ButtonScale scale
protected Template template
protected java.lang.String html
| Constructor Detail |
|---|
public Button()
public Button(java.lang.String html)
html - the button text as HTML
public Button(java.lang.String html,
com.google.gwt.user.client.ui.AbstractImagePrototype icon)
html - the button text as HTMLicon - the icon
public Button(java.lang.String html,
com.google.gwt.user.client.ui.AbstractImagePrototype icon,
SelectionListener<ButtonEvent> listener)
html - the button text as HTMLicon - the iconlistener - the selection listener
public Button(java.lang.String html,
SelectionListener<ButtonEvent> listener)
html - the button's text as HTMLlistener - the selection listener| Method Detail |
|---|
public void addSelectionListener(SelectionListener<ButtonEvent> listener)
listener - the listener to addpublic Style.ButtonArrowAlign getArrowAlign()
public com.google.gwt.user.client.ui.AbstractImagePrototype getIcon()
getIcon in interface IconSupportpublic Style.IconAlign getIconAlign()
public Menu getMenu()
public java.lang.String getMenuAlign()
public int getMinWidth()
public boolean getMouseEvents()
public Style.ButtonScale getScale()
public java.lang.String getHtml()
public java.lang.String getType()
public void hideMenu()
public void onComponentEvent(ComponentEvent ce)
ComponentComponent.onBrowserEvent(com.google.gwt.user.client.Event) method
should not be overridden or modified.
onComponentEvent in class Componentce - the base eventpublic void removeSelectionListener(SelectionListener<ButtonEvent> listener)
listener - the listener to be removedpublic void setArrowAlign(Style.ButtonArrowAlign arrowAlign)
arrowAlign - the arrow alignmentpublic void setIcon(com.google.gwt.user.client.ui.AbstractImagePrototype icon)
<code> .my-icon { background: url(images/icons/my-icon.png) no-repeat
center left !important; } </code>
setIcon in interface IconSupporticon - the iconpublic void setIconAlign(Style.IconAlign iconAlign)
iconAlign - the icon alignmentpublic void setIconStyle(java.lang.String icon)
IconSupport
setIconStyle in interface IconSupporticon - a CSS style namepublic void setMenu(Menu menu)
menu - the menupublic void setMenuAlign(java.lang.String menuAlign)
El.alignTo(com.google.gwt.user.client.Element, java.lang.String, int[]) for more
details (defaults to 'tl-bl?', pre-render).
menuAlign - the menu alignmentpublic void setMinWidth(int minWidth)
minWidth - the minimum widthpublic void setMouseEvents(boolean handleMouseEvents)
handleMouseEvents - false to disable mouse over changespublic void setScale(Style.ButtonScale scale)
scale - the scale to setpublic void setTabIndex(int index)
setTabIndex in class Componentindex - the tab indexpublic void setText(java.lang.String text)
text - the new textpublic void setHtml(java.lang.String html)
html - the new html contentpublic void setType(java.lang.String type)
type - the new typepublic void showMenu()
protected void afterRender()
Component
afterRender in class BoxComponentprotected void alignIcon(com.google.gwt.user.client.Element icon)
protected void autoWidth()
protected ComponentEvent createComponentEvent(com.google.gwt.user.client.Event event)
createComponentEvent in class BoxComponentprotected El getFocusEl()
getFocusEl in class Componentprotected java.lang.String getMenuClass()
protected void notifyShow()
notifyShow in class Componentprotected void onBlur(ButtonEvent e)
protected void onClick(ComponentEvent ce)
protected void onDetach()
onDetach in class Componentprotected void onDisable()
onDisable in class Componentprotected void onEnable()
onEnable in class Componentprotected void onFocus(ComponentEvent ce)
protected void onKeyPress(ButtonEvent be)
protected void onMenuHide(ComponentEvent ce)
protected void onMenuShow(ComponentEvent ce)
protected void onMouseDown(ComponentEvent ce)
protected void onMouseOut(ComponentEvent ce)
protected void onMouseOver(ComponentEvent ce)
protected void onMouseUp(ComponentEvent ce)
protected void onRender(com.google.gwt.user.client.Element target,
int index)
Component
onRender in class Componenttarget - the target elementindex - the insert location
protected void onResize(int width,
int height)
BoxComponent
onResize in class BoxComponentwidth - the widthheight - the height
protected void setAriaState(java.lang.String stateName,
java.lang.String stateValue)
setAriaState in class Component
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||