Package org.opencms.ui.components
Class CmsToolBar
java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponentContainer
com.vaadin.ui.AbstractLayout
com.vaadin.ui.CssLayout
org.opencms.ui.components.CmsToolBar
- All Implemented Interfaces:
com.vaadin.event.ContextClickEvent.ContextClickNotifier,com.vaadin.event.LayoutEvents.LayoutClickNotifier,com.vaadin.event.MethodEventSource,com.vaadin.event.SerializableEventListener,com.vaadin.server.ClientConnector,com.vaadin.server.Page.BrowserWindowResizeListener,com.vaadin.server.Sizeable,com.vaadin.shared.Connector,com.vaadin.ui.Component,com.vaadin.ui.ComponentContainer,com.vaadin.ui.HasComponents,com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier,com.vaadin.ui.Layout,Serializable,Iterable<com.vaadin.ui.Component>,EventListener
public class CmsToolBar
extends com.vaadin.ui.CssLayout
implements com.vaadin.server.Page.BrowserWindowResizeListener
The workplace toolbar.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classToolbar dialog context.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.DetachListenerNested 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.ListenerNested 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.ComponentDetachListenerNested classes/interfaces inherited from interface com.vaadin.ui.Layout
com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.SpacingHandlerNested classes/interfaces inherited from interface com.vaadin.server.Sizeable
com.vaadin.server.Sizeable.Unit -
Field Summary
FieldsFields inherited from class com.vaadin.ui.CssLayout
componentsFields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXTFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddButtonLeft(com.vaadin.ui.Component button) Adds a button to left toolbar side.voidaddButtonRight(com.vaadin.ui.Component button) Adds a button to right toolbar side.voidbrowserWindowResized(com.vaadin.server.Page.BrowserWindowResizeEvent event) voidClears the left toolbar buttons.voidClears the right toolbar buttons.voidCloses all visible popup views.static com.vaadin.ui.ButtoncreateButton(com.vaadin.server.Resource icon, String title) Creates a properly styled toolbar button.static com.vaadin.ui.ButtoncreateButton(com.vaadin.server.Resource icon, String title, boolean alwaysShow) Creates a properly styled toolbar button.static com.vaadin.ui.ComponentcreateDropDown(com.vaadin.server.ExternalResource icon, com.vaadin.ui.Component content, String title) Creates a drop down menu.static com.vaadin.ui.ComponentcreateDropDown(com.vaadin.server.FontIcon icon, com.vaadin.ui.Component content, String title) Creates a drop down menu.static com.vaadin.ui.ComponentcreateDropDown(String buttonHtml, com.vaadin.ui.Component content, String title) Creates a drop down menu.voidenableDefaultButtons(boolean enabled) Enables or removes the default toolbar buttons.protected voidinit(String appId, I_CmsAppUIContext context) Initializes the toolbar.static voidopenFavoriteDialog(CmsFileExplorer explorer) Opens the favorite dialog.voidRefreshes the user drop down.voidremoveButton(com.vaadin.ui.Component button) Removes the given button from the toolbar.voidsetAppContext(I_CmsAppUIContext context) Sets the app context.voidsetAppTitle(String appTitle) Sets the app title.protected voidsetDialogContext(I_CmsDialogContext context) Sets the dialog context.voidUpdates the app indicator site and project info.protected voidupdateButtonVisibility(int width) Updates the button visibility according o the given widow width.protected voidRecalculates the space required by the toolbar buttons.Methods inherited from class com.vaadin.ui.CssLayout
addComponent, addComponent, addComponentAsFirst, addLayoutClickListener, beforeClientResponse, getComponent, getComponentCount, getComponentIndex, getCss, getState, getState, iterator, readDesign, removeComponent, removeLayoutClickListener, replaceComponent, writeDesignMethods inherited from class com.vaadin.ui.AbstractLayout
readMargin, writeMarginMethods inherited from class com.vaadin.ui.AbstractComponentContainer
addComponentAttachListener, addComponentDetachListener, addComponents, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, setHeight, setWidthMethods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidthFull, setWidthUndefinedMethods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, 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, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlerMethods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisibleMethods inherited from interface com.vaadin.ui.ComponentContainer
addComponents, getComponentIterator, moveComponentsFrom, removeAllComponentsMethods inherited from interface com.vaadin.shared.Connector
getConnectorIdMethods inherited from interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
addComponentAttachListener, addComponentDetachListener, removeComponentAttachListener, removeComponentDetachListenerMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Field Details
-
m_appContext
The app UI context.
-
-
Constructor Details
-
CmsToolBar
public CmsToolBar()Constructor.
-
-
Method Details
-
createButton
Creates a properly styled toolbar button.- Parameters:
icon- the button icontitle- the button title, will be used for the tooltip- Returns:
- the button
-
createButton
public static com.vaadin.ui.Button createButton(com.vaadin.server.Resource icon, String title, boolean alwaysShow) Creates a properly styled toolbar button.- Parameters:
icon- the button icontitle- the button title, will be used for the tooltipalwaysShow-trueto prevent the button to be folded into a sub menu for small screens- Returns:
- the button
-
createDropDown
public static com.vaadin.ui.Component createDropDown(com.vaadin.server.ExternalResource icon, com.vaadin.ui.Component content, String title) Creates a drop down menu.- Parameters:
icon- the button iconcontent- the drop down contenttitle- the button title- Returns:
- the component
-
createDropDown
public static com.vaadin.ui.Component createDropDown(com.vaadin.server.FontIcon icon, com.vaadin.ui.Component content, String title) Creates a drop down menu.- Parameters:
icon- the button iconcontent- the drop down contenttitle- the drop down title- Returns:
- the component
-
createDropDown
public static com.vaadin.ui.Component createDropDown(String buttonHtml, com.vaadin.ui.Component content, String title) Creates a drop down menu.- Parameters:
buttonHtml- the button HTMLcontent- the drop down contenttitle- the button title- Returns:
- the component
-
openFavoriteDialog
Opens the favorite dialog.- Parameters:
explorer- the explorer instance (null if not currently in explorer)
-
addButtonLeft
Adds a button to left toolbar side.- Parameters:
button- the button
-
addButtonRight
Adds a button to right toolbar side.- Parameters:
button- the button
-
browserWindowResized
- Specified by:
browserWindowResizedin interfacecom.vaadin.server.Page.BrowserWindowResizeListener- See Also:
-
clearButtonsLeft
Clears the left toolbar buttons. -
clearButtonsRight
Clears the right toolbar buttons. -
closePopupViews
Closes all visible popup views. -
enableDefaultButtons
Enables or removes the default toolbar buttons.These are the context menu and the quick launch drop down.
The default is
enabled = true.- Parameters:
enabled-trueto enable the buttons
-
refreshUserInfoDropDown
Refreshes the user drop down. -
removeButton
Removes the given button from the toolbar.- Parameters:
button- the button to remove
-
setAppContext
Sets the app context.- Parameters:
context- the app context
-
setAppTitle
Sets the app title.- Parameters:
appTitle- the app title
-
updateAppIndicator
Updates the app indicator site and project info. -
init
Initializes the toolbar.- Parameters:
appId- the app idcontext- the app UI context
-
setDialogContext
Sets the dialog context.- Parameters:
context- the dialog context
-
updateButtonVisibility
Updates the button visibility according o the given widow width.- Parameters:
width- the window width
-
updateFoldingThreshhold
Recalculates the space required by the toolbar buttons.
-