Class Dashboard
- All Implemented Interfaces:
AttachNotifier,HasWidgets,DetachNotifier,HasElement,HasSize,HasStyle,HasTheme,HasThemeVariant<DashboardVariant>,Serializable
Internationalization (i18n) is supported through Dashboard.DashboardI18n,
allowing customization of accessible names for the dashboard controls. The
i18n object can be set using setI18n(DashboardI18n).
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Collection<DashboardWidget> widgets) Adds the given widgets to this component.Adds an item moved listener to this dashboard.Adds an item move mode change listener to this dashboard.Adds an item removed listener to this dashboard.Adds an item resized listener to this dashboard.addItemResizeModeChangedListener(ComponentEventListener<DashboardItemResizeModeChangedEvent> listener) Adds an item resize mode change listener to this dashboard.Adds an item selected change listener to this dashboard.Adds an empty section to this dashboard.voidaddSection(DashboardSection section) Adds the given section to this dashboard.addSection(String title) Adds an empty section to this dashboard.voidaddWidgetAtIndex(int index, DashboardWidget widget) Adds the given widget as child of this dashboard at the specific index.Gets the child components of this component.getGap()Returns the gap of the dashboard.getI18n()Gets the internationalization object previously set for this component.Returns the maximum column count of the dashboard.Returns the maximum column width of the dashboard.Returns the minimum column width of the dashboard.Returns the minimum row height of the dashboard.Returns the padding of the dashboard.Returns a flattened list of all the widgets in this dashboard.booleanReturns whether the dashboard layout is dense.booleanReturns whether the dashboard is editable.booleanGets the component visibility value.protected voidonAttach(AttachEvent attachEvent) Called when the component is attached to a UI.voidremove(DashboardSection section) Removes the given section from this component.voidremove(Collection<DashboardWidget> widgets) Removes the given widgets from this component.voidRemoves all widgets and sections from this component.voidsetDenseLayout(boolean dense) Sets the dashboard layout dense.voidsetEditable(boolean editable) Sets the dashboard editable.voidSets the gap of the dashboard.voidSets the internationalization object for this component.voidsetMaximumColumnCount(Integer maxColCount) Sets the maximum column count of the dashboard.voidsetMaximumColumnWidth(String maxColWidth) Sets the maximum column width of the dashboard.voidsetMinimumColumnWidth(String minColWidth) Sets the minimum column width of the dashboard.voidsetMinimumRowHeight(String minRowHeight) Sets the minimum row height of the dashboard.voidsetPadding(String padding) Sets the padding of the dashboard.voidsetRootHeadingLevel(Integer rootHeadingLevel) Sets the root heading level used by sections and widgets, which controls theiraria-levelattributes on title elements.voidsetVisible(boolean visible) Sets the component visibility value.Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setIdMethods 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.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariantsMethods inherited from interface com.vaadin.flow.component.dashboard.HasWidgets
add, remove
-
Constructor Details
-
Dashboard
public Dashboard()Creates an empty dashboard.
-
-
Method Details
-
addSection
Adds an empty section to this dashboard. -
addSection
Adds an empty section to this dashboard.- Parameters:
title- the title of the section
-
addSection
Adds the given section to this dashboard.- Parameters:
section- the widgets to add, notnull
-
getWidgets
Returns a flattened list of all the widgets in this dashboard. This includes the nested widgets in sections.- Specified by:
getWidgetsin interfaceHasWidgets- Returns:
- The flattened list of all widgets in this dashboard
-
add
Description copied from interface:HasWidgetsAdds the given widgets to this component.- Specified by:
addin interfaceHasWidgets- Parameters:
widgets- the widgets to add, notnull
-
addWidgetAtIndex
Adds the given widget as child of this dashboard at the specific index.The index specifies the intended position within the root item list returned by
getChildren(). It should not be used withgetWidgets()since the position in the flattened widget list returned bygetWidgets()might not match the intended position.In case the specified widget has already been added to another parent, it will be removed from there and added to this one.
- Specified by:
addWidgetAtIndexin interfaceHasWidgets- Parameters:
index- the index, where the widget will be added. The index must be non-negative and may not exceed the children countwidget- the widget to add, notnull- See Also:
-
remove
Description copied from interface:HasWidgetsRemoves the given widgets from this component.- Specified by:
removein interfaceHasWidgets- Parameters:
widgets- the widgets to remove, notnull
-
remove
Removes the given section from this component.- Parameters:
section- the section to remove, notnull- Throws:
IllegalArgumentException- if the nonnullparent of the section is not this component
-
removeAll
public void removeAll()Removes all widgets and sections from this component.- Specified by:
removeAllin interfaceHasWidgets
-
getMaximumColumnCount
Returns the maximum column count of the dashboard.- Returns:
- the maximum column count of the dashboard
-
setMaximumColumnCount
Sets the maximum column count of the dashboard.- Parameters:
maxColCount- the new maximum column count. Pass innullto set the maximum column count back to the default value.
-
getMinimumColumnWidth
Returns the minimum column width of the dashboard.- Returns:
- the minimum column width of the dashboard
-
setMinimumColumnWidth
Sets the minimum column width of the dashboard.- Parameters:
minColWidth- the new minimum column width. Pass innullto set the minimum column width back to the default value.
-
getMaximumColumnWidth
Returns the maximum column width of the dashboard.- Returns:
- the maximum column width of the dashboard
-
setMaximumColumnWidth
Sets the maximum column width of the dashboard.- Parameters:
maxColWidth- the new maximum column width. Pass innullto set the maximum column width back to the default value.
-
getMinimumRowHeight
Returns the minimum row height of the dashboard.- Returns:
- the minimum row height of the dashboard
-
setMinimumRowHeight
Sets the minimum row height of the dashboard.- Parameters:
minRowHeight- the new minimum row height. Pass innullto set the minimum row height back to the default value.
-
getGap
Returns the gap of the dashboard. This value adjusts the gap between elements within the dashboard.- Returns:
- the gap of the dashboard
-
setGap
Sets the gap of the dashboard. This value adjusts the gap between elements within the dashboard.- Parameters:
gap- the new gap. Pass innullto set the gap back to the default value.
-
getPadding
Returns the padding of the dashboard. This value adjusts the space around the outer edges of the dashboard.- Returns:
- the padding of the dashboard
-
setPadding
Sets the padding of the dashboard. This value adjusts the space around the outer edges of the dashboard.- Parameters:
padding- the new padding. Pass innullto set the padding back to the default value.
-
setEditable
public void setEditable(boolean editable) Sets the dashboard editable.- Parameters:
editable- whether to set the dashboard editable
-
isEditable
public boolean isEditable()Returns whether the dashboard is editable.- Returns:
- whether the dashboard is editable
-
setDenseLayout
public void setDenseLayout(boolean dense) Sets the dashboard layout dense.- Parameters:
dense- whether to set the dashboard layout dense
-
isDenseLayout
public boolean isDenseLayout()Returns whether the dashboard layout is dense.- Returns:
- whether the dashboard layout is dense
-
addItemMovedListener
Adds an item moved listener to this dashboard.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addItemResizedListener
public Registration addItemResizedListener(ComponentEventListener<DashboardItemResizedEvent> listener) Adds an item resized listener to this dashboard.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addItemRemovedListener
public Registration addItemRemovedListener(ComponentEventListener<DashboardItemRemovedEvent> listener) Adds an item removed listener to this dashboard.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addItemSelectedChangedListener
public Registration addItemSelectedChangedListener(ComponentEventListener<DashboardItemSelectedChangedEvent> listener) Adds an item selected change listener to this dashboard.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addItemMoveModeChangedListener
public Registration addItemMoveModeChangedListener(ComponentEventListener<DashboardItemMoveModeChangedEvent> listener) Adds an item move mode change listener to this dashboard.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
addItemResizeModeChangedListener
public Registration addItemResizeModeChangedListener(ComponentEventListener<DashboardItemResizeModeChangedEvent> listener) Adds an item resize mode change listener to this dashboard.- Parameters:
listener- the listener to add, notnull- Returns:
- a handle that can be used for removing the listener
-
getI18n
Gets the internationalization object previously set for this component.NOTE: Updating the instance that is returned from this method will not update the component if not set again using
setI18n(DashboardI18n)- Returns:
- the i18n object or
nullif no i18n object has been set
-
setI18n
Sets the internationalization object for this component.- Parameters:
i18n- the i18n object, notnull
-
getChildren
Description copied from class:ComponentGets the child components of this component.The default implementation finds child components by traversing each child
Elementtree.If the component is injected to a PolymerTemplate using the
@Idannotation the getChildren method will only return children added from the server side and will not return any children declared in the template file.- Overrides:
getChildrenin classComponent- Returns:
- the child components of this component
- See Also:
-
setVisible
public void setVisible(boolean visible) Description copied from class:ComponentSets the component visibility value.When a component is set as invisible, all the updates of the component from the server to the client are blocked until the component is set as visible again.
Invisible components don't receive any updates from the client-side. Unlike the server-side updates, client-side updates, if any, are discarded while the component is invisible, and are not transmitted to the server when the component is made visible.
- Overrides:
setVisiblein classComponent- Parameters:
visible- the component visibility value- Throws:
UnsupportedOperationException- Dashboard does not support setting visibility
-
isVisible
public boolean isVisible()Description copied from class:ComponentGets the component visibility value. -
setRootHeadingLevel
Sets the root heading level used by sections and widgets, which controls theiraria-levelattributes on title elements. The nested widgets will have theiraria-levelone higher than the root heading level.For example, if root heading level is set to
1:- Sections and non-nested widgets will have
aria-level="1" - Nested widgets will have
aria-level="2"
nullresets it to the default value of2.- Parameters:
rootHeadingLevel- the root heading level property,nullto remove
- Sections and non-nested widgets will have
-
onAttach
Description copied from class:ComponentCalled when the component is attached to a UI.This method is invoked before the
AttachEventis fired for the component. Make sure to callsuper.onAttachwhen overriding this method.
-