|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdevimpl.audit.swing.DialogFactory
public class DialogFactory
A factory for dialogs.
The client must supply the content and, usually, the command buttons. If no button is supplied, a Close button is displayed.
The content is supplied as a Component using the setContent(java.awt.Component)
method.
Command buttons are supplied as JButtons using the add button methods:
Apply, Cancel, Close, or Ok buttons are added with the addApplyButton(javax.swing.JButton)
,
addCancelButton(javax.swing.JButton)
, addCloseButton(javax.swing.JButton)
, and addOkButton(javax.swing.JButton)
methods, respectively. Adding a null button causes an appropriate default
button to be created. The Cancel and Close buttons are mutually exclusive.
The dialog dismisses itself when Cancel, Close, or Apply are clicked.
The buttons are placed as appropriate for the look and feel.
Custom command buttons are added with the addCustomButton(javax.swing.JButton)
method.
These buttons are placed as appropriate for the look and feel, in the order
in which they are added. To have a custom button dismiss the dialog, the
client can use setTerminatingButton(javax.swing.JButton)
; to otherwise respond to the
button, the client must add itself as an ActionListener
to the button
directly.
A Help button is added by setting a help topic string using setHelpTopic(java.lang.String)
.
The show
method returns the terminating button clicked by
the user, or null if the user closed the dialog without choosing a button
(i.e., by using the window close box).
Constructor Summary | |
---|---|
DialogFactory()
Creates a dialog. |
Method Summary | |
---|---|
javax.swing.JButton |
addApplyAction(java.awt.event.ActionListener action)
Adds a default apply button with a custom action to this dialog. |
javax.swing.JButton |
addApplyButton(javax.swing.JButton button)
Adds the apply button to this dialog. |
javax.swing.JButton |
addCancelAction(java.awt.event.ActionListener action)
Adds a default cancel button with a custom action to this dialog. |
javax.swing.JButton |
addCancelButton(javax.swing.JButton button)
Adds the cancel button to this dialog. |
javax.swing.JButton |
addCloseAction(java.awt.event.ActionListener action)
Adds a default close button with a custom action to this dialog. |
javax.swing.JButton |
addCloseButton(javax.swing.JButton button)
Adds a close button to this dialog. |
javax.swing.JButton |
addCustomButton(javax.swing.JButton button)
Adds a custom button to this dialog. |
javax.swing.JButton |
addOkAction(java.awt.event.ActionListener action)
Adds a default ok button with a custom action to this dialog. |
javax.swing.JButton |
addOkButton(javax.swing.JButton button)
Adds an ok button to this dialog. |
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
|
void |
componentShown(java.awt.event.ComponentEvent e)
|
javax.swing.JButton |
getApplyButton()
Gets the apply button, or null if none. |
javax.swing.JButton |
getCancelButton()
Gets the cancel button, or null if none. |
javax.swing.JButton |
getCloseButton()
Gets the close button, or null if none. |
javax.swing.JButton |
getHelpButton()
Gets the help button, or null if none. |
javax.swing.JButton |
getOkButton()
Gets the ok button, or null if none. |
void |
hide()
Hides the dialog. |
void |
setContent(java.awt.Component content)
Sets the content of the dialog. |
void |
setDefaultButton(javax.swing.JButton button)
Sets the default button of the dialog. |
void |
setDefaultCloseButtonIgnored(boolean ignored)
Sets whether to ignore the default (title bar) close button. |
void |
setDescription(java.lang.String description)
Sets the description text for this dialog. |
void |
setExpansionFactor(float factor)
Sets the expansion factor of the contents of this dialog. |
void |
setHelpTopic(java.lang.String topic)
Sets the help topic for and adds the help button to this dialog. |
void |
setInitialFocus(java.awt.Component component)
Sets the component which should get the initial focus. |
void |
setLocationRelativeTo(javax.swing.JDialog dialog,
java.awt.Component c)
|
void |
setModal(boolean modal)
Sets whether the dialog is modal. |
void |
setResizable(boolean resizable)
Sets whether the dialog is resizable. |
void |
setTerminatingButton(javax.swing.JButton button)
Sets a custom button to be a terminating button. |
void |
setTitle(java.lang.String title)
Sets the title of this dialog. |
javax.swing.JButton |
show()
Show the dialog with a default parent. |
javax.swing.JButton |
show(java.awt.Component parent)
Show the dialog. |
void |
windowActivated(java.awt.event.WindowEvent e)
|
void |
windowClosed(java.awt.event.WindowEvent e)
|
void |
windowClosing(java.awt.event.WindowEvent e)
|
void |
windowDeactivated(java.awt.event.WindowEvent e)
|
void |
windowDeiconified(java.awt.event.WindowEvent e)
|
void |
windowIconified(java.awt.event.WindowEvent e)
|
void |
windowOpened(java.awt.event.WindowEvent e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DialogFactory()
Method Detail |
---|
public javax.swing.JButton addApplyButton(javax.swing.JButton button)
addApplyAction(java.awt.event.ActionListener)
to add a custom action.
button
- The customized apply button, or null to create a default
apply button.
public javax.swing.JButton addApplyAction(java.awt.event.ActionListener action)
addApplyButton(javax.swing.JButton)
.
action
- The action to add to the button.
public javax.swing.JButton addCancelButton(javax.swing.JButton button)
addCancelAction(java.awt.event.ActionListener)
to add a custom action.
A cancel button cannot be added if a close button has been added.
button
- The customized cancel button, or null to create a default
cancel button.
java.lang.IllegalStateException
- if a close button has been added.public javax.swing.JButton addCancelAction(java.awt.event.ActionListener action)
hide()
method to dismiss the dialog. This method may,
but need not, be used in conjunction with addCancelButton(javax.swing.JButton)
.
action
- The action to add to the button.
public javax.swing.JButton addCloseButton(javax.swing.JButton button)
addCloseAction(java.awt.event.ActionListener)
to add a custom action.
A close button cannot be added if a cancel button has been added.
button
- The customized close button, or null to create a default
close button.
java.lang.IllegalStateException
- if a cancel button has been added.public javax.swing.JButton addCloseAction(java.awt.event.ActionListener action)
hide()
method to dismiss the dialog. This method may, but
need not, be used in conjunction with addCloseButton(javax.swing.JButton)
.
action
- The action to add to the button.
public javax.swing.JButton addCustomButton(javax.swing.JButton button)
setTerminatingButton(javax.swing.JButton)
for a custom button to make it dismiss the dialog.
button
- The button to add.
public javax.swing.JButton addOkButton(javax.swing.JButton button)
addOkAction(java.awt.event.ActionListener)
to add a custom action.
button
- The customized ok button, or null to create a default
ok button.
public javax.swing.JButton addOkAction(java.awt.event.ActionListener action)
hide()
method to dismiss the dialog. This method may, but
need not, be used in conjunction with addOkButton(javax.swing.JButton)
.
action
- The action to add to the button.
public javax.swing.JButton getApplyButton()
public javax.swing.JButton getCancelButton()
public javax.swing.JButton getCloseButton()
public javax.swing.JButton getHelpButton()
public javax.swing.JButton getOkButton()
public void hide()
public void setContent(java.awt.Component content)
content
- The component to be placed in the dialog box.public void setDefaultCloseButtonIgnored(boolean ignored)
public void setDefaultButton(javax.swing.JButton button)
button
- The default button for the dialog, or null if none.
java.lang.IllegalArgumentException
- if the button is in this dialog.addCustomButton(javax.swing.JButton)
,
addApplyButton(javax.swing.JButton)
,
addCancelButton(javax.swing.JButton)
,
addCloseButton(javax.swing.JButton)
,
addOkButton(javax.swing.JButton)
public void setDescription(java.lang.String description)
description
- Text describing this dialog.public void setExpansionFactor(float factor)
public void setInitialFocus(java.awt.Component component)
public void setHelpTopic(java.lang.String topic)
topic
- The OHJ help topic identifier for this dialog.public void setResizable(boolean resizable)
public void setModal(boolean modal)
public void setTerminatingButton(javax.swing.JButton button)
button
- A button for the dialog, or null if none.
java.lang.IllegalArgumentException
- if the button is not a custom
button of this dialog.addCustomButton(javax.swing.JButton)
public void setTitle(java.lang.String title)
title
- The title of this dialog.public javax.swing.JButton show()
public javax.swing.JButton show(java.awt.Component parent)
parent
- The parent component of this dialog.
public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener
public void windowActivated(java.awt.event.WindowEvent e)
windowActivated
in interface java.awt.event.WindowListener
public void windowClosed(java.awt.event.WindowEvent e)
windowClosed
in interface java.awt.event.WindowListener
public void windowClosing(java.awt.event.WindowEvent e)
windowClosing
in interface java.awt.event.WindowListener
public void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated
in interface java.awt.event.WindowListener
public void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified
in interface java.awt.event.WindowListener
public void windowIconified(java.awt.event.WindowEvent e)
windowIconified
in interface java.awt.event.WindowListener
public void windowOpened(java.awt.event.WindowEvent e)
windowOpened
in interface java.awt.event.WindowListener
public void setLocationRelativeTo(javax.swing.JDialog dialog, java.awt.Component c)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.6.0) E13403-07 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |