Class JDialog

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, WindowConstants, RootPaneContainer

public class JDialog extends Dialog implements WindowConstants, RootPaneContainer
Emulator for JDialog. R_leaf_peer_lockdown-locked peer is SJDialog.
See Also:
  • Field Details

    • rootPane

      protected JRootPane rootPane
    • rootPaneCheckingEnabled

      protected boolean rootPaneCheckingEnabled
  • Constructor Details

  • Method Details

    • dialogInit

      protected void dialogInit()
      Mirror of JFrame.frameInit, and of the JDK's own JDialog.dialogInit: build the root pane through createRootPane() and plant it via setRootPane(JRootPane), then turn root-pane checking on — each as a call, so a subclass override of any hook actually runs (R_no_vaadin_in_api limb 2). Carries the JDK's full five-line body: enableEvents and setBackground are here because JDialog.dialogInit has them too, where JWindow.windowInit has neither — see JFrame.frameInit for why both land on deliberate nothings.
    • getContentPane

      public Container getContentPane()
      Delegates to the root pane, as the JDK's does.
      Specified by:
      getContentPane in interface RootPaneContainer
    • setContentPane

      public void setContentPane(Container newPane)
      Delegates to the root pane, as the JDK's does — so dialog.getContentPane() and dialog.getRootPane().getContentPane() are the same pane by construction rather than by a mirror kept in step.
      Specified by:
      setContentPane in interface RootPaneContainer
    • addImpl

      protected void addImpl(Component comp, Object constraints, int index)
      Overrides:
      addImpl in class Container
    • setLayout

      public void setLayout(LayoutManager manager)
      Description copied from class: Window
      Stores the manager and invalidates as AWT does, minus the CSS dispatch — see Window.windowLayout.
      Overrides:
      setLayout in class Window
      Parameters:
      manager - may be null, as AWT allows
    • remove

      public void remove(Component comp)
      Overrides:
      remove in class Container
    • setRootPaneCheckingEnabled

      protected void setRootPaneCheckingEnabled(boolean enabled)
    • isRootPaneCheckingEnabled

      protected boolean isRootPaneCheckingEnabled()
      Whether add / remove / setLayout redirect into the content pane. The redirect consults this method rather than the field, so a subclass override is honoured (R_no_vaadin_in_api second limb, D_r12_provenance).
    • getRootPane

      public JRootPane getRootPane()
      Specified by:
      getRootPane in interface RootPaneContainer
    • setRootPane

      protected void setRootPane(JRootPane newRootPane)
      The JDK's body: remove the outgoing root pane, then add the incoming one, with root-pane checking cleared so addImpl(Component, Object, int)'s redirect falls through instead of routing the new root pane into the old one's content pane.
    • createRootPane

      protected JRootPane createRootPane()
      A fresh JRootPane, which setRootPane(JRootPane) hands to the surrogate.
    • getLayeredPane

      public JLayeredPane getLayeredPane()
      Specified by:
      getLayeredPane in interface RootPaneContainer
    • setLayeredPane

      public void setLayeredPane(JLayeredPane layered)
      Specified by:
      setLayeredPane in interface RootPaneContainer
    • getGlassPane

      public Component getGlassPane()
      Specified by:
      getGlassPane in interface RootPaneContainer
    • setGlassPane

      public void setGlassPane(Component glass)
      Specified by:
      setGlassPane in interface RootPaneContainer
    • getDefaultCloseOperation

      public int getDefaultCloseOperation()
    • setDefaultCloseOperation

      public void setDefaultCloseOperation(int operation)
      JDialog rejects EXIT_ON_CLOSE at set-time per JDK contract — only JFrame may terminate the JVM. The other three values are accepted silently. Validated here, as the JDK's body does, so the throw does not wait for a peer; the gesture-disarm is the SJDialog peer's.
      Throws:
      IllegalArgumentException - on EXIT_ON_CLOSE or an unknown value
    • processWindowEvent

      protected void processWindowEvent(WindowEvent e)
      Mirrors JFrame.processWindowEvent minus the EXIT_ON_CLOSE branch — JDialog rejects EXIT_ON_CLOSE at set-time.
      Overrides:
      processWindowEvent in class Dialog
    • setJMenuBar

      public void setJMenuBar(JMenuBar bar)
      The JDK's one-line delegation to getRootPane().setJMenuBar(menu), which is now literally that — so dialog.setJMenuBar(x) and dialog.getRootPane().setJMenuBar(x) are the same bar. It is planted in the root pane's layered pane, above the content pane.

      Fires no "JMenuBar" property change: neither class fires anything. JInternalFrame is the only class in javax.swing that does (its MENU_BAR_PROPERTY), which is why the absence here is a decision and not an oversight (R_decline_effect_only, D_window_fanout).

    • getJMenuBar

      public JMenuBar getJMenuBar()
    • paramString

      protected String paramString()
      Overrides:
      paramString in class Dialog
    • getAccessibleContext

      public AccessibleContext getAccessibleContext()
      Specified by:
      getAccessibleContext in interface Accessible
      Overrides:
      getAccessibleContext in class Dialog
    • setTransferHandler

      public void setTransferHandler(TransferHandler h)
      Stores the handler and fires "transferHandler"; no drop target is installed. Window-level drop is not wired — JComponent's own setTransferHandler is (D_drag_and_drop) — so what is declined is the effect (R_decline_effect_only, D_owed_events).
    • getTransferHandler

      public TransferHandler getTransferHandler()