|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponentContainer
com.vaadin.ui.AbstractLayout
com.vaadin.ui.AbstractOrderedLayout
com.vaadin.ui.HorizontalLayout
org.vostok.vaadin.addon.toolbar.Toolbar
public class Toolbar
Toolbar is a widget for rendering an horizontal toolbar, filled with buttons, selectors, etc.
It aims to be simple and versatile. It also provide a set of scss variables.
Toolbar provides two banks, left and right, and can accept any components (*). It's dynamic, you can add, remove, hide components at any time.
It also provides build in for the most common widget such as button, separator, label.
(*) might require some additionnal css.
>Generated html code :
<div class="toolbar layout-panel [YOUR CSS CLASS HERE]"> <div> <div class="v-slot-left-panel"> <div class="left-panel">[LEFT CONTENT HERE]</div> </div> <div class="v-spacing"></div> <div class="v-slot-right-panel"> <div class="right-panel">[RIGHT CONTENT HERE]</div> </div> </div> </div>See sample at http://vaadin.vostoksystem.eu
Nested Class Summary | |
---|---|
static class |
Toolbar.BANK
where to add new component too |
static class |
Toolbar.DISPLAY
layout for button. |
Nested classes/interfaces inherited from interface com.vaadin.ui.Layout |
---|
com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.SpacingHandler |
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents |
---|
com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier, com.vaadin.ui.HasComponents.ComponentAttachEvent, com.vaadin.ui.HasComponents.ComponentAttachListener, com.vaadin.ui.HasComponents.ComponentDetachEvent, com.vaadin.ui.HasComponents.ComponentDetachListener |
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 | |
---|---|
protected com.vaadin.ui.CssLayout |
left
|
static java.lang.String |
LEFTCSS
|
static java.lang.String |
MODEBOTTOM
|
static java.lang.String |
MODECAPTION
|
static java.lang.String |
MODEICON
|
static java.lang.String |
MODERIGHT
|
protected com.vaadin.ui.CssLayout |
right
|
static java.lang.String |
RIGHTCSS
|
static java.lang.String |
SEPARATORCSS
|
static java.lang.String |
TOOLBARCSS
|
Fields inherited from class com.vaadin.ui.AbstractOrderedLayout |
---|
ALIGNMENT_DEFAULT, components |
Fields inherited from class com.vaadin.ui.AbstractComponent |
---|
DESIGN_ATTR_PLAIN_TEXT |
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 | |
---|---|
Toolbar()
create a new toolbar, with button default to icon only |
|
Toolbar(Toolbar.DISPLAY mode)
create a new toolbar |
Method Summary | |
---|---|
com.vaadin.ui.Button |
addButton(java.lang.String caption,
java.lang.String description,
java.lang.Object style)
add a new button to the left toolbar's panel. |
com.vaadin.ui.Button |
addButton(java.lang.String caption,
java.lang.String description,
java.lang.Object style,
com.vaadin.ui.Button.ClickListener listener)
add a new button to the left toolbar's panel. |
com.vaadin.ui.Button |
addButton(java.lang.String caption,
java.lang.String description,
java.lang.Object style,
com.vaadin.ui.Button.ClickListener listener,
Toolbar.BANK location)
Build and add a new button. |
com.vaadin.ui.Button |
addButton(java.lang.String caption,
java.lang.String description,
java.lang.Object style,
Toolbar.BANK location)
add a new button |
void |
addComponent(com.vaadin.ui.Component component)
add a component to the left toolbar's panel |
com.vaadin.ui.Component |
addComponent(com.vaadin.ui.Component component,
Toolbar.BANK location)
Add a new component to the toolbar. |
com.vaadin.ui.Label |
addLabel(java.lang.String caption)
add a new label to the left toolbar's panel |
com.vaadin.ui.Label |
addLabel(java.lang.String caption,
java.lang.String style)
add a new label to the left toolbar's panel |
com.vaadin.ui.Label |
addLabel(java.lang.String caption,
java.lang.String style,
Toolbar.BANK location)
add a new label to the toolbar |
com.vaadin.ui.Component |
addSeparator()
add a new vertical separator to the left panel. |
com.vaadin.ui.Component |
addSeparator(Toolbar.BANK location)
add a new vertical separator. default look and feel depends on css. |
com.vaadin.ui.Component |
getComponent(int index,
Toolbar.BANK location)
return component at index index from bank location if comonent can be found, return null |
Toolbar.DISPLAY |
getMode()
current button display |
void |
removeComponent(int index,
Toolbar.BANK location)
remove component at index index from bank location if component does't exist, does nothing. |
void |
setEnable(int index,
Toolbar.BANK location,
boolean enable)
a convenience method to call Component.setEnable for component at index index from bank location if component does't exist, does nothing. |
void |
setMode(Toolbar.DISPLAY mode)
set a new mode for display. |
static void |
setSeparatorResource(com.vaadin.server.Resource resource)
Default rules for separator is to create a Label with css Toolbar.SEPARATORCSS ("separator"). |
Methods inherited from class com.vaadin.ui.HorizontalLayout |
---|
getState |
Methods inherited from class com.vaadin.ui.AbstractOrderedLayout |
---|
addComponent, addComponentAsFirst, addLayoutClickListener, addListener, getComponent, getComponentAlignment, getComponentCount, getComponentIndex, getCustomAttributes, getDefaultComponentAlignment, getExpandRatio, getMargin, getState, isSpacing, iterator, readDesign, removeComponent, removeLayoutClickListener, removeListener, replaceComponent, setComponentAlignment, setDefaultComponentAlignment, setExpandRatio, setMargin, setMargin, setSpacing, writeDesign |
Methods inherited from class com.vaadin.ui.AbstractLayout |
---|
readMargin, writeMargin |
Methods inherited from class com.vaadin.ui.AbstractComponentContainer |
---|
addComponentAttachListener, addComponentDetachListener, addComponents, addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, removeListener, removeListener, setHeight, setWidth |
Methods inherited from class com.vaadin.ui.AbstractComponent |
---|
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidthUndefined |
Methods inherited from class com.vaadin.server.AbstractClientConnector |
---|
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.ComponentContainer |
---|
addComponents, addListener, addListener, getComponentIterator, moveComponentsFrom, removeAllComponents, removeListener, removeListener |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined |
Methods inherited from interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier |
---|
addComponentAttachListener, addComponentDetachListener, removeComponentAttachListener, removeComponentDetachListener |
Field Detail |
---|
public static final java.lang.String TOOLBARCSS
public static final java.lang.String SEPARATORCSS
public static final java.lang.String LEFTCSS
public static final java.lang.String RIGHTCSS
public static final java.lang.String MODEICON
public static final java.lang.String MODECAPTION
public static final java.lang.String MODERIGHT
public static final java.lang.String MODEBOTTOM
protected com.vaadin.ui.CssLayout left
protected com.vaadin.ui.CssLayout right
Constructor Detail |
---|
public Toolbar()
public Toolbar(Toolbar.DISPLAY mode)
mode
- mode
for button.Method Detail |
---|
public Toolbar.DISPLAY getMode()
mode
for toolbarToolbar.DISPLAY
public final void setMode(Toolbar.DISPLAY mode)
mode
- new mode
for toolbarToolbar.DISPLAY
public com.vaadin.ui.Component addComponent(com.vaadin.ui.Component component, Toolbar.BANK location)
component
- the component. If null, does nothinglocation
- which panel to add component too
public void addComponent(com.vaadin.ui.Component component)
addComponent
in interface com.vaadin.ui.ComponentContainer
addComponent
in class com.vaadin.ui.AbstractOrderedLayout
component
- the component. If null, does nothing.public com.vaadin.ui.Button addButton(java.lang.String caption, java.lang.String description, java.lang.Object style, com.vaadin.ui.Button.ClickListener listener, Toolbar.BANK location)
caption
- caption for the button, Can be null.description
- description (title) for the button. can be null.style
- if of type String
, css style for the button. If of type Resource
, considered to be a resource icon. If null or invalid type, does nothinglistener
- listener for the button. Can be null.location
- where to add button
com.vaadin.ui.Button
instancepublic com.vaadin.ui.Button addButton(java.lang.String caption, java.lang.String description, java.lang.Object style, com.vaadin.ui.Button.ClickListener listener)
caption
- caption for the button, Can be null.description
- description (title) for the button. can be null.style
- if of type String
, css style for the button. If of type Resource
, considered to be a resource icon. If null or invalid type, does nothinglistener
- listener for the button. Can be null.
com.vaadin.ui.Button
instancepublic com.vaadin.ui.Button addButton(java.lang.String caption, java.lang.String description, java.lang.Object style)
caption
- caption caption for the button, Can be null.description
- description description (title) for the button. can be null.style
- style if of type String
, css style for the button. If of type Resource
, considered to be a resource icon. If null or invalid type, does nothing
com.vaadin.ui.Button
instancepublic com.vaadin.ui.Button addButton(java.lang.String caption, java.lang.String description, java.lang.Object style, Toolbar.BANK location)
caption
- caption caption for the button, Can be null.description
- description description (title) for the button. can be null.style
- style if of type String
, css style for the button. If of type Resource
, considered to be a resource icon. If null or invalid type, does nothinglocation
- where to add button
com.vaadin.ui.Button
instancepublic com.vaadin.ui.Component addSeparator(Toolbar.BANK location)
location
- where to add separator
com.vaadin.ui.Label
instance representing the separatorpublic com.vaadin.ui.Component addSeparator()
com.vaadin.ui.Label
instance representing the separatorpublic com.vaadin.ui.Label addLabel(java.lang.String caption, java.lang.String style, Toolbar.BANK location)
caption
- text for label.style
- user's css for label. Can be null.location
- where to add button
com.vaadin.ui.Label
public com.vaadin.ui.Label addLabel(java.lang.String caption, java.lang.String style)
caption
- text for label.style
- user's css for label. Can be null.
com.vaadin.ui.Label
public com.vaadin.ui.Label addLabel(java.lang.String caption)
caption
- text for label.
com.vaadin.ui.Label
public com.vaadin.ui.Component getComponent(int index, Toolbar.BANK location)
index
from bank location
if comonent can be found, return null
index
- index
for component to look for. 0 based.location
- bank to look component from
com.vaadin.ui.component
, or null
if not foundpublic void removeComponent(int index, Toolbar.BANK location)
index
from bank location
index
- index
for component to look for. 0 based.location
- bank to look component frompublic void setEnable(int index, Toolbar.BANK location, boolean enable)
index
from bank location
index
- index
for component to look for. 0 based.location
- bank to look component fromenable
- actionComponent
public static void setSeparatorResource(com.vaadin.server.Resource resource)
resource
- com.vaadin.server.Resource
for the new separator image, or null
to reset to default (css)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |