public class ButtonCell<C> extends ResizeCell<C> implements BeforeSelectEvent.HasBeforeSelectHandlers, SelectEvent.HasSelectHandlers, ArrowSelectEvent.HasArrowSelectHandlers, HasIcon, FocusableCell, DisableCell
Modifier and Type | Class and Description |
---|---|
static class |
ButtonCell.ButtonArrowAlign
Button arrow alignment enum.
|
static interface |
ButtonCell.ButtonCellAppearance<C> |
static class |
ButtonCell.ButtonScale
ButtonScale enum.
|
static class |
ButtonCell.IconAlign
Icon alignment enum.
|
Modifier and Type | Field and Description |
---|---|
protected ImageResource |
icon |
protected Menu |
menu |
protected SafeHtml |
text |
height, width
Constructor and Description |
---|
ButtonCell() |
ButtonCell(ButtonCell.ButtonCellAppearance<C> appearance) |
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addArrowSelectHandler(ArrowSelectEvent.ArrowSelectHandler handler)
Adds a
ArrowSelectEvent.ArrowSelectHandler handler for ArrowSelectEvent
events. |
HandlerRegistration |
addBeforeSelectHandler(BeforeSelectEvent.BeforeSelectHandler handler)
Adds a
BeforeSelectEvent.BeforeSelectHandler handler for BeforeSelectEvent events. |
HandlerRegistration |
addSelectHandler(SelectEvent.SelectHandler handler)
Adds a
SelectEvent.SelectHandler handler for SelectEvent events. |
void |
disable(com.google.gwt.cell.client.Cell.Context context,
Element parent) |
void |
enable(com.google.gwt.cell.client.Cell.Context context,
Element parent) |
ButtonCell.ButtonCellAppearance<C> |
getAppearance()
Returns the button's appearance.
|
ButtonCell.ButtonArrowAlign |
getArrowAlign()
Returns the button's arrow alignment.
|
XElement |
getFocusElement(XElement parent) |
String |
getHTML() |
ImageResource |
getIcon()
Returns the icon.
|
ButtonCell.IconAlign |
getIconAlign()
Returns the button's icon alignment.
|
Menu |
getMenu()
Returns the button's menu (if it has one).
|
Style.AnchorAlignment |
getMenuAlign()
Returns the button's menu alignment.
|
int |
getMinWidth()
Returns the button's minimum width.
|
boolean |
getMouseEvents()
Returns false if mouse over effect is disabled.
|
ButtonCell.ButtonScale |
getScale()
Returns the button's scale.
|
String |
getText() |
void |
hideMenu()
Hide this button's menu (if it has one).
|
protected void |
onBlur(XElement p,
NativeEvent event) |
void |
onBrowserEvent(Cell.Context context,
Element parent,
C value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onClick(Context context,
XElement p,
C value,
NativeEvent event,
<any> valueUpdater) |
protected void |
onFocus(XElement p,
NativeEvent event) |
protected void |
onMouseDown(XElement parent,
NativeEvent event) |
protected void |
onMouseOut(XElement p,
NativeEvent event) |
protected void |
onMouseOver(XElement p,
NativeEvent event) |
protected void |
onMouseUp(XElement p,
NativeEvent event) |
protected void |
onNavigationKey(com.google.gwt.cell.client.Cell.Context context,
Element parent,
C value,
NativeEvent event,
<any> valueUpdater) |
boolean |
redrawOnResize()
Determines if the cell should be redrawn when resized by @link
CellComponent . |
void |
render(Context context,
C value,
SafeHtmlBuilder sb) |
void |
setArrowAlign(ButtonCell.ButtonArrowAlign arrowAlign)
Sets the arrow alignment (defaults to RIGHT).
|
void |
setHTML(SafeHtml html) |
void |
setIcon(ImageResource icon)
Sets the icon.
|
void |
setIconAlign(ButtonCell.IconAlign iconAlign)
Sets the icon alignment (defaults to LEFT).
|
void |
setMenu(Menu menu)
Sets the button's menu.
|
void |
setMenuAlign(Style.AnchorAlignment menuAlign)
Sets the position to align the menu to, see
XElement.alignTo(Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int, 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(ButtonCell.ButtonScale scale)
Sets the button's scale.
|
void |
setText(String text) |
void |
showMenu(Element target)
Show this button's menu (if it has one).
|
getHeight, getWidth, setHeight, setSize, setSize, setWidth
addHandler, createHandlerManager, fireCancellableEvent, fireCancellableEvent, fireEvent, fireEvent, isDisableEvents, setDisableEvents
protected ImageResource icon
protected Menu menu
protected SafeHtml text
public ButtonCell()
public ButtonCell(ButtonCell.ButtonCellAppearance<C> appearance)
public HandlerRegistration addArrowSelectHandler(ArrowSelectEvent.ArrowSelectHandler handler)
ArrowSelectEvent.HasArrowSelectHandlers
ArrowSelectEvent.ArrowSelectHandler
handler for ArrowSelectEvent
events.addArrowSelectHandler
in interface ArrowSelectEvent.HasArrowSelectHandlers
handler
- the handlerpublic HandlerRegistration addBeforeSelectHandler(BeforeSelectEvent.BeforeSelectHandler handler)
BeforeSelectEvent.HasBeforeSelectHandlers
BeforeSelectEvent.BeforeSelectHandler
handler for BeforeSelectEvent
events.addBeforeSelectHandler
in interface BeforeSelectEvent.HasBeforeSelectHandlers
handler
- the handlerpublic HandlerRegistration addSelectHandler(SelectEvent.SelectHandler handler)
SelectEvent.HasSelectHandlers
SelectEvent.SelectHandler
handler for SelectEvent
events.addSelectHandler
in interface SelectEvent.HasSelectHandlers
handler
- the handlerpublic void disable(com.google.gwt.cell.client.Cell.Context context, Element parent)
disable
in interface DisableCell
public void enable(com.google.gwt.cell.client.Cell.Context context, Element parent)
enable
in interface DisableCell
public ButtonCell.ButtonCellAppearance<C> getAppearance()
public ButtonCell.ButtonArrowAlign getArrowAlign()
public XElement getFocusElement(XElement parent)
getFocusElement
in interface FocusableCell
public String getHTML()
public ImageResource getIcon()
HasIcon
public ButtonCell.IconAlign getIconAlign()
public Menu getMenu()
public Style.AnchorAlignment getMenuAlign()
public int getMinWidth()
public boolean getMouseEvents()
public ButtonCell.ButtonScale getScale()
public String getText()
public void hideMenu()
public void onBrowserEvent(Cell.Context context, Element parent, C value, NativeEvent event, <any> valueUpdater)
public boolean redrawOnResize()
ResizableCell
CellComponent
. If true, CellComponent.redraw()
will be
called.redrawOnResize
in interface ResizableCell
redrawOnResize
in class ResizeCell<C>
public void render(Context context, C value, SafeHtmlBuilder sb)
public void setArrowAlign(ButtonCell.ButtonArrowAlign arrowAlign)
arrowAlign
- the arrow alignmentpublic void setHTML(SafeHtml html)
public void setIcon(ImageResource icon)
HasIcon
public void setIconAlign(ButtonCell.IconAlign iconAlign)
iconAlign
- the icon alignmentpublic void setMenu(Menu menu)
menu
- the menupublic void setMenuAlign(Style.AnchorAlignment menuAlign)
XElement.alignTo(Element, com.sencha.gxt.core.client.Style.AnchorAlignment, int, 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(ButtonCell.ButtonScale scale)
scale
- the button scalepublic void setText(String text)
public void showMenu(Element target)
target
- the element to align toprotected void onBlur(XElement p, NativeEvent event)
protected void onClick(Context context, XElement p, C value, NativeEvent event, <any> valueUpdater)
protected void onFocus(XElement p, NativeEvent event)
protected void onMouseDown(XElement parent, NativeEvent event)
protected void onMouseOut(XElement p, NativeEvent event)
protected void onMouseOver(XElement p, NativeEvent event)
protected void onMouseUp(XElement p, NativeEvent event)
protected void onNavigationKey(com.google.gwt.cell.client.Cell.Context context, Element parent, C value, NativeEvent event, <any> valueUpdater)
Copyright © 2018. All rights reserved.