jdk/src/share/classes/javax/swing/JDialog.java

Print this page

        

*** 24,33 **** --- 24,35 ---- */ package javax.swing; import java.awt.*; import java.awt.event.*; + import java.beans.JavaBean; + import java.beans.BeanProperty; import javax.accessibility.*; /** * The main class for creating a dialog window. You can use this class * to create a custom dialog, or invoke the many class methods
*** 84,103 **** * * @see JOptionPane * @see JRootPane * @see javax.swing.RootPaneContainer * - * @beaninfo - * attribute: isContainer true - * attribute: containerDelegate getContentPane - * description: A toplevel window for creating dialog boxes. - * * @author David Kloba * @author James Gosling * @author Scott Violet * @since 1.2 */ @SuppressWarnings("serial") // Same-version serialization only public class JDialog extends Dialog implements WindowConstants, Accessible, RootPaneContainer, TransferHandler.HasGetTransferHandler --- 86,102 ---- * * @see JOptionPane * @see JRootPane * @see javax.swing.RootPaneContainer * * @author David Kloba * @author James Gosling * @author Scott Violet * @since 1.2 */ + @JavaBean(defaultProperty = "JMenuBar", description = "A toplevel window for creating dialog boxes.") + @SwingContainer(delegate = "getContentPane") @SuppressWarnings("serial") // Same-version serialization only public class JDialog extends Dialog implements WindowConstants, Accessible, RootPaneContainer, TransferHandler.HasGetTransferHandler
*** 741,759 **** * @throws IllegalArgumentException if defaultCloseOperation value * isn't one of the above valid values * @see #addWindowListener * @see #getDefaultCloseOperation * @see WindowConstants - * - * @beaninfo - * preferred: true - * bound: true - * enum: DO_NOTHING_ON_CLOSE WindowConstants.DO_NOTHING_ON_CLOSE - * HIDE_ON_CLOSE WindowConstants.HIDE_ON_CLOSE - * DISPOSE_ON_CLOSE WindowConstants.DISPOSE_ON_CLOSE - * description: The dialog's default close operation. */ public void setDefaultCloseOperation(int operation) { if (operation != DO_NOTHING_ON_CLOSE && operation != HIDE_ON_CLOSE && operation != DISPOSE_ON_CLOSE) { throw new IllegalArgumentException("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE"); --- 740,755 ---- * @throws IllegalArgumentException if defaultCloseOperation value * isn't one of the above valid values * @see #addWindowListener * @see #getDefaultCloseOperation * @see WindowConstants */ + @BeanProperty(preferred = true, enumerationValues = { + "WindowConstants.DO_NOTHING_ON_CLOSE", + "WindowConstants.HIDE_ON_CLOSE", + "WindowConstants.DISPOSE_ON_CLOSE"}, description + = "The dialog's default close operation.") public void setDefaultCloseOperation(int operation) { if (operation != DO_NOTHING_ON_CLOSE && operation != HIDE_ON_CLOSE && operation != DISPOSE_ON_CLOSE) { throw new IllegalArgumentException("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE");
*** 800,815 **** * * @see TransferHandler * @see #getTransferHandler * @see java.awt.Component#setDropTarget * @since 1.6 - * - * @beaninfo - * bound: true - * hidden: true - * description: Mechanism for transfer of data into the component */ public void setTransferHandler(TransferHandler newHandler) { TransferHandler oldHandler = transferHandler; transferHandler = newHandler; SwingUtilities.installSwingDropTargetAsNecessary(this, transferHandler); firePropertyChange("transferHandler", oldHandler, newHandler); --- 796,808 ---- * * @see TransferHandler * @see #getTransferHandler * @see java.awt.Component#setDropTarget * @since 1.6 */ + @BeanProperty(hidden = true, description + = "Mechanism for transfer of data into the component") public void setTransferHandler(TransferHandler newHandler) { TransferHandler oldHandler = transferHandler; transferHandler = newHandler; SwingUtilities.installSwingDropTargetAsNecessary(this, transferHandler); firePropertyChange("transferHandler", oldHandler, newHandler);
*** 842,856 **** * Sets the menubar for this dialog. * * @param menu the menubar being placed in the dialog * * @see #getJMenuBar - * - * @beaninfo - * hidden: true - * description: The menubar for accessing pulldown menus from this dialog. */ public void setJMenuBar(JMenuBar menu) { getRootPane().setMenuBar(menu); } /** --- 835,847 ---- * Sets the menubar for this dialog. * * @param menu the menubar being placed in the dialog * * @see #getJMenuBar */ + @BeanProperty(bound = false, hidden = true, description + = "The menubar for accessing pulldown menus from this dialog.") public void setJMenuBar(JMenuBar menu) { getRootPane().setMenuBar(menu); } /**
*** 891,904 **** * * @see #addImpl * @see #setLayout * @see #isRootPaneCheckingEnabled * @see javax.swing.RootPaneContainer - * @beaninfo - * hidden: true - * description: Whether the add and setLayout methods are forwarded */ protected void setRootPaneCheckingEnabled(boolean enabled) { rootPaneCheckingEnabled = enabled; } /** --- 882,894 ---- * * @see #addImpl * @see #setLayout * @see #isRootPaneCheckingEnabled * @see javax.swing.RootPaneContainer */ + @BeanProperty(hidden = true, description + = "Whether the add and setLayout methods are forwarded") protected void setRootPaneCheckingEnabled(boolean enabled) { rootPaneCheckingEnabled = enabled; } /**
*** 976,985 **** --- 966,977 ---- * Returns the {@code rootPane} object for this dialog. * * @see #setRootPane * @see RootPaneContainer#getRootPane */ + @BeanProperty(bound = false, hidden = true, description + = "the RootPane object for this dialog.") public JRootPane getRootPane() { return rootPane; }
*** 988,1001 **** * This method is called by the constructor. * * @param root the {@code rootPane} object for this dialog * * @see #getRootPane - * - * @beaninfo - * hidden: true - * description: the RootPane object for this dialog. */ protected void setRootPane(JRootPane root) { if(rootPane != null) { remove(rootPane); } --- 980,989 ----
*** 1040,1055 **** * * @throws java.awt.IllegalComponentStateException (a runtime * exception) if the content pane parameter is {@code null} * @see #getContentPane * @see RootPaneContainer#setContentPane - * - * @beaninfo - * hidden: true - * description: The client area of the dialog where child - * components are normally inserted. */ public void setContentPane(Container contentPane) { getRootPane().setContentPane(contentPane); } /** --- 1028,1040 ---- * * @throws java.awt.IllegalComponentStateException (a runtime * exception) if the content pane parameter is {@code null} * @see #getContentPane * @see RootPaneContainer#setContentPane */ + @BeanProperty(bound = false, hidden = true, description + = "The client area of the dialog where child components are normally inserted.") public void setContentPane(Container contentPane) { getRootPane().setContentPane(contentPane); } /**
*** 1072,1086 **** * * @throws java.awt.IllegalComponentStateException (a runtime * exception) if the layered pane parameter is null * @see #getLayeredPane * @see RootPaneContainer#setLayeredPane - * - * @beaninfo - * hidden: true - * description: The pane which holds the various dialog layers. */ public void setLayeredPane(JLayeredPane layeredPane) { getRootPane().setLayeredPane(layeredPane); } /** --- 1057,1069 ---- * * @throws java.awt.IllegalComponentStateException (a runtime * exception) if the layered pane parameter is null * @see #getLayeredPane * @see RootPaneContainer#setLayeredPane */ + @BeanProperty(bound = false, hidden = true, description + = "The pane which holds the various dialog layers.") public void setLayeredPane(JLayeredPane layeredPane) { getRootPane().setLayeredPane(layeredPane); } /**
*** 1100,1123 **** * This method is called by the constructor. * * @param glassPane the {@code glassPane} object for this dialog * @see #getGlassPane * @see RootPaneContainer#setGlassPane - * - * @beaninfo - * hidden: true - * description: A transparent pane used for menu rendering. */ public void setGlassPane(Component glassPane) { getRootPane().setGlassPane(glassPane); } /** * {@inheritDoc} * * @since 1.6 */ public Graphics getGraphics() { JComponent.getGraphicsInvoked(this); return super.getGraphics(); } --- 1083,1105 ---- * This method is called by the constructor. * * @param glassPane the {@code glassPane} object for this dialog * @see #getGlassPane * @see RootPaneContainer#setGlassPane */ + @BeanProperty(bound = false, hidden = true, description + = "A transparent pane used for menu rendering.") public void setGlassPane(Component glassPane) { getRootPane().setGlassPane(glassPane); } /** * {@inheritDoc} * * @since 1.6 */ + @BeanProperty(bound = false) public Graphics getGraphics() { JComponent.getGraphicsInvoked(this); return super.getGraphics(); }