|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Dialog | +--javax.swing.JDialog | +--com.borland.primetime.ui.DefaultDialog
This helper class provides a variety of convenient mechanisms for creating a dialog including: auto-centering, frame finding, default button handling, and minimum size enforcement.
Inner Class Summary | |
protected class |
DefaultDialog.ButtonLink
This class is used to wire a JButton to an ActionListener. |
Inner classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
Inner classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
DefaultDialog(java.awt.Component owner,
java.lang.String title,
boolean modal)
Creates a new DefaultDialog instance that automatically determines its size basd on the size of its contents. |
|
DefaultDialog(java.awt.Component owner,
java.lang.String title,
boolean modal,
boolean autoSize)
Creates a new DefaultDialog instance. |
Method Summary | |
void |
centerOnScreen()
Center the dialog on the screen. |
protected javax.swing.JRootPane |
createRootPane()
Create a special root pane that enforces the minimum size of the dialog if the constructor 'autoSize' parameter was set to true. |
static java.awt.Frame |
findFrame(java.awt.Component component)
Given a component in the UI hierarchy, search through the parentage to find the owning Frame. |
java.lang.String |
getBoundsAsString()
|
boolean |
isAutoCenter()
Returns the auto-centering state of the dialog (default is true). |
void |
setAutoCenter(boolean autoCenter)
Changes the auto-centering state of the dialog (by default is 'true'). |
void |
setBoundsAsString(java.lang.String location)
|
void |
setCancelButton(javax.swing.JButton cancelButton)
Set the button to press on the "cancel" action, and automatically wire it to the VK_ESCAPE key. |
void |
setDefaultButton(javax.swing.JButton defaultButton)
Set the default button, ensure that no other buttons are default capable, and map the enter key to trigger the default action on JTextField instances. |
void |
setHelpButton(javax.swing.JButton helpButton)
Set the button to press on the "help" action, and automatically wire it to the VK_F1 key. |
void |
show()
Override to enforce any automatic centering on screen as requested. |
static boolean |
showModalDialog(java.awt.Component owner,
java.lang.String title,
javax.swing.JComponent component,
com.borland.primetime.help.HelpTopic helpTopic)
Displays a standard dialog including OK, Cancel and Help buttons below a single user-supplied component. |
static boolean |
showModalDialog(java.awt.Component owner,
java.lang.String title,
javax.swing.JComponent component,
com.borland.primetime.help.HelpTopic helpTopic,
DialogValidator validator)
Displays a standard dialog including OK, Cancel and Help buttons below a single user-supplied component. |
static void |
showSimpleModalDialog(java.awt.Component owner,
java.lang.String title,
javax.swing.JComponent component,
com.borland.primetime.help.HelpTopic helpTopic)
Displays a standard dialog including OK and Help buttons but no Cancel button below a single user-supplied component. |
Methods inherited from class javax.swing.JDialog |
addImpl, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle |
Methods inherited from class java.awt.Window |
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFont, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DefaultDialog(java.awt.Component owner, java.lang.String title, boolean modal)
Creates a new DefaultDialog instance that automatically determines its size basd on the size of its contents. The caller is responsible for adding content to the dialog, and should call the methods setCancelButton, setDefaultButton, and/or setHelpButton as appropriate before showing the dialog.
owner
- Any component on the owning frame or dialogtitle
- The dialog's titlemodal
- True to create a modal dialog, false otherwisepublic DefaultDialog(java.awt.Component owner, java.lang.String title, boolean modal, boolean autoSize)
owner
- Any component on the owning frame or dialogtitle
- The dialog's titlemodal
- True to create a modal dialog, false otherwiseautoSize
- True if the dialog determines its size based on the size
of its contents, false if the size will be set explicitly.Method Detail |
public java.lang.String getBoundsAsString()
public void setBoundsAsString(java.lang.String location)
public void setAutoCenter(boolean autoCenter)
autoCenter
- True for auto-centering, false for standard dialog
behavior.public boolean isAutoCenter()
public void centerOnScreen()
public void setDefaultButton(javax.swing.JButton defaultButton)
defaultButton
- The default button.public void setCancelButton(javax.swing.JButton cancelButton)
cancelButton
- The cancel button.public void setHelpButton(javax.swing.JButton helpButton)
helpButton
- The help button.public static boolean showModalDialog(java.awt.Component owner, java.lang.String title, javax.swing.JComponent component, com.borland.primetime.help.HelpTopic helpTopic)
frame
- owner Any component on the owning frame or dialogtitle
- The caption displayed in the dialog's title barcomponent
- The contents of the dialoghelpTopic
- The helpTopic to call for this dialogpublic static boolean showModalDialog(java.awt.Component owner, java.lang.String title, javax.swing.JComponent component, com.borland.primetime.help.HelpTopic helpTopic, DialogValidator validator)
frame
- owner Any component on the owning frame or dialogtitle
- The caption displayed in the dialog's title barcomponent
- The contents of the dialogvalidator
- An implementation of DialogValiator for validating the
contents of the dialog, or null if no validation is neededpublic static void showSimpleModalDialog(java.awt.Component owner, java.lang.String title, javax.swing.JComponent component, com.borland.primetime.help.HelpTopic helpTopic)
frame
- owner Any component on the owning frame or dialogtitle
- The caption displayed in the dialog's title barcomponent
- The contents of the dialoghelpTopic
- The helpTopic to call for this dialogpublic static java.awt.Frame findFrame(java.awt.Component component)
component
- Starting component for find.protected javax.swing.JRootPane createRootPane()
createRootPane
in class javax.swing.JDialog
public void show()
show
in class java.awt.Dialog
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |