|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.vaadin.server.AbstractClientConnector com.vaadin.ui.AbstractComponent com.vaadin.addon.touchkit.ui.NavigationButton
public class NavigationButton
The NavigationButton is a Button implementation optimized to be used inside a
NavigationManager
or generally in touch devices.
Clicking button will automatically navigate to the target view, if defined in
this button (via constructor or setTargetView(Component)
). On the
client side, the NavigationManager
will start animation immediately
when clicked, while the client is waiting for a response from the server.
Note that navigation will only work when the button is used inside a
NavigationManager
, otherwise it will work as a regular Button
.
Nested Class Summary | |
---|---|
class |
NavigationButton.NavigationButtonClickEvent
Click event. |
static interface |
NavigationButton.NavigationButtonClickListener
Interface for listening for a NavigationButton.NavigationButtonClickEvent fired by
a Component . |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
com.vaadin.server.Sizeable.Unit |
Field Summary |
---|
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
NavigationButton()
Creates a navigation button without any caption nor target view. |
|
NavigationButton(com.vaadin.ui.Component targetView)
Constructs a button with the specified target view, and sets the caption to equal that of the target view. |
|
NavigationButton(String caption)
Constructs a new NavigationButton with the given caption. |
|
NavigationButton(String caption,
com.vaadin.ui.Component targetView)
Constructs a button with the specified target view, and sets the caption explicitly. |
Method Summary | |
---|---|
void |
addClickListener(NavigationButton.NavigationButtonClickListener listener)
Adds a navigation button click listener. |
void |
attach()
|
void |
beforeClientResponse(boolean initial)
|
void |
click()
Simulates a button click, notifying all server-side listeners. |
void |
detach()
|
protected void |
fireClick()
Fires a click event to all listeners without any event details. |
String |
getCaption()
Gets the caption for this button. |
NavigationManager |
getNavigationManager()
Gets the NavigationManager in which this button is contained. |
NavigationButtonSharedState |
getState()
|
com.vaadin.ui.Component |
getTargetView()
Gets the target view that will be navigated to when the button is pressed. |
String |
getTargetViewCaption()
Returns the caption that is expected to be on the view this button navigates to. |
void |
removeClickListener(NavigationButton.NavigationButtonClickListener listener)
Removes a navigation button click listener. |
void |
setDescription(String description)
Description in NavigationButton is show on the right side of the button. |
void |
setTargetView(com.vaadin.ui.Component targetView)
Sets the view that will be navigated to when the button is pressed. |
void |
setTargetViewCaption(String targetViewCaption)
Sets the caption that is expected to be on the view this button navigates to. |
Methods inherited from class com.vaadin.ui.AbstractComponent |
---|
addListener, addShortcutListener, addStyleName, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setEnabled, setHeight, setHeight, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth |
Methods inherited from class com.vaadin.server.AbstractClientConnector |
---|
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.Component |
---|
getUI |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Constructor Detail |
---|
public NavigationButton(String caption)
caption
- the captionpublic NavigationButton(com.vaadin.ui.Component targetView)
targetView
- the view to navigate to when pressedpublic NavigationButton(String caption, com.vaadin.ui.Component targetView)
caption
- the captiontargetView
- the view to navigate to when pressedpublic NavigationButton()
Method Detail |
---|
public NavigationButtonSharedState getState()
getState
in class com.vaadin.ui.AbstractComponent
public void beforeClientResponse(boolean initial)
beforeClientResponse
in interface com.vaadin.server.ClientConnector
beforeClientResponse
in class com.vaadin.ui.AbstractComponent
public NavigationManager getNavigationManager()
NavigationManager
in which this button is contained.
NavigationManager
or null if not inside onepublic void setTargetView(com.vaadin.ui.Component targetView)
The client side widget communicates directly with a
NavigationManager
to make the actual navigation work.
targetView
- The view to navigate to when pressed.public void attach()
attach
in interface com.vaadin.server.ClientConnector
attach
in interface com.vaadin.ui.Component
attach
in class com.vaadin.ui.AbstractComponent
public void detach()
detach
in interface com.vaadin.server.ClientConnector
detach
in class com.vaadin.ui.AbstractComponent
public String getCaption()
If the caption is explicitly set, it will be used - otherwise the caption is fetched from the target view, if one is set.
getCaption
in interface com.vaadin.ui.Component
getCaption
in class com.vaadin.ui.AbstractComponent
AbstractComponent.getCaption()
public com.vaadin.ui.Component getTargetView()
setTargetView(Component)
public String getTargetViewCaption()
If the caption is not set explicitly with
setTargetViewCaption(String)
, the caption of target view is
used. In case neither explicit target view caption or the target view is
not defined the button caption is used.
public void setTargetViewCaption(String targetViewCaption)
targetViewCaption
- the explicit caption of the target view.public void addClickListener(NavigationButton.NavigationButtonClickListener listener)
listener
- the Listener to add.public void removeClickListener(NavigationButton.NavigationButtonClickListener listener)
listener
- the Listener to remove.public void click()
protected void fireClick()
AbstractClientConnector.fireEvent(java.util.EventObject)
instead
of this method.
public void setDescription(String description)
setDescription
in class com.vaadin.ui.AbstractComponent
StyleNames.NAVIGATION_BUTTON_DESC_PILL
,
AbstractComponent.setDescription(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |