Class AbstractDashboardWidget

  • All Implemented Interfaces:
    com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.ClickNotifier<com.vaadin.flow.component.orderedlayout.VerticalLayout>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasOrderedComponents<com.vaadin.flow.component.orderedlayout.VerticalLayout>, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.orderedlayout.FlexComponent<com.vaadin.flow.component.orderedlayout.VerticalLayout>, com.vaadin.flow.component.orderedlayout.ThemableLayout, Serializable
    Direct Known Subclasses:
    AllBuildingsMapWidget, EmptyWideWidget, NetworkResourcesWidget, ObjectAuditTrailWidget

    public abstract class AbstractDashboardWidget
    extends com.vaadin.flow.component.orderedlayout.VerticalLayout
    A small embeddable component that can be inserted into an AbstractDashboard. A DashboardWidget has two "faces": A cover that shows a summary or simply a title, and content, with the actual information to be shown. This can be seen as a Tile in a MS Windows Metro interface in most of the cases.
    Author:
    Charles Edward Bedon Cortazar <charles.bedon@kuwaiba.org>
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AbstractDashboardWidget.ActiveContent  
      • Nested classes/interfaces inherited from interface com.vaadin.flow.component.orderedlayout.FlexComponent

        com.vaadin.flow.component.orderedlayout.FlexComponent.Alignment, com.vaadin.flow.component.orderedlayout.FlexComponent.JustifyContentMode
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void createContent()  
      void createCover()
      Creates the cover component.
      void flip()
      Flips the current displayed component.
      AbstractDashboardWidget.ActiveContent getActiveContent()  
      com.vaadin.flow.component.Component getContentComponent()  
      com.vaadin.flow.component.html.Div getCoverComponent()  
      String getTitle()  
      com.vaadin.flow.component.dialog.Dialog launchAsNewWindow()
      Displays the contents of the content widget in a separate modal window.
      void setActiveContent​(AbstractDashboardWidget.ActiveContent activeContent)  
      void setContentComponent​(com.vaadin.flow.component.Component contentComponent)  
      void setCoverComponent​(com.vaadin.flow.component.html.Div coverComponent)  
      void setTitle​(String title)  
      • Methods inherited from class com.vaadin.flow.component.orderedlayout.VerticalLayout

        addAndExpand, getAlignItems, getAlignSelf, getDefaultHorizontalComponentAlignment, getHorizontalComponentAlignment, setAlignItems, setAlignSelf, setDefaultHorizontalComponentAlignment, setHorizontalComponentAlignment, setPadding, setSpacing
      • Methods inherited from class com.vaadin.flow.component.Component

        addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
      • Methods inherited from interface com.vaadin.flow.component.AttachNotifier

        addAttachListener
      • Methods inherited from interface com.vaadin.flow.component.ClickNotifier

        addClickListener, addClickShortcut
      • Methods inherited from interface com.vaadin.flow.component.DetachNotifier

        addDetachListener
      • Methods inherited from interface com.vaadin.flow.component.orderedlayout.FlexComponent

        expand, getFlexGrow, getJustifyContentMode, replace, setFlexGrow, setJustifyContentMode
      • Methods inherited from interface com.vaadin.flow.component.HasComponents

        add, add, addComponentAsFirst, addComponentAtIndex, remove, removeAll
      • Methods inherited from interface com.vaadin.flow.component.HasElement

        getElement
      • Methods inherited from interface com.vaadin.flow.component.HasEnabled

        isEnabled, setEnabled
      • Methods inherited from interface com.vaadin.flow.component.HasOrderedComponents

        getChildren, getComponentAt, getComponentCount, indexOf
      • Methods inherited from interface com.vaadin.flow.component.HasSize

        getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFull
      • Methods inherited from interface com.vaadin.flow.component.HasStyle

        addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
      • Methods inherited from interface com.vaadin.flow.component.orderedlayout.ThemableLayout

        getBoxSizing, getThemeList, isMargin, isPadding, isSpacing, setBoxSizing, setMargin
    • Field Detail

      • coverComponent

        protected com.vaadin.flow.component.html.Div coverComponent
        The component with the cover information
      • contentComponent

        protected com.vaadin.flow.component.Component contentComponent
        The component with the detailed information (actual content)
      • title

        protected String title
        Dashboard widget title
    • Method Detail

      • getTitle

        public String getTitle()
      • setTitle

        public void setTitle​(String title)
      • getCoverComponent

        public com.vaadin.flow.component.html.Div getCoverComponent()
      • setCoverComponent

        public void setCoverComponent​(com.vaadin.flow.component.html.Div coverComponent)
      • getContentComponent

        public com.vaadin.flow.component.Component getContentComponent()
      • setContentComponent

        public void setContentComponent​(com.vaadin.flow.component.Component contentComponent)
      • flip

        public void flip()
        Flips the current displayed component. That is, instead of the cover component, the component widget will be displayed
      • launchAsNewWindow

        public com.vaadin.flow.component.dialog.Dialog launchAsNewWindow()
        Displays the contents of the content widget in a separate modal window.
        Returns:
        The dialog.
      • createCover

        public void createCover()
        Creates the cover component. Note that implementors must set the coverComponent attribute and manage the respective events The default implementation creates a colored rectangle displaying the title of the widget without any style. For simple widgets it's recommended to use this implementation (that is, call super.createCover()) and set a style afterwards.
      • createContent

        public abstract void createContent()