Package com.vaadin.featurepack.desktop
Class Window
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.dialog.Dialog
com.vaadin.featurepack.desktop.Window
- All Implemented Interfaces:
HasLayout,HasLocation,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasAriaDescription,com.vaadin.flow.component.HasAriaRole,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,com.vaadin.flow.component.shared.HasThemeVariant<com.vaadin.flow.component.dialog.DialogVariant>,Serializable
public class Window
extends com.vaadin.flow.component.dialog.Dialog
implements HasLayout, HasLocation
Window is a component that mimics the behavior of an operating system
window. It provides space for content and a menu bar (optional).
By default, windows can be resized, moved, and have buttons to minimize, maximize and close.
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.dialog.Dialog
com.vaadin.flow.component.dialog.Dialog.ClosedEvent, com.vaadin.flow.component.dialog.Dialog.DialogCloseActionEvent, com.vaadin.flow.component.dialog.Dialog.DialogDraggedEvent, com.vaadin.flow.component.dialog.Dialog.DialogFooter, com.vaadin.flow.component.dialog.Dialog.DialogHeader, com.vaadin.flow.component.dialog.Dialog.DialogResizeEvent, com.vaadin.flow.component.dialog.Dialog.OpenedChangeEvent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(com.vaadin.flow.component.Component... components) com.vaadin.flow.component.ComponentGets the content container for this window.Gets the layout for the content container of this window.Gets the location for the window.com.vaadin.flow.component.ComponentGets the menu bar for this window.Gets the root container for this window.booleanGets whether the window can be closed.booleanGets whether the window can be maximized.booleanGets whether the window can be minimized.booleanReturns whether the window is opened or not.voidremove(com.vaadin.flow.component.Component... components) voidvoidsetClosable(boolean closable) Sets whether the window can be closed.voidsetContentContainer(com.vaadin.flow.component.Component contentContainer) Sets the content container for this window.voidsetLayout(AbstractLayout layout) Sets the layout for the content container of this window.voidsetLocation(Point location) Sets the location for the window.voidsetMaximizable(boolean maximizable) Sets whether the window can be maximized.voidsetMenuBar(com.vaadin.flow.component.Component menuBar) Sets the menu bar for this window.voidsetMinimizable(boolean minimizable) Sets whether the window can be minimized.voidsetRootContainer(RootContainer rootContainer) Sets the root container for this window.voidsetVisible(boolean visible) Opens or closes the window depending on the flag.Methods inherited from class com.vaadin.flow.component.dialog.Dialog
addAttachListener, addClosedListener, addComponentAtIndex, addDetachListener, addDialogCloseActionListener, addDraggedListener, addOpenedChangeListener, addResizeListener, bindChildren, bindHeight, bindVisible, bindWidth, close, getAriaLabel, getChildren, getFooter, getHeader, getHeaderTitle, getHeadingLevel, getHeight, getLeft, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getModality, getOverlayRole, getRole, getStyle, getTop, getWidth, isAutofocus, isCloseOnEsc, isCloseOnOutsideClick, isDraggable, isFocusTrap, isKeepInViewport, isModal, isOpened, isResizable, onAttach, open, setAriaLabel, setAutofocus, setCloseOnEsc, setCloseOnOutsideClick, setDraggable, setFocusTrap, setHeaderTitle, setHeadingLevel, setHeight, setKeepInViewport, setLeft, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setModal, setModality, setOpened, setOverlayRole, setResizable, setRole, setTop, setWidthMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, getUIOrThrow, hasListener, isAttached, isTemplateMapped, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.HasAriaDescription
getAriaDescribedBy, setAriaDescribedBy, setAriaDescribedByMethods inherited from interface com.vaadin.flow.component.HasAriaRole
getAriaRole, setAriaRoleMethods inherited from interface com.vaadin.flow.component.HasComponents
addMethods inherited from interface com.vaadin.flow.component.HasComponentsOfType
add, addComponentAsFirst, getComponentAt, getComponentCount, indexOf, remove, replaceMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
getHeightUnit, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, bindThemeName, bindThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, bindThemeVariant, bindThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariants
-
Constructor Details
-
Window
public Window()Creates a new window. -
Window
Creates a new window with the given title.- Parameters:
title- the title for the window
-
-
Method Details
-
setRootContainer
Sets the root container for this window.- Parameters:
rootContainer- the root container, notnull
-
getRootContainer
Gets the root container for this window.- Returns:
- the root container, not
null
-
setMenuBar
public void setMenuBar(com.vaadin.flow.component.Component menuBar) Sets the menu bar for this window.- Parameters:
menuBar- the menu bar, ornullto unset the previous menu bar
-
getMenuBar
public com.vaadin.flow.component.Component getMenuBar()Gets the menu bar for this window.- Returns:
- the menu bar, or
nullif no menu bar is set
-
setContentContainer
public void setContentContainer(com.vaadin.flow.component.Component contentContainer) Sets the content container for this window.- Parameters:
contentContainer- the content container, notnull
-
getContentContainer
public com.vaadin.flow.component.Component getContentContainer()Gets the content container for this window.- Returns:
- the content container, not
null
-
setLayout
Sets the layout for the content container of this window. -
getLayout
Gets the layout for the content container of this window. -
setVisible
public void setVisible(boolean visible) Opens or closes the window depending on the flag.- Overrides:
setVisiblein classcom.vaadin.flow.component.dialog.Dialog- Parameters:
visible- whether the window should be opened or closed
-
isVisible
public boolean isVisible()Returns whether the window is opened or not.- Overrides:
isVisiblein classcom.vaadin.flow.component.Component- Returns:
trueif the window is opened,falseotherwise.
-
add
public void add(com.vaadin.flow.component.Component... components) - Specified by:
addin interfacecom.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>
-
remove
public void remove(com.vaadin.flow.component.Component... components) - Specified by:
removein interfacecom.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>
-
removeAll
public void removeAll()- Specified by:
removeAllin interfacecom.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>- Overrides:
removeAllin classcom.vaadin.flow.component.dialog.Dialog
-
isClosable
public boolean isClosable()Gets whether the window can be closed.- Returns:
trueif the window can be closed,falseotherwise.
-
setClosable
public void setClosable(boolean closable) Sets whether the window can be closed.- Parameters:
closable- whether the window can be closed
-
isMinimizable
public boolean isMinimizable()Gets whether the window can be minimized.- Returns:
trueif the window can be minimized,falseotherwise.
-
setMinimizable
public void setMinimizable(boolean minimizable) Sets whether the window can be minimized.- Parameters:
minimizable- whether the window can be minimized
-
isMaximizable
public boolean isMaximizable()Gets whether the window can be maximized.- Returns:
trueif the window can be maximized,falseotherwise.
-
setMaximizable
public void setMaximizable(boolean maximizable) Sets whether the window can be maximized.- Parameters:
maximizable- whether the window can be maximized
-
setLocation
Sets the location for the window.- Specified by:
setLocationin interfaceHasLocation- Parameters:
location- the location to set
-
getLocation
Gets the location for the window.- Specified by:
getLocationin interfaceHasLocation- Returns:
- the location of the window
-