Class AbstractDashboardWidget
- java.lang.Object
-
- com.vaadin.flow.component.Component
-
- com.vaadin.flow.component.orderedlayout.VerticalLayout
-
- org.neotropic.util.visual.widgets.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
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDashboardWidget.ActiveContent
activeContent
The active content to be displayed (cover or content)protected ApplicationEntityManager
aem
Reference to the Application Entity Manager.protected BusinessEntityManager
bem
Reference to the Business Entity Manager.protected com.vaadin.flow.component.Component
contentComponent
The component with the detailed information (actual content)protected com.vaadin.flow.component.html.Div
coverComponent
The component with the cover informationprotected MetadataEntityManager
mem
Reference to the Metadata Entity Manager.protected String
title
Dashboard widget titleprotected TranslationService
ts
Reference to the translation service.
-
Constructor Summary
Constructors Constructor Description AbstractDashboardWidget()
Use this constructor only for those widgets that won't be accessing the database.AbstractDashboardWidget(MetadataEntityManager mem, ApplicationEntityManager aem, BusinessEntityManager bem, TranslationService ts)
-
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut
-
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.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
-
-
-
-
Field Detail
-
activeContent
protected AbstractDashboardWidget.ActiveContent activeContent
The active content to be displayed (cover or content)
-
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
-
mem
protected MetadataEntityManager mem
Reference to the Metadata Entity Manager.
-
aem
protected ApplicationEntityManager aem
Reference to the Application Entity Manager.
-
bem
protected BusinessEntityManager bem
Reference to the Business Entity Manager.
-
ts
protected TranslationService ts
Reference to the translation service.
-
-
Constructor Detail
-
AbstractDashboardWidget
public AbstractDashboardWidget()
Use this constructor only for those widgets that won't be accessing the database.
-
AbstractDashboardWidget
public AbstractDashboardWidget(MetadataEntityManager mem, ApplicationEntityManager aem, BusinessEntityManager bem, TranslationService ts)
-
-
Method Detail
-
getActiveContent
public AbstractDashboardWidget.ActiveContent getActiveContent()
-
setActiveContent
public void setActiveContent(AbstractDashboardWidget.ActiveContent activeContent)
-
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()
-
-