|
Oracle JEWT API Reference Release 4.2.24.0.0 B12199-01 |
||||||||
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 | +--oracle.bali.ewt.dialog.JEWTDialog
JEWTDialog is a JDialog subclass that contains the properly look for the OracleLookAndFeel. JEWTDialog will also look correct in other LookAndFeels.
JEWTDialog will display buttons at the bottom of the dialog like OK, cancel, close, help and apply, as well as the contents of the dialog above the buttons with the correct insets as determined by Oracle's User Interface team.Cancel and Close buttons are exclusive.
To set the buttons that are visible call setButtonMask() and use a bit mask of the BUTTON_* constants. Use of the BUTTON_CANCEL and BUTTON_CLOSE constants at the same time is NOT supported.
To set the contents of the JEWTDialog use setContent().
To display the dialog call runDialog(). runDialog() will return true if the dialog was closed by pressing ok and false otherwise.
Users can add custom buttons that will be displayed in the button area by calling addCustomButton().
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 |
Field Summary | |
static java.lang.String |
ACTION_APPLY
ActionEvent command that is sent when the apply button is pressed. |
static int |
BUTTON_APPLY
Constant representing the apply button. |
static int |
BUTTON_CANCEL
Constant representing the cancel button. |
static int |
BUTTON_CLOSE
Constant representing the close button. |
static int |
BUTTON_DEFAULT
Constant representing all default buttons. |
static int |
BUTTON_HELP
Constant representing the help button. |
static int |
BUTTON_NONE
Constant representing no button. |
static int |
BUTTON_OK
Constant representing the OK button. |
static java.lang.String |
PROPERTY_CLOSED
Dialog Closing Property (used in the PropertyChangeEvent) |
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 | |
JEWTDialog()
Creates a modal JEWTDialog with the default title and without a specified Frame owner. |
|
JEWTDialog(java.awt.Dialog owner)
Creates a modal JEWTDialog with the default title with the specifed Dialog as its owner. |
|
JEWTDialog(java.awt.Dialog owner,
java.lang.String title)
Creates a modal JEWTDialog with the specified title and with the specified owner dialog. |
|
JEWTDialog(java.awt.Dialog owner,
java.lang.String title,
int buttonMask)
Creates a modal JEWTDialog with the specified title and with the specified owner dialog. |
|
JEWTDialog(java.awt.Frame owner)
Creates a modal JEWTDialog with the default title with the specifed Frame as its owner. |
|
JEWTDialog(java.awt.Frame owner,
java.lang.String title)
Creates a modal JEWTDialog with the specified title and with the specified owner frame. |
|
JEWTDialog(java.awt.Frame owner,
java.lang.String title,
int buttonMask)
Creates a modal JEWTDialog with the specified title and with the specified owner frame. |
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener listener)
Add an ActionListener to listen for action events from the apply button. |
void |
addCustomButton(java.awt.Component button)
Add a custom button to the button bar. |
void |
addNotify()
Notifies the component that it has been added to a container. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a VetoableChangeListener to the listener list. |
static JEWTDialog |
createDialog(java.awt.Component owner,
java.lang.String title,
int buttonMask)
Use this method to construct a JEWTDialog which automatically parents itself correctly on either a Dialog or Frame. |
protected void |
dialogInit()
Override to init dialog. |
protected void |
dismissDialog(boolean cancelled)
Hides the dialog. |
void |
dispose()
Override to free memory. |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Fire a PropertyChangeEvent for the given propertyName and it's old and new values. |
protected void |
fireVetoableChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
Supports reporting constrained property changes. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Override to fix a bug in JAWS. |
int |
getButtonMask()
The buttonMask, a bitwise or of the button constants |
int |
getButtonMnemonic(int buttonMask)
Return the mnemonic for the given button mask. |
int |
getCancelButtonMnemonic()
Gets the mnemonic of cancel button or -1
if the cancel button is not included in the button mask. |
java.lang.String |
getCancelButtonText()
Gets the caption of cancel button or null
if the cancel button is not included in the button mask. |
java.awt.Component |
getCenterOver()
Returns the component over which the dialog will be centered. |
java.awt.Component |
getContent()
Get the content Component in this dialog. |
java.awt.Component |
getCustomButton(int button)
Get a particular custom button |
int |
getCustomButtonCount()
The number of current custom buttons. |
int |
getDefaultButton()
Get the constant representing the default focused button |
java.awt.Component |
getInitialFocus()
Returns the component that will receive focus initially. |
java.awt.Dimension |
getMaximunInitialSize()
Get the maximum initial size of the JEWTDialog. |
java.awt.Dimension |
getMinimumSize()
Get the minimum size of the JEWTDialog. |
int |
getOKButtonMnemonic()
Gets the mnemonic of ok button or -1
if the ok button is not included in the button mask. |
java.lang.String |
getOKButtonText()
Gets the caption of ok button or null
if the ok button is not included in the button mask. |
java.awt.Dimension |
getPreferredSize()
Get the preferredSize of the JEWTDialog. |
boolean |
isCancelled()
Returns true if the dialog was cancelled from its last run. |
static boolean |
isDialogClosingEvent(java.beans.PropertyChangeEvent evt)
Utility method to determine if the PropertyChangeEvent
is the event used in validation. |
boolean |
isOKButtonEnabled()
Get the enabled state of the OK button |
void |
pack()
Override to fix a bug on Linux. |
protected void |
processActionEvent(java.awt.event.ActionEvent e)
Send action events to all registered listeners. |
protected void |
processComponentEvent(java.awt.event.ComponentEvent e)
Override to not allow resizing smaller than initial size. |
protected void |
processEvent(java.awt.AWTEvent e)
Override to look for ActionEvents. |
protected void |
processWindowEvent(java.awt.event.WindowEvent e)
Processes window events occurring on this window. |
void |
removeActionListener(java.awt.event.ActionListener listener)
Remove an ActionListener. |
void |
removeCustomButton(java.awt.Component button)
Remove a custom button from the button bar. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a VetoableChangeListener from the listener list. |
boolean |
runDialog()
Runs the JEWTDialog until it is either cancelled or finishes succesfully. |
void |
setButtonMask(int mask)
Choose which buttons (OK, Cancel, Close, Help, Apply) to add. |
void |
setCancelButtonMnemonic(int keyCode)
Sets the mnemonic of cancel button. |
void |
setCancelButtonText(java.lang.String translatedText)
Sets the caption of cancel button. |
void |
setCenterOver(java.awt.Component centerOver)
Sets the component over which the dialog will be centered. |
void |
setContent(java.awt.Component content)
Set the content Component in this dialog. |
void |
setDefaultButton(int button)
Sets the default focused button |
void |
setInitialFocus(java.awt.Component initialFocus)
Sets the component that will receive focus initially. |
void |
setMaximumInitialSize(java.awt.Dimension maxInitSize)
Set the maximum initial size of the JEWTDialog. |
void |
setMaximumInitialSize(int width,
int height)
Set the maximum initial size of the JEWTDialog. |
void |
setMinimumSize(java.awt.Dimension minSize)
Set the minimum size of the JEWTDialog. |
void |
setMinimumSize(int width,
int height)
Set the minimum size of the JEWTDialog. |
void |
setOKButtonEnabled(boolean enabled)
Sets the enabled state of the OK button |
void |
setOKButtonMnemonic(int keyCode)
Sets the mnemonic of ok button. |
void |
setOKButtonText(java.lang.String translatedText)
Sets the caption of ok button. |
void |
setPreferredSize(java.awt.Dimension prefSize)
Set the preferredSize of the JEWTDialog. |
void |
setPreferredSize(int width,
int height)
Set the preferredSize of the JEWTDialog. |
Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Dialog |
getTitle, hide, isModal, isResizable, setModal, setResizable, setTitle, show |
Methods inherited from class java.awt.Window |
addWindowListener, applyResourceBundle, applyResourceBundle, finalize, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, postEvent, 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, 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, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, 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 |
Field Detail |
public static final int BUTTON_NONE
public static final int BUTTON_OK
public static final int BUTTON_CANCEL
public static final int BUTTON_HELP
public static final int BUTTON_APPLY
public static final int BUTTON_CLOSE
public static final int BUTTON_DEFAULT
BUTTON_OK
,
BUTTON_CANCEL
,
BUTTON_HELP
public static final java.lang.String PROPERTY_CLOSED
public static final java.lang.String ACTION_APPLY
Constructor Detail |
public JEWTDialog()
public JEWTDialog(java.awt.Frame owner)
owner
- the Frame from which the dialog is displayedpublic JEWTDialog(java.awt.Frame owner, java.lang.String title)
owner
- the Frame from which the dialog is displayedtitle
- the String to display in the dialog's title barpublic JEWTDialog(java.awt.Frame owner, java.lang.String title, int buttonMask)
owner
- the Frame from which the dialog is displayedtitle
- the String to display in the dialog's title barbuttonMask
- bitwise combination of button constantspublic JEWTDialog(java.awt.Dialog owner)
owner
- the Dialog from which the dialog is displayedpublic JEWTDialog(java.awt.Dialog owner, java.lang.String title)
owner
- the Dialog from which the dialog is displayedtitle
- the String to display in the dialog's title barpublic JEWTDialog(java.awt.Dialog owner, java.lang.String title, int buttonMask)
owner
- the Dialog from which the dialog is displayedtitle
- the String to display in the dialog's title barbuttonMask
- bitwise combination of button constantsMethod Detail |
public static JEWTDialog createDialog(java.awt.Component owner, java.lang.String title, int buttonMask)
owner
- The owner component for the dialog. The first Dialog or
Frame ancestor of this component will be used as the parent
of the dialog. If this parameter is null, or none of the
ancestors of owner are Dialogs or Frames, an invisible
frame is used as the parenttitle
- The String to display in the dialog's title barbuttonMask
- bitwise combination of button constantspublic java.awt.Component getCenterOver()
public void setCenterOver(java.awt.Component centerOver)
public boolean isCancelled()
public boolean runDialog()
public void dispose()
dispose
in class java.awt.Dialog
public final void setPreferredSize(java.awt.Dimension prefSize)
public void setPreferredSize(int width, int height)
public final void setMinimumSize(java.awt.Dimension minSize)
public void setMinimumSize(int width, int height)
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class java.awt.Container
public final void setMaximumInitialSize(java.awt.Dimension maxInitSize)
public void setMaximumInitialSize(int width, int height)
public java.awt.Dimension getMaximunInitialSize()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class java.awt.Container
public java.awt.Component getContent()
public void setContent(java.awt.Component content)
public int getButtonMask()
public void setButtonMask(int mask)
mask
- Bitwise or of any of BUTTON_OK, BUTTON_CANCEL,
BUTTON_HELP, BUTTON_APPLY, and BUTTON_CLOSEpublic void addCustomButton(java.awt.Component button)
public void removeCustomButton(java.awt.Component button)
public int getCustomButtonCount()
public java.awt.Component getCustomButton(int button)
public int getDefaultButton()
public void setDefaultButton(int button)
the
- button constantpublic void setOKButtonEnabled(boolean enabled)
public boolean isOKButtonEnabled()
public void setOKButtonText(java.lang.String translatedText)
translatedText
contains an '&' character than
that character will be used as the mnemonic for the button.translatedText
- the text for the button's caption.public java.lang.String getOKButtonText()
null
if the ok button is not included in the button mask.public int getOKButtonMnemonic()
-1
if the ok button is not included in the button mask.public void setOKButtonMnemonic(int keyCode)
keyCode
- the mnemonic keycode of the buttonpublic void setCancelButtonText(java.lang.String translatedText)
translatedText
contains an '&' character than
that character will be used as the mnemonic for the button.translatedText
- the text for the button's caption.public java.lang.String getCancelButtonText()
null
if the cancel button is not included in the button mask.public int getCancelButtonMnemonic()
-1
if the cancel button is not included in the button mask.public void setCancelButtonMnemonic(int keyCode)
keyCode
- the mnemonic keycode of the buttonpublic int getButtonMnemonic(int buttonMask)
buttonMask
- the button mask of the button requestedpublic void addActionListener(java.awt.event.ActionListener listener)
public void removeActionListener(java.awt.event.ActionListener listener)
public void addNotify()
addNotify
in class java.awt.Dialog
public java.awt.Component getInitialFocus()
public void setInitialFocus(java.awt.Component initialFocus)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in class java.awt.Component
listener
- the PropertyChangeListener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in class java.awt.Component
listener
- the PropertyChangeListener to be removedpublic void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- the VetoableChangeListener to be addedpublic void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
listener
- the VetoableChangeListener to be removedpublic static boolean isDialogClosingEvent(java.beans.PropertyChangeEvent evt)
PropertyChangeEvent
is the event used in validation. The property changed when the
dialog is about to close is PROPERTY_CLOSED
. This
follows the behavior of javax.swing.JInternalFrame
.evt
- The change event.true
if this event is the dialog closing.
and false
otherwise.public void pack()
pack
in class java.awt.Window
public javax.accessibility.AccessibleContext getAccessibleContext()
getAccessibleContext
in class javax.swing.JDialog
protected void processComponentEvent(java.awt.event.ComponentEvent e)
processComponentEvent
in class java.awt.Component
protected void dialogInit()
dialogInit
in class javax.swing.JDialog
protected void processWindowEvent(java.awt.event.WindowEvent e)
processWindowEvent
in class javax.swing.JDialog
e
- the window eventprotected void fireVetoableChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue) throws java.beans.PropertyVetoException
java.beans.PropertyVetoException
- when the attempt to set the property is
vetoed by the receiver.protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
firePropertyChange
in class java.awt.Component
protected void dismissDialog(boolean cancelled)
cancelled
- true if the cancel button was pressed, false
if the finish button was pressed.protected void processEvent(java.awt.AWTEvent e)
processEvent
in class java.awt.Window
protected void processActionEvent(java.awt.event.ActionEvent e)
|
Oracle JEWT 4.2.24 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |