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
Modifier and TypeClassDescriptionprotected class
Toolbar 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.DetachListener
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.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.Layout
com.vaadin.ui.Layout.AlignmentHandler, com.vaadin.ui.Layout.MarginHandler, com.vaadin.ui.Layout.SpacingHandler
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
com.vaadin.server.Sizeable.Unit
-
Field Summary
Fields inherited from class com.vaadin.ui.CssLayout
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addButtonLeft
(com.vaadin.ui.Component button) Adds a button to left toolbar side.void
addButtonRight
(com.vaadin.ui.Component button) Adds a button to right toolbar side.void
browserWindowResized
(com.vaadin.server.Page.BrowserWindowResizeEvent event) void
Clears the left toolbar buttons.void
Clears the right toolbar buttons.void
Closes all visible popup views.static com.vaadin.ui.Button
createButton
(com.vaadin.server.Resource icon, String title) Creates a properly styled toolbar button.static com.vaadin.ui.Button
createButton
(com.vaadin.server.Resource icon, String title, boolean alwaysShow) Creates a properly styled toolbar button.static com.vaadin.ui.Component
createDropDown
(com.vaadin.server.ExternalResource icon, com.vaadin.ui.Component content, String title) Creates a drop down menu.static com.vaadin.ui.Component
createDropDown
(com.vaadin.server.FontIcon icon, com.vaadin.ui.Component content, String title) Creates a drop down menu.static com.vaadin.ui.Component
createDropDown
(String buttonHtml, com.vaadin.ui.Component content, String title) Creates a drop down menu.void
enableDefaultButtons
(boolean enabled) Enables or removes the default toolbar buttons.protected void
init
(String appId, I_CmsAppUIContext context) Initializes the toolbar.static void
openFavoriteDialog
(CmsFileExplorer explorer) Opens the favorite dialog.void
Refreshes the user drop down.void
removeButton
(com.vaadin.ui.Component button) Removes the given button from the toolbar.void
setAppContext
(I_CmsAppUIContext context) Sets the app context.void
setAppTitle
(String appTitle) Sets the app title.protected void
setDialogContext
(I_CmsDialogContext context) Sets the dialog context.void
Updates the app indicator site and project info.protected void
updateButtonVisibility
(int width) Updates the button visibility according o the given widow width.protected void
Recalculates 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, writeDesign
Methods inherited from class com.vaadin.ui.AbstractLayout
readMargin, writeMargin
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addComponentAttachListener, addComponentDetachListener, addComponents, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, setHeight, setWidth
Methods 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, setWidthUndefined
Methods 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, updateDiffstate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods 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, setErrorHandler
Methods 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, setVisible
Methods inherited from interface com.vaadin.ui.ComponentContainer
addComponents, getComponentIterator, moveComponentsFrom, removeAllComponents
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
Methods inherited from interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
addComponentAttachListener, addComponentDetachListener, removeComponentAttachListener, removeComponentDetachListener
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods 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
-true
to 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:
browserWindowResized
in interfacecom.vaadin.server.Page.BrowserWindowResizeListener
- See Also:
-
Page.BrowserWindowResizeListener.browserWindowResized(com.vaadin.server.Page.BrowserWindowResizeEvent)
-
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
-true
to 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.
-