Class 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 class  CmsToolBar.ToolbarContext
      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 
      Modifier and Type Field Description
      protected I_CmsAppUIContext m_appContext
      The app UI context.
      • 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

      Constructors 
      Constructor Description
      CmsToolBar()
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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 clearButtonsLeft()
      Clears the left toolbar buttons.
      void clearButtonsRight()
      Clears the right toolbar buttons.
      void closePopupViews()
      Closes all visible popup views.
      static com.vaadin.ui.Button createButton​(com.vaadin.server.Resource icon, java.lang.String title)
      Creates a properly styled toolbar button.
      static com.vaadin.ui.Button createButton​(com.vaadin.server.Resource icon, java.lang.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, java.lang.String title)
      Creates a drop down menu.
      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.
      static com.vaadin.ui.Component createDropDown​(java.lang.String buttonHtml, com.vaadin.ui.Component content, java.lang.String title)
      Creates a drop down menu.
      void enableDefaultButtons​(boolean enabled)
      Enables or removes the default toolbar buttons.
      protected void init​(java.lang.String appId, I_CmsAppUIContext context)
      Initializes the toolbar.
      static void openFavoriteDialog​(CmsFileExplorer explorer)
      Opens the favorite dialog.
      void refreshUserInfoDropDown()
      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​(java.lang.String appTitle)
      Sets the app title.
      protected void setDialogContext​(I_CmsDialogContext context)
      Sets the dialog context.
      void updateAppIndicator()
      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 updateFoldingThreshhold()
      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
    • Constructor Detail

    • 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 icon
        title - 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 icon
        title - the button title, will be used for the tooltip
        alwaysShow - 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,
                                                             java.lang.String title)
        Creates a drop down menu.

        Parameters:
        icon - the button icon
        content - the drop down content
        title - 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 icon
        content - the drop down content
        title - 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 HTML
        content - the drop down content
        title - 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:
        browserWindowResized in interface com.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 - true to enable the buttons
      • removeButton

        public void removeButton​(com.vaadin.ui.Component button)
        Removes the given button from the toolbar.

        Parameters:
        button - the button to remove
      • 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 id
        context - the app UI 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.