Class SWindow
- 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
- Direct Known Subclasses:
SFrame, SJInternalFrame, SJWindow
Window: the Window-level listener
surface (WindowListener / WindowFocusListener / WindowStateListener) plus
the stateless / WARN-on-meaningful-change accessors that AWT defines on
Window without requiring per-instance state. Concrete subclasses
(SFrame, future SJDialog) — both Dialog-backed — layer
Frame / Dialog state on top.
Split with subclasses
SWindowcarries: listener-family registration + fire helpers, id → process-method routing, stateless Window-level accessors whose value can be answered without instance fields (isFocusableWindow,getWarningString,isAlwaysOnTopSupported,isAutoRequestFocus,toFront/toBackno-ops,packno-op, empty focus-traversal-keys, empty icon-images).- Subclasses carry: anything that stores state (
visibleshadow,owner/ownedWindows,defaultCloseOperation,title,contentPane), peer-subscription (OpenedChangeListener mirroring for setVisible / dispose), and thesetVisible/disposepaths that invoke the fire helpers here.
Window listener families don't funnel through Registrations
because Vaadin 25 surfaces no server-side counterpart for
WINDOW_ACTIVATED / WINDOW_ICONIFIED / etc. — they're
server-side-fire-only (SD_listeners_without_analog shape). Storage lives directly on this
class via listenerList, a EventListenerList
shared by the three families with type-keyed add/remove. Firing is driven by
the subclass's lifecycle (setVisible, dispose, peer close) calling the
fireWindowEvent family here.
Always-inert today: iconify / deiconify / activate / deactivate / state-changed / gained-focus / lost-focus. Ported for API parity and so migrated code compiles; no dispatch path drives them. Storage + removal still work so listener-list introspection is honest.
- 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 TypeMethodDescriptionvoidaddComponentListener(SComponentListener listener) Override ofComponentMixin.addComponentListener(SComponentListener)— the default wiring dispatches COMPONENT_SHOWN on peer attach / COMPONENT_HIDDEN on detach, which assumes attach ↔ visibility.voidvoidRegister anSWindowListener.voidvoidapplyResourceBundle(String baseName) WARN — same asapplyResourceBundle(java.util.ResourceBundle).voidapplyResourceBundle(ResourceBundle bundle) WARN —ResourceBundle-driven UI text isn't modeled.voidClear any explicitsetLocation(int, int)placement and return to the Dialog overlay's default centered position.voidcreateBufferStrategy(int numBuffers) WARN — no BufferStrategy / offscreen-buffer pipeline.voidcreateBufferStrategy(int numBuffers, BufferCapabilities caps) WARN — seecreateBufferStrategy(int).voiddispose()AWT: close the window, release the native peer, fireWINDOW_CLOSED, walkremoveNotify.protected voidDispose fire (WINDOW_CLOSED), fromdispose().protected voidUser-close fire (WINDOW_CLOSING).protected voidFirst-show fire (WINDOW_OPENED), gated byeverShowninsetVisible(boolean).voidfireWindowEvent(int id) Fire one of the non-focus, non-state ids (OPENED / CLOSING / CLOSED / ICONIFIED / DEICONIFIED / ACTIVATED / DEACTIVATED) throughprocessWindowEvent(SWindowEvent).voidfireWindowFocusEvent(int id, com.vaadin.flow.component.Component opposite) voidfireWindowStateEvent(int oldState, int newState) WARN — no BufferStrategy.booleanAWT default; setter WARNs onfalse.com.vaadin.flow.component.ComponentNo parent Container above a Window.com.vaadin.flow.component.ComponentFocus traversal isn't modeled (R_infra_not_surface).getFocusTraversalKeys(int id) Focus traversal isn't modeled (R_infra_not_surface).Icons aren't wired to the browser (favicons are route-level).No IME subsystem;nullmatches AWT's pre-IM default.com.vaadin.flow.component.ComponentFocus traversal isn't modeled (R_infra_not_surface).floatAWT default; we don't model transparency.SWindow[]Dereference each WeakReference, keep live ones, opportunistically drop cleared entries.getOwner()Subset ofgetWindows()withowner == null.getShape()We can't render non-rectangular windows (DOM is rectangular).AWT's applet-sandbox banner.RegisteredSWindowFocusListeners.RegisteredSWindowListeners in registration order.EverySWindowreachable from the currentUI.RegisteredSWindowStateListeners.booleanisActive()No OS window-manager concept —falseis the honest default.booleanAWT default; setter WARNs ontrue.booleanWe don't honor always-on-top (browsers have no window z-order).booleanAWT default; seesetAutoRequestFocus(boolean).booleanJDK Frame/Dialog default is true.booleanWindow in AWT is always-true; we returnfalsefor parity with Container's silent-false default since no focus-cycle walker exists either way (R_infra_not_surface).booleanBrowser tab focus isn't tracked server-side.booleanAWT default; setter WARNs ontrue.booleanVaadin-first read-back ofsetUndecoratedChrome(boolean).booleanWindow is always a validate-root in AWT.voidpack()Silent no-op — the Dialog peer auto-sizes to content, and we have no pixel numbers to reconcile (R_layouts_close_enough).Diagnostic — mirrors the shape ofjava.awt.Window.paramString().voidTop-level AWT-event router.voidDispatch the non-focus, non-state ids to registeredSWindowListeners.voidDispatchWINDOW_GAINED_FOCUS/WINDOW_LOST_FOCUSto focus listeners.voidDispatchWINDOW_STATE_CHANGEDto state listeners.voidRemove a previously registeredSWindowFocusListener.voidRemove a previously registeredSWindowListener.voidRemove a previously registeredSWindowStateListener.voidsetAlwaysOnTop(boolean b) WARN ontrue— no z-order in a browser tab.voidsetAutoRequestFocus(boolean b) WARN onfalse— auto-focus behavior isn't modeled.voidsetBounds(int x, int y, int width, int height) setLocation(int, int)+setSize(int, int)in one call.voidsetEnabled(boolean enabled) Fires no"enabled"property change, unlike every otherJComponentMixinimplementor.voidsetFocusableWindowState(boolean b) WARN onfalse— we have no focus subsystem to opt out of.voidsetFocusCycleRoot(boolean b) WARN ontrue— no cycle-root traversal machinery.voidsetIconImage(Image icon) Convenience forsetIconImages(List.of(icon))— same silent-accept.voidsetIconImages(List<? extends Image> icons) Silent accept — icons don't wire to the browser (favicons belong to the route, not a Window).voidsetLocation(int x, int y) Position the overlay's top-left corner at viewport pixel (x,y).voidsetLocationByPlatform(boolean b) WARN ontrue— browsers don't position tabs.voidsetLocationRelativeTo(com.vaadin.flow.component.Component c) Re-center the window.voidsetOpacity(float opacity) WARN — transparency isn't modeled.voidWARN on non-null — non-rectangular shapes don't render.voidsetSize(int width, int height) Pixel size for the overlay — Dialog's own width/height channel.voidsetUndecoratedChrome(boolean undecorated) Toggle theemul-undecoratedoverlay class: strips the Dialog's border radius, content padding, and header (title + SFrame's close-X chrome) so the window renders as a bare content rect — Swing's undecorated-window shape.voidsetVisible(boolean b) Mirror first, then drive the peer underpreventPeerEvents.voidtoBack()Silent no-op — no z-order in a browser tab.voidtoFront()Silent no-op — browsers auto-stack overlays; apps pair this with setVisible routinely.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, getHeight, getLeft, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getModality, getOverlayRole, getRole, getStyle, getTop, getWidth, isAutofocus, isCloseOnEsc, isCloseOnOutsideClick, isDraggable, isFocusTrap, isKeepInViewport, isModal, isOpened, isResizable, onAttach, open, removeAll, 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, add, addComponentAsFirst, getComponentAt, getComponentCount, indexOf, remove, remove, 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, getRootPane, 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
-
SWindow
public SWindow()Untitled, no owner. -
SWindow
With owner. Null owner is a top-level window. Subscribes to the Dialog peer'sOpenedChangeEventso user-initiated closes round-trip back into thevisibleshadow and fireWINDOW_CLOSINGviaprocessWindowEvent(SWindowEvent).
-
-
Method Details
-
addWindowListener
Register anSWindowListener. Storage only — firing is driven by the subclass's lifecycle (e.g.SFrame.setVisiblefiresSWindowEvent.WINDOW_OPENEDthroughfireWindowEvent(int)). Null listener silently ignored, matchingEventListenerList's contract. -
removeWindowListener
Remove a previously registeredSWindowListener. No-op on unregistered. -
getWindowListeners
RegisteredSWindowListeners in registration order. Empty array when none. -
addWindowFocusListener
-
removeWindowFocusListener
Remove a previously registeredSWindowFocusListener. -
getWindowFocusListeners
RegisteredSWindowFocusListeners. Always empty in practice — no dispatch path today. -
addWindowStateListener
-
removeWindowStateListener
Remove a previously registeredSWindowStateListener. -
getWindowStateListeners
RegisteredSWindowStateListeners. Always empty in practice — no state transitions. -
fireWindowEvent
public void fireWindowEvent(int id) Fire one of the non-focus, non-state ids (OPENED / CLOSING / CLOSED / ICONIFIED / DEICONIFIED / ACTIVATED / DEACTIVATED) throughprocessWindowEvent(SWindowEvent). Skipped when noSWindowListeneris registered. -
fireWindowFocusEvent
public void fireWindowFocusEvent(int id, com.vaadin.flow.component.Component opposite) FireSWindowEvent.WINDOW_GAINED_FOCUS/SWindowEvent.WINDOW_LOST_FOCUS.oppositeis alwaysnulltoday — browser focus transitions don't surface the opposite server-side. -
fireWindowStateEvent
public void fireWindowStateEvent(int oldState, int newState) FireSWindowEvent.WINDOW_STATE_CHANGED. Never called today (no iconify / maximize in our Dialog-backed Window); preserved so a future slice that models window state can plug straight in. -
processWindowEvent
Dispatch the non-focus, non-state ids to registeredSWindowListeners.nullguard matchesComponentMixin's process family — a smoke-test null probe shouldn't crash. -
processWindowFocusEvent
DispatchWINDOW_GAINED_FOCUS/WINDOW_LOST_FOCUSto focus listeners. -
processWindowStateEvent
DispatchWINDOW_STATE_CHANGEDto state listeners. -
processEvent
Top-level AWT-event router. OnlySWindowEventids dispatch here; every other event type falls through (non-Window events wouldn't have been passed in). Matches AWT's shape —Window.processEventroutes by id then delegates to the Container/Component chain for non-Window ids. -
isFocusableWindow
public boolean isFocusableWindow()JDK Frame/Dialog default is true. We don't model focus traversal (R_infra_not_surface) so the gate never rejects anyone —trueis the honest "can this window take focus at all?" answer callers check. -
getWarningString
AWT's applet-sandbox banner. No SecurityManager runs in a Vaadin server, so we're always trusted — null is AWT's correct answer. -
isAlwaysOnTopSupported
public boolean isAlwaysOnTopSupported()We don't honor always-on-top (browsers have no window z-order). -
isAutoRequestFocus
public boolean isAutoRequestFocus()AWT default; seesetAutoRequestFocus(boolean). -
isAlwaysOnTop
public boolean isAlwaysOnTop()AWT default; setter WARNs ontrue. -
isLocationByPlatform
public boolean isLocationByPlatform()AWT default; setter WARNs ontrue. -
getShape
We can't render non-rectangular windows (DOM is rectangular). -
getOpacity
public float getOpacity()AWT default; we don't model transparency. -
getFocusableWindowState
public boolean getFocusableWindowState()AWT default; setter WARNs onfalse. -
isValidateRoot
public boolean isValidateRoot()Window is always a validate-root in AWT. Resolves the mixin diamond withJComponentMixin.isValidateRoot()(which returns false) — Window's contract wins because a Frame / Dialog IS-A Window, and migrated code that walksrevalidatestops here.- Specified by:
isValidateRootin interfaceJComponentMixin
-
isActive
public boolean isActive()No OS window-manager concept —falseis the honest default. -
isFocused
public boolean isFocused()Browser tab focus isn't tracked server-side. -
getFocusOwner
public com.vaadin.flow.component.Component getFocusOwner()Focus traversal isn't modeled (R_infra_not_surface). -
getMostRecentFocusOwner
public com.vaadin.flow.component.Component getMostRecentFocusOwner()Focus traversal isn't modeled (R_infra_not_surface). -
isFocusCycleRoot
public boolean isFocusCycleRoot()Window in AWT is always-true; we returnfalsefor parity with Container's silent-false default since no focus-cycle walker exists either way (R_infra_not_surface). Flip if focus modeling lands. -
getFocusCycleRootAncestor
public com.vaadin.flow.component.Component getFocusCycleRootAncestor()No parent Container above a Window. -
getFocusTraversalKeys
Focus traversal isn't modeled (R_infra_not_surface). -
getIconImages
-
getInputContext
No IME subsystem;nullmatches AWT's pre-IM default. -
setAlwaysOnTop
public void setAlwaysOnTop(boolean b) WARN ontrue— no z-order in a browser tab. Silent onfalse(default). -
setLocationByPlatform
public void setLocationByPlatform(boolean b) WARN ontrue— browsers don't position tabs. Silent onfalse. -
setShape
WARN on non-null — non-rectangular shapes don't render. -
setOpacity
public void setOpacity(float opacity) WARN — transparency isn't modeled. -
setFocusableWindowState
public void setFocusableWindowState(boolean b) WARN onfalse— we have no focus subsystem to opt out of. -
setAutoRequestFocus
public void setAutoRequestFocus(boolean b) WARN onfalse— auto-focus behavior isn't modeled. -
setFocusCycleRoot
public void setFocusCycleRoot(boolean b) WARN ontrue— no cycle-root traversal machinery. -
setIconImages
-
setIconImage
Convenience forsetIconImages(List.of(icon))— same silent-accept. -
toFront
public void toFront()Silent no-op — browsers auto-stack overlays; apps pair this with setVisible routinely. -
toBack
public void toBack()Silent no-op — no z-order in a browser tab. -
pack
public void pack()Silent no-op — the Dialog peer auto-sizes to content, and we have no pixel numbers to reconcile (R_layouts_close_enough). Apps call pack() routinely as a "finalise layout" gesture; WARN-per-call would swamp logs. -
applyResourceBundle
WARN —ResourceBundle-driven UI text isn't modeled. -
applyResourceBundle
WARN — same asapplyResourceBundle(java.util.ResourceBundle). -
createBufferStrategy
public void createBufferStrategy(int numBuffers) WARN — no BufferStrategy / offscreen-buffer pipeline. -
createBufferStrategy
WARN — seecreateBufferStrategy(int).- Throws:
AWTException
-
getBufferStrategy
WARN — no BufferStrategy. -
setLocation
public void setLocation(int x, int y) Position the overlay's top-left corner at viewport pixel (x,y). Setting an explicit position takes the Dialog out of its default centered placement;centerOnScreen()restores it.- Specified by:
setLocationin interfaceComponentMixin
-
setSize
public void setSize(int width, int height) Pixel size for the overlay — Dialog's own width/height channel.- Specified by:
setSizein interfaceComponentMixin
-
setBounds
public void setBounds(int x, int y, int width, int height) setLocation(int, int)+setSize(int, int)in one call.- Specified by:
setBoundsin interfaceComponentMixin
-
centerOnScreen
public void centerOnScreen()Clear any explicitsetLocation(int, int)placement and return to the Dialog overlay's default centered position. -
setUndecoratedChrome
public void setUndecoratedChrome(boolean undecorated) Toggle theemul-undecoratedoverlay class: strips the Dialog's border radius, content padding, and header (title + SFrame's close-X chrome) so the window renders as a bare content rect — Swing's undecorated-window shape. The box-shadow stays: in a browser the window floats over live page content, not a desktop, and a shadowless rect there is illegible (documented R_layouts_close_enough divergence; seeemul/swindow.css).Always on for
SJWindow(javax.swing.JWindowis undecorated by definition); driven bysetUndecoratedon SFrame and the emulator-layer Frame / Dialog / JFrame. -
isUndecoratedChrome
public boolean isUndecoratedChrome()Vaadin-first read-back ofsetUndecoratedChrome(boolean). -
setLocationRelativeTo
public void setLocationRelativeTo(com.vaadin.flow.component.Component c) Re-center the window. AWT semantics:nullcenters on screen; a visible component argument centers over that component. We map both to viewport-centering (centerOnScreen()) — the browser has no screen geometry to compute a component-relative position from, and a centered overlay is the close-enough answer for the "center over my main window" idiom (the main window effectively IS the viewport). R_layouts_close_enough divergence, accepted. -
setEnabled
public void setEnabled(boolean enabled) Fires no"enabled"property change, unlike every otherJComponentMixinimplementor. The bound"enabled"property isJComponent's, andjava.awt.Window— withFrame,JFrame,JDialogandJWindowunder it — is not aJComponent; it inheritsjava.awt.Component.setEnabled, which fires nothing bound (SD_property_fanout_audit).This class takes
JComponentMixinfor its helper surface (border, tooltip, name), not because a window is aJComponent, so the mixin's JComponent-level property fan-out has to be suppressed here. One override coversSFrame,SJFrame,SJDialogandSJWindowby inheritance.- Specified by:
setEnabledin interfaceComponentMixin- Specified by:
setEnabledin interfacecom.vaadin.flow.component.HasEnabled- Specified by:
setEnabledin interfaceJComponentMixin
-
fireOpenedEvent
protected void fireOpenedEvent()First-show fire (WINDOW_OPENED), gated byeverShowninsetVisible(boolean). -
fireClosingEvent
protected void fireClosingEvent()User-close fire (WINDOW_CLOSING). Routed throughprocessWindowEvent(SWindowEvent)directly (notfireWindowEvent(int)) so a close-op switch overridden by SJFrame / SJDialog applies even when no WindowListener is registered. -
fireClosedEvent
protected void fireClosedEvent()Dispose fire (WINDOW_CLOSED), fromdispose(). -
addComponentListener
Override ofComponentMixin.addComponentListener(SComponentListener)— the default wiring dispatches COMPONENT_SHOWN on peer attach / COMPONENT_HIDDEN on detach, which assumes attach ↔ visibility. That assumption doesn't hold for SWindow: the Dialog peer stays attached acrosssetVisible(false)(only detaches ondispose()), so attach-driven fires misrepresent the show/hide transitions we care about. Instead we register with a no-op Vaadin-registration and drive the dispatch fromsetVisible(boolean)/onPeerOpenedChanged(boolean)/dispose()directly viafireComponentEvent(int).- Specified by:
addComponentListenerin interfaceComponentMixin
-
setVisible
public void setVisible(boolean b) Mirror first, then drive the peer underpreventPeerEvents.setVisible(true)attaches us at the pointattachForShow(UI)picks (IllegalStateExceptionwhen there is no currentUI— a narrow D_never_fail_on_gaps carve-out for an environment we genuinely can't recover from). RefiringWINDOW_OPENEDis gated oneverShown, whichdispose()resets so a dispose→show cycle fires again.- Overrides:
setVisiblein classcom.vaadin.flow.component.dialog.Dialog
-
dispose
public void dispose()AWT: close the window, release the native peer, fireWINDOW_CLOSED, walkremoveNotify. Our peer isthisand can't be nulled — we achieve "non-displayable" by detaching from the UI.everShownresets so a subsequentsetVisible(boolean)refiresWINDOW_OPENED— AWT's dispose-then-show contract.The detach waits for the client's
closedevent when the browser is animating a close, so the overlay can hand focus back while its content is still in the DOM (SD_detach_after_closed). Until then the peer sits attached and closed, the statesetVisible(false)leaves it in. -
getOwner
-
getOwnedWindows
Dereference each WeakReference, keep live ones, opportunistically drop cleared entries. Mirrors JDKWindow.getOwnedWindows()'s weak-ref pruning. Logically independent of peer attachment state — an owner link persists whether the owned window is displayed or not. -
getWindows
-
getOwnerlessWindows
Subset ofgetWindows()withowner == null. -
paramString
-