Class SJWindow
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, 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>, ComponentMixin, ContainerMixin, JComponentMixin, Serializable
JWindow: an undecorated top-level
window — splash screens, toast/notification popups, heavyweight-popup
vehicles. JDK shape is JWindow extends java.awt.Window
implements RootPaneContainer: no title, no chrome, no close gestures,
no defaultCloseOperation (JWindow doesn't implement
WindowConstants), no menubar slot. Accordingly this class
extends SWindow directly — NOT SFrame, whose
title / close-X / close-op state a JWindow must not carry.
Ctor defaults (the entire JWindow delta over SWindow)
- Undecorated always —
SWindow.setUndecoratedChrome(boolean)is on unconditionally: no header, no content padding, no border radius. Box-shadow kept per the documented R_layouts_close_enough divergence. - Modeless — a splash/toast must never block the page.
Vaadin Dialog defaults to modal; the ctor flips to
ModalityMode.MODELESS. - No user close gestures — ESC / outside-click dismissal is
disarmed. A real JWindow has no chrome to close it from;
programmatic
setVisible(false)/dispose()are the only close paths, which also means no peer-originatedWINDOW_CLOSINGever fires here. - Not user-movable / resizable — no title bar to drag, no resize grips. Vaadin Dialog's defaults (draggable=false, resizable=false) already match; unlike SFrame's ctor, nothing is seeded.
Placement
The typical JWindow is explicitly placed:setLocationRelativeTo(null)
for a centered splash (the Dialog default — a no-op that also clears
prior placement), SWindow.setBounds(int, int, int, int) for a
corner toast. Both live on SWindow's geometry surface mapping
1:1 to the overlay's top/left/width/height.
RootPane / contentPane scaffolding
Third consumer of the sharedRootPaneScaffold (with
SJFrame / SJDialog) — the composition dedup SD_sjdialog's
third-consumer trigger anticipated. Public surface mirrors JDK
JWindow's RootPaneContainer subset: content pane routing, lazy root
pane, layered / glass pass-throughs. The scaffold's menubar slot
stays dormant here — JWindow has no setJMenuBar.- 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.OpenedChangeEventNested classes/interfaces inherited from interface JComponentMixin
JComponentMixin.ActionStandin -
Field Summary
Fields inherited from interface JComponentMixin
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Collection<com.vaadin.flow.component.Component> components) voidaddComponentAtIndex(int index, com.vaadin.flow.component.Component component) protected SJRootPaneSubclass hook matching JDK JWindow'screateRootPane.com.vaadin.flow.component.html.DivLazy-creates if never accessed.com.vaadin.flow.component.button.ButtonConvenience accessor:getRootPane().getDefaultButton().com.vaadin.flow.component.Componentcom.vaadin.flow.component.ComponentWalks the Vaadin parent chain and returns the firstSJRootPaneancestor, ornullif none.voidremove(com.vaadin.flow.component.Component... components) voidremove(Collection<com.vaadin.flow.component.Component> components) voidvoidsetContentPane(com.vaadin.flow.component.html.Div newPane) Swap the content pane.voidsetGlassPane(com.vaadin.flow.component.Component glass) voidsetLayeredPane(com.vaadin.flow.component.Component layered) voidsetRootPane(SJRootPane root) Replaces the root pane, as the JDK's protectedsetRootPanedoes: the outgoing one leaves this window androotbecomes its one child, holding the content pane from then on.Methods inherited from class SWindow
addComponentListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, centerOnScreen, createBufferStrategy, createBufferStrategy, dispose, fireClosedEvent, fireClosingEvent, fireOpenedEvent, fireWindowEvent, fireWindowFocusEvent, fireWindowStateEvent, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isUndecoratedChrome, isValidateRoot, pack, paramString, processEvent, processWindowEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setAutoRequestFocus, setBounds, setEnabled, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocationByPlatform, setLocationRelativeTo, setOpacity, setShape, setSize, setUndecoratedChrome, setVisible, toBack, toFrontMethods inherited from class com.vaadin.flow.component.dialog.Dialog
addAttachListener, addClosedListener, addDetachListener, addDialogCloseActionListener, addDraggedListener, addOpenedChangeListener, addResizeListener, bindChildren, bindHeight, bindVisible, bindWidth, close, getAriaLabel, getChildren, getFooter, getHeader, getHeaderTitle, 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, 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, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, whenAttachedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ComponentMixin
_installSwingClass, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, dispatchEvent, doLayout, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getComponentListeners, getCursor, getFocusListeners, getFont, getForeground, getGraphics, getHierarchyBoundsListeners, getHierarchyListeners, getKeyListeners, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getName, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolTipText, getX, getY, grabFocus, hasFocus, invalidate, isDisplayable, isFocusable, isFocusOwner, isShowing, paint, paintAll, print, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, revalidate, setBackground, setBounds, setCursor, setFocusable, setFont, setForeground, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validateMethods inherited from interface ContainerMixin
addContainerListener, getContainerListeners, getLayout, paintComponents, printComponents, removeContainerListener, setLayoutMethods 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, replaceMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, 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, 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, setThemeVariantsMethods inherited from interface JComponentMixin
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paintImmediately, paintImmediately, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, requestDefaultFocus, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDoubleBuffered, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateUI
-
Constructor Details
-
SJWindow
public SJWindow()Ownerless window. -
SJWindow
-
-
Method Details
-
getContentPane
public com.vaadin.flow.component.html.Div getContentPane()Lazy-creates if never accessed. Never returns null. -
setContentPane
public void setContentPane(com.vaadin.flow.component.html.Div newPane) Swap the content pane. JDK contract: null throwsIllegalComponentStateException; the mirror-into- rootPane invariant holds across swaps. Carried byRootPaneScaffold. -
add
-
addComponentAtIndex
public void addComponentAtIndex(int index, com.vaadin.flow.component.Component component) - Specified by:
addComponentAtIndexin interfacecom.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>- Overrides:
addComponentAtIndexin classcom.vaadin.flow.component.dialog.Dialog
-
remove
public void remove(com.vaadin.flow.component.Component... components) -
remove
-
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
-
getRootPane
Description copied from interface:JComponentMixinWalks the Vaadin parent chain and returns the firstSJRootPaneancestor, ornullif none. Mirrors the JDKJComponent.getRootPane()contract (climb-until-root-pane) over the surrogate-layer types.Surrogate-layer divergence from JDK signature: returns
SJRootPane(Vaadin-rooted) rather thanjavax.swing.JRootPane. The same R_vaadin_first + SD_sjframe stance that droveJComponentMixin.getTopLevelAncestor()to return VaadinComponentapplies here — SJRootPane is deliberately not a JDK JRootPane subclass (it extendscom.vaadin.flow.component.html.Div), so a JDK-typed accessor would have to either fabricate a wrapper or stay permanently null. The Vaadin-typed accessor letsSJFrameprovide a covariant override that returns its lazy-constructed pane, and lets standalone surrogates report a real ancestor when one exists. Migrators porting Swing code that read the JDK type adjust the variable type at the surrogate stage; the:emulators.JComponent.getRootPane()path keeps the JDK-typed signature for stage-2 import-swap compatibility. -
setRootPane
Replaces the root pane, as the JDK's protectedsetRootPanedoes: the outgoing one leaves this window androotbecomes its one child, holding the content pane from then on. Public so the emulator layer can hand down the peer of the root pane it built itself, which is how one root pane serves both layers.- Parameters:
root-nullleaves the window without a root pane, as the JDK allows
-
createRootPane
Subclass hook matching JDK JWindow'screateRootPane. Called once on firstgetRootPane()read. -
getLayeredPane
public com.vaadin.flow.component.Component getLayeredPane() -
setLayeredPane
public void setLayeredPane(com.vaadin.flow.component.Component layered) -
getGlassPane
public com.vaadin.flow.component.Component getGlassPane() -
setGlassPane
public void setGlassPane(com.vaadin.flow.component.Component glass) -
getDefaultButton
public com.vaadin.flow.component.button.Button getDefaultButton()Convenience accessor:getRootPane().getDefaultButton().
-