Package com.google.gwt.cell.client
Class ButtonCellBase.DefaultAppearance<C>
- java.lang.Object
-
- com.google.gwt.cell.client.ButtonCellBase.DefaultAppearance<C>
-
- Type Parameters:
C
- the type that this Cell represents
- All Implemented Interfaces:
ButtonCellBase.Appearance<C>
- Direct Known Subclasses:
TextButtonCell.DefaultAppearance
- Enclosing class:
- ButtonCellBase<C>
public static class ButtonCellBase.DefaultAppearance<C> extends java.lang.Object implements ButtonCellBase.Appearance<C>
The default implementation of theButtonCellBase.Appearance
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ButtonCellBase.DefaultAppearance.Resources
The resources used by this appearance.static interface
ButtonCellBase.DefaultAppearance.Style
The Styles used by this appearance.(package private) static interface
ButtonCellBase.DefaultAppearance.Template
The templates used by this appearance.
-
Constructor Summary
Constructors Constructor Description DefaultAppearance(SafeHtmlRenderer<C> renderer)
Construct a newButtonCellBase.DefaultAppearance
using the default styles.DefaultAppearance(SafeHtmlRenderer<C> renderer, ButtonCellBase.DefaultAppearance.Resources resources)
Construct a newButtonCellBase.DefaultAppearance
using the specified resources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SafeHtmlRenderer<C>
getRenderer()
Return theSafeHtmlRenderer
used by this Appearance to render the contents of the button.void
onPush(Element parent)
Called when the user pushes the button down.void
onUnpush(Element parent)
Called when the user releases the button from being pushed.void
render(ButtonCellBase<C> cell, Cell.Context context, C value, SafeHtmlBuilder sb)
Render the button and its contents.void
setFocus(Element parent, boolean focused)
Explicitly focus/unfocus this cell.
-
-
-
Constructor Detail
-
DefaultAppearance
public DefaultAppearance(SafeHtmlRenderer<C> renderer)
Construct a newButtonCellBase.DefaultAppearance
using the default styles.- Parameters:
renderer
- theSafeHtmlRenderer
used to render the contents
-
DefaultAppearance
public DefaultAppearance(SafeHtmlRenderer<C> renderer, ButtonCellBase.DefaultAppearance.Resources resources)
Construct a newButtonCellBase.DefaultAppearance
using the specified resources.- Parameters:
renderer
- theSafeHtmlRenderer
used to render the contentsresources
- the resources and styles to apply to the button
-
-
Method Detail
-
getRenderer
public SafeHtmlRenderer<C> getRenderer()
Return theSafeHtmlRenderer
used by this Appearance to render the contents of the button.- Returns:
- a
SafeHtmlRenderer
instance
-
onPush
public void onPush(Element parent)
Description copied from interface:ButtonCellBase.Appearance
Called when the user pushes the button down.- Specified by:
onPush
in interfaceButtonCellBase.Appearance<C>
- Parameters:
parent
- the parent Element
-
onUnpush
public void onUnpush(Element parent)
Description copied from interface:ButtonCellBase.Appearance
Called when the user releases the button from being pushed.- Specified by:
onUnpush
in interfaceButtonCellBase.Appearance<C>
- Parameters:
parent
- the parent Element
-
render
public void render(ButtonCellBase<C> cell, Cell.Context context, C value, SafeHtmlBuilder sb)
Description copied from interface:ButtonCellBase.Appearance
Render the button and its contents.- Specified by:
render
in interfaceButtonCellBase.Appearance<C>
- Parameters:
cell
- the cell that is being renderedcontext
- theCell.Context
of the cellvalue
- the value that generated the contentsb
- theSafeHtmlBuilder
to render into
-
setFocus
public void setFocus(Element parent, boolean focused)
Description copied from interface:ButtonCellBase.Appearance
Explicitly focus/unfocus this cell.- Specified by:
setFocus
in interfaceButtonCellBase.Appearance<C>
- Parameters:
parent
- the parent elementfocused
- whether this cell should take focus or release it
-
-