Class SJInternalFrame

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.dialog.Dialog
com.vaadin.swingbridge.surrogates.SWindow
com.vaadin.swingbridge.surrogates.SJInternalFrame
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

public class SJInternalFrame extends SWindow
Surrogate for JInternalFrame (SD_sjinternalframe) — the peer for :emulators JInternalFrame. An internal frame renders as a decorated non-modal Vaadin Dialog overlay: it is the inverse of SJWindow, which strips the Dialog chrome. Frames escape the desktop-pane's bounds and stack in Vaadin's overlay order — reusing Vaadin's overlay primitive sidesteps the D_glasspane_structural/SD_sjframe structural layered-pane deferral (D_internal_frames).

Ctor delta over SWindow (SD_internalframe_chrome)

  • Keeps chrome — setHeaderTitle for the title, a header close-X icon (SD_internalframe_fire_seams), setDraggable(true) + setResizable(true): the title-bar drag and resize grips are JInternalFrame's drag / resizable affordances, which Vaadin Dialog draws for free.
  • Modeless — ModalityMode.MODELESS; an internal frame never blocks the page.
  • Closes only via its close-X — ESC / outside-click dismissal disarmed, matching Swing (a JInternalFrame doesn't close on ESC).

Lifecycle events (SD_internalframe_fire_seams)

The three SWindow lifecycle fire seams are overridden to fire SInternalFrameEvent instead of window events — OPENED on first show, CLOSING on the close-X (and any peer close), CLOSED on dispose. ACTIVATED / DEACTIVATED fire from setSelected(boolean) (SD_internalframe_activation). ICONIFIED / DEICONIFIED never fire here — minimize is emulator-only (SD_no_surrogate_iconify). Server-side-fire-only (SD_listeners_without_analog shape), like the Window families.
See Also:
  • Constructor Details

    • SJInternalFrame

      public SJInternalFrame()
    • SJInternalFrame

      public SJInternalFrame(String title)
  • Method Details

    • setClosable

      public void setClosable(boolean closable)
      Show / hide the header close-X (JInternalFrame closable).
    • setIconifiable

      public void setIconifiable(boolean iconifiable)
      Show / hide the header minimize button (JInternalFrame iconifiable).
    • setMaximizable

      public void setMaximizable(boolean maximizable)
      Show / hide the header maximize button (JInternalFrame maximizable).
    • setIconifyHandler

      public void setIconifyHandler(Runnable r)
      Install the action the header minimize button runs — the emulator wires this to its vetoable setIcon(true) so a header-click honours the JInternalFrame icon constrained property.
    • setMaximizeHandler

      public void setMaximizeHandler(Runnable r)
      Install the action the header maximize button runs (toggles maximum).
    • getTitle

      public String getTitle()
      Never-null.
    • setTitle

      public void setTitle(String title)
      Mirrors Dialog.setHeaderTitle(String); fires "title" PCE.
    • isSelected

      public boolean isSelected()
    • setSelected

      public void setSelected(boolean selected)
      Select / deselect the frame. Fires INTERNAL_FRAME_ACTIVATED / DEACTIVATED on change and a "selected" PCE. Precise front-raise is Vaadin overlay order (R_layouts_close_enough) — no programmatic toFront.
    • isMaximum

      public boolean isMaximum()
    • setMaximum

      public void setMaximum(boolean maximum)
      Maximize / restore. Maximize drives the overlay to fill the viewport (top/left 0, 100%/100%); restore returns to the captured pre-maximize geometry, or the centered default if none. Vaadin Dialog has no native maximize toggle, so this is surrogate-driven geometry. Bound property only — no SInternalFrameEvent fires (matches JDK).
    • addInternalFrameListener

      public void addInternalFrameListener(SInternalFrameListener l)
    • removeInternalFrameListener

      public void removeInternalFrameListener(SInternalFrameListener l)
    • getInternalFrameListeners

      public SInternalFrameListener[] getInternalFrameListeners()
    • fireInternalFrameEvent

      public void fireInternalFrameEvent(int id)
      Dispatch one SInternalFrameEvent id to registered listeners.
    • fireOpenedEvent

      protected void fireOpenedEvent()
      Description copied from class: SWindow
      First-show fire (WINDOW_OPENED), gated by SWindow.everShown in SWindow.setVisible(boolean).
      Overrides:
      fireOpenedEvent in class SWindow
    • fireClosingEvent

      protected void fireClosingEvent()
      Description copied from class: SWindow
      User-close fire (WINDOW_CLOSING). Routed through SWindow.processWindowEvent(SWindowEvent) directly (not SWindow.fireWindowEvent(int)) so a close-op switch overridden by SJFrame / SJDialog applies even when no WindowListener is registered.
      Overrides:
      fireClosingEvent in class SWindow
    • fireClosedEvent

      protected void fireClosedEvent()
      Description copied from class: SWindow
      Dispose fire (WINDOW_CLOSED), from SWindow.dispose().
      Overrides:
      fireClosedEvent in class SWindow
    • getContentPane

      public com.vaadin.flow.component.html.Div getContentPane()
    • setContentPane

      public void setContentPane(com.vaadin.flow.component.html.Div newPane)
    • add

      public void add(Collection<com.vaadin.flow.component.Component> components)
    • addComponentAtIndex

      public void addComponentAtIndex(int index, com.vaadin.flow.component.Component component)
      Specified by:
      addComponentAtIndex in interface com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>
      Overrides:
      addComponentAtIndex in class com.vaadin.flow.component.dialog.Dialog
    • remove

      public void remove(com.vaadin.flow.component.Component... components)
    • remove

      public void remove(Collection<com.vaadin.flow.component.Component> components)
    • removeAll

      public void removeAll()
      Specified by:
      removeAll in interface com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>
      Overrides:
      removeAll in class com.vaadin.flow.component.dialog.Dialog
    • getRootPane

      public SJRootPane getRootPane()
      Description copied from interface: JComponentMixin
      Walks the Vaadin parent chain and returns the first SJRootPane ancestor, or null if none. Mirrors the JDK JComponent.getRootPane() contract (climb-until-root-pane) over the surrogate-layer types.

      Surrogate-layer divergence from JDK signature: returns SJRootPane (Vaadin-rooted) rather than javax.swing.JRootPane. The same R_vaadin_first + SD_sjframe stance that drove JComponentMixin.getTopLevelAncestor() to return Vaadin Component applies here — SJRootPane is deliberately not a JDK JRootPane subclass (it extends com.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 lets SJFrame provide 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

      public void setRootPane(SJRootPane root)
      Replaces the root pane, as the JDK's protected setRootPane does: the outgoing one leaves this window and root becomes 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 - null leaves the window without a root pane, as the JDK allows
    • createRootPane

      protected SJRootPane createRootPane()
      Subclass hook matching JDK JInternalFrame's createRootPane.
    • 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)
    • paramString

      public String paramString()
      Description copied from class: SWindow
      Diagnostic — mirrors the shape of java.awt.Window.paramString(). Subclasses (SFrame) override and chain super to add Frame-/Dialog-specific fields like title.
      Overrides:
      paramString in class SWindow