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,java.io.Serializable,java.lang.Iterable<com.vaadin.ui.Component>,java.util.EventListener
public class CmsToolBar extends com.vaadin.ui.CssLayout implements com.vaadin.server.Page.BrowserWindowResizeListener
The workplace toolbar.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classCmsToolBar.ToolbarContextToolbar 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
-
-
Field Summary
Fields Modifier and Type Field Description protected I_CmsAppUIContextm_appContextThe app UI context.
-
Constructor Summary
Constructors Constructor Description CmsToolBar()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddButtonLeft(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)voidclearButtonsLeft()Clears the left toolbar buttons.voidclearButtonsRight()Clears the right toolbar buttons.voidclosePopupViews()Closes all visible popup views.static com.vaadin.ui.ButtoncreateButton(com.vaadin.server.Resource icon, java.lang.String title)Creates a properly styled toolbar button.static com.vaadin.ui.ButtoncreateButton(com.vaadin.server.Resource icon, java.lang.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, java.lang.String title)Creates a drop down menu.static com.vaadin.ui.ComponentcreateDropDown(com.vaadin.server.FontIcon icon, com.vaadin.ui.Component content, java.lang.String title)Creates a drop down menu.static com.vaadin.ui.ComponentcreateDropDown(java.lang.String buttonHtml, com.vaadin.ui.Component content, java.lang.String title)Creates a drop down menu.voidenableDefaultButtons(boolean enabled)Enables or removes the default toolbar buttons.protected voidinit(java.lang.String appId, I_CmsAppUIContext context)Initializes the toolbar.static voidopenFavoriteDialog(CmsFileExplorer explorer)Opens the favorite dialog.voidrefreshUserInfoDropDown()Refreshes 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(java.lang.String appTitle)Sets the app title.protected voidsetDialogContext(I_CmsDialogContext context)Sets the dialog context.voidupdateAppIndicator()Updates the app indicator site and project info.protected voidupdateButtonVisibility(int width)Updates the button visibility according o the given widow width.protected voidupdateFoldingThreshhold()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.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
-
-
-
-
Field Detail
-
m_appContext
protected I_CmsAppUIContext m_appContext
The app UI context.
-
-
Constructor Detail
-
CmsToolBar
public CmsToolBar()
Constructor.
-
-
Method Detail
-
createButton
public static com.vaadin.ui.Button createButton(com.vaadin.server.Resource icon, java.lang.String title)
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, java.lang.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, java.lang.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, java.lang.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(java.lang.String buttonHtml, com.vaadin.ui.Component content, java.lang.String title)
Creates a drop down menu.- Parameters:
buttonHtml- the button HTMLcontent- the drop down contenttitle- the button title- Returns:
- the component
-
openFavoriteDialog
public static void openFavoriteDialog(CmsFileExplorer explorer)
Opens the favorite dialog.- Parameters:
explorer- the explorer instance (null if not currently in explorer)
-
addButtonLeft
public void addButtonLeft(com.vaadin.ui.Component button)
Adds a button to left toolbar side.- Parameters:
button- the button
-
addButtonRight
public void addButtonRight(com.vaadin.ui.Component button)
Adds a button to right toolbar side.- Parameters:
button- the button
-
browserWindowResized
public void browserWindowResized(com.vaadin.server.Page.BrowserWindowResizeEvent event)
- Specified by:
browserWindowResizedin interfacecom.vaadin.server.Page.BrowserWindowResizeListener- See Also:
Page.BrowserWindowResizeListener.browserWindowResized(com.vaadin.server.Page.BrowserWindowResizeEvent)
-
clearButtonsLeft
public void clearButtonsLeft()
Clears the left toolbar buttons.
-
clearButtonsRight
public void clearButtonsRight()
Clears the right toolbar buttons.
-
closePopupViews
public void closePopupViews()
Closes all visible popup views.
-
enableDefaultButtons
public void enableDefaultButtons(boolean enabled)
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
public void refreshUserInfoDropDown()
Refreshes the user drop down.
-
removeButton
public void removeButton(com.vaadin.ui.Component button)
Removes the given button from the toolbar.- Parameters:
button- the button to remove
-
setAppContext
public void setAppContext(I_CmsAppUIContext context)
Sets the app context.- Parameters:
context- the app context
-
setAppTitle
public void setAppTitle(java.lang.String appTitle)
Sets the app title.- Parameters:
appTitle- the app title
-
updateAppIndicator
public void updateAppIndicator()
Updates the app indicator site and project info.
-
init
protected void init(java.lang.String appId, I_CmsAppUIContext context)
Initializes the toolbar.- Parameters:
appId- the app idcontext- the app UI context
-
setDialogContext
protected void setDialogContext(I_CmsDialogContext context)
Sets the dialog context.- Parameters:
context- the dialog context
-
updateButtonVisibility
protected void updateButtonVisibility(int width)
Updates the button visibility according o the given widow width.- Parameters:
width- the window width
-
updateFoldingThreshhold
protected void updateFoldingThreshhold()
Recalculates the space required by the toolbar buttons.
-
-