Package com.storedobject.vaadin
Class Dashboard
java.lang.Object
com.vaadin.flow.component.Component
com.storedobject.vaadin.CSSGrid
com.storedobject.vaadin.Dashboard
- All Implemented Interfaces:
ClickHandler,ExecutableView,HasSize,HasStyle,ValueChangeHandler,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<? extends com.vaadin.flow.component.Component>>,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.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasValue.ValueChangeListener,Serializable,Runnable,EventListener
Dashboard is a "view" that can show multiple embedded "sub-views". Dashboard divides the display area into rows and columns, and each
"sub-view" can span across one or more rows and columns.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.storedobject.vaadin.CSSGrid
CSSGrid.PositionNested classes/interfaces inherited from interface com.storedobject.vaadin.ClickHandler
ClickHandler.ModifiedClickEvent<C extends com.vaadin.flow.component.Component> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Closes the view by aborting if that existsvoidAdd sub-views to the dashboard.voidadd(com.vaadin.flow.component.Component... components) Add sub-views to the dashboard.voidalign(View view, CSSGrid.Position position) Align (vertically) a view within its grid cell.voidCenter (horizontally and vertically) a view within its grid cell.voidclean()This will be invoked whenever the dashboard is closed or aborted so that any resource cleanup can be run.voidclicked(com.vaadin.flow.component.Component c) Default implementation, does nothing.voidclose()Closes the view if that existsprotected ViewCreate a View to display the grid when executed.Caption used when displaying it in a View.final ViewgetView(boolean create) Create a View to display the grid when executed.booleanCheck the current value of an auto-arrange flag.voidjustify(View view, CSSGrid.Position position) Horizontally justify a view within its grid cell.voidRemove sub-views from the dashboard.voidsetAutoarrange(boolean autoarrange) Set the auto-arrange flag.voidsetCaption(String caption) Set the caption used when displaying the grid in a View.voidsetColumnSpan(View view, int numberOfColumns) Set the column-span for the particular sub-view.voidsetColumnSpan(com.vaadin.flow.component.Component component, int numberOfColumns) Set the column-span for the particular sub-view.voidsetMinimumColumnWidth(String width) Set the minimum width for the column.voidsetRowSpan(View view, int numberOfRows) Set the row-span for the particular sub-view.Methods inherited from class com.storedobject.vaadin.CSSGrid
align, center, getColumnSpan, getRowSpan, justify, setColumnGap, setColumnGap, setGap, setGap, setRowGap, setRowGap, setRowSpan, styleMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClickedMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.storedobject.vaadin.ExecutableView
clearAlerts, createMenuItem, error, execute, execute, getApplication, getMenuIconName, getMenuItem, getView, invoke, isCloseable, isFullScreen, isHomeView, log, log, message, returnedFrom, run, setClickable, speak, trackValueChange, tray, valueChanged, warningMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasOrderedComponents
getChildren, getComponentAt, getComponentCount, indexOf, replaceMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.storedobject.vaadin.HasStyle
getClassName, getClassNames, getInternalElement, getStyle, setClassNameMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, hasClassName, removeClassName, removeClassNames, setClassNameMethods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Constructor Details
-
Dashboard
public Dashboard()Constructor. Sub-views are shown in a box by default. -
Dashboard
public Dashboard(boolean boxing) Constructor.- Parameters:
boxing- Whether the sub-views should be shown inside a box or not
-
Dashboard
Constructor. Sub-views are shown in a box by default.- Parameters:
caption- Caption
-
Dashboard
Constructor.- Parameters:
caption- Captionboxing- Whether the sub-views should be shown inside a box or not
-
-
Method Details
-
setMinimumColumnWidth
Set the minimum width for the column. The default width is 250 pixels.- Parameters:
width- Width
-
setAutoarrange
public void setAutoarrange(boolean autoarrange) Set the auto-arrange flag. If set, sub-views are arranged automatically to optimize space used. Default value for this istrue.- Parameters:
autoarrange- Whether to auto-arrange sub-views or not
-
isAutoarrange
public boolean isAutoarrange()Check the current value of an auto-arrange flag.- Returns:
- Current auto-arrange flag
- See Also:
-
justify
Horizontally justify a view within its grid cell.- Parameters:
view- Viewposition- Position
-
align
Align (vertically) a view within its grid cell.- Parameters:
view- Viewposition- Position
-
center
Center (horizontally and vertically) a view within its grid cell.- Parameters:
view- View
-
setColumnSpan
public void setColumnSpan(com.vaadin.flow.component.Component component, int numberOfColumns) Set the column-span for the particular sub-view. The minimum value is 1 and the maximum allowed is 6.- Overrides:
setColumnSpanin classCSSGrid- Parameters:
component- Sub-viewnumberOfColumns- Number of columns to span
-
setColumnSpan
Set the column-span for the particular sub-view. The minimum value is 1 and the maximum allowed is 6.- Parameters:
view- Sub-viewnumberOfColumns- Number of columns to span
-
setRowSpan
Set the row-span for the particular sub-view. Minimum value is 1.- Parameters:
view- Sub-viewnumberOfRows- Number of rows to span
-
add
public void add(com.vaadin.flow.component.Component... components) Add sub-views to the dashboard.- Specified by:
addin interfacecom.vaadin.flow.component.HasComponents- Parameters:
components- Sub-views.
-
add
-
remove
Remove sub-views from the dashboard.- Parameters:
views- Sub-views.
-
clicked
public void clicked(com.vaadin.flow.component.Component c) Description copied from interface:ExecutableViewDefault implementation, does nothing.- Specified by:
clickedin interfaceClickHandler- Specified by:
clickedin interfaceExecutableView- Parameters:
c- Component
-
getView
Create a View to display the grid when executed.- Specified by:
getViewin interfaceExecutableView- Parameters:
create- If true is passed, a view will be created if no current view exists- Returns:
- A View with this grid as the component.
-
createView
Create a View to display the grid when executed. If this method returns null, a default View will be created.- Returns:
- A View with this grid as the component.
-
getCaption
Caption used when displaying it in a View. If no caption was set using the setCaption method, "Dashboard" will be returned.- Specified by:
getCaptionin interfaceExecutableView- Returns:
- Caption
-
close
-
abort
public void abort()Closes the view by aborting if that exists- Specified by:
abortin interfaceExecutableView
-
clean
public void clean()This will be invoked whenever the dashboard is closed or aborted so that any resource cleanup can be run.- Specified by:
cleanin interfaceExecutableView
-
setCaption
Set the caption used when displaying the grid in a View.- Specified by:
setCaptionin interfaceExecutableView- Parameters:
caption- Caption
-