Interface HasWidgets
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
Dashboard,DashboardSection
HasWidgets is an interface for components that can contain and manage
multiple
DashboardWidget instances. It defines methods for adding,
removing, and accessing widgets within a component.- Author:
- Vaadin Ltd
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidadd(DashboardWidget... widgets) Adds the given widgets to this component.voidadd(Collection<DashboardWidget> widgets) Adds the given widgets to this component.voidaddWidgetAtIndex(int index, DashboardWidget widget) Adds the given widget as child of this component at the specific index.Returns the widgets in this component.default voidremove(DashboardWidget... widgets) Removes the given widgets from this component.voidremove(Collection<DashboardWidget> widgets) Removes the given widgets from this component.voidRemoves all widgets from this component.
-
Method Details
-
getWidgets
List<DashboardWidget> getWidgets()Returns the widgets in this component.- Returns:
- The widgets in this component
-
add
Adds the given widgets to this component.- Parameters:
widgets- the widgets to add, notnull
-
add
Adds the given widgets to this component.- Parameters:
widgets- the widgets to add, notnull
-
addWidgetAtIndex
Adds the given widget as child of this component at the specific index.In case the specified widget has already been added to another parent, it will be removed from there and added to this one.
- 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
-
remove
Removes the given widgets from this component.- Parameters:
widgets- the widgets to remove, notnull- Throws:
IllegalArgumentException- if there is a widget whose nonnullparent is not this component
-
remove
Removes the given widgets from this component.- Parameters:
widgets- the widgets to remove, notnull- Throws:
IllegalArgumentException- if there is a widget whose nonnullparent is not this component
-
removeAll
void removeAll()Removes all widgets from this component.
-