|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jdevimpl.audit.swing.MessageDialog
public class MessageDialog
A modal message dialog based on JOptionPane but with a simpler interface. The myriad of static create and show methods supplied by JOptionPane are replaced by a factory object with mutable properties and a show method.
The properties include the dialog type, the content, and the set of command button labels.
The dialog type is supplied as a constant of class MessageDialog.Type, and determines layout and icon. The types are the following:
ERROR INFORMATION PLAIN No icon. QUESTION WARNING
The content is supplied as Objects. The objects are displayed in a vertical stack in accordance with their type:
Object[] Displayed in a vertical stack in accordance with their type. Component Displayed as supplied. Icon Displayed in a JLabel. <other> Displayed using its toString() in a JLabel.
The contents can be supplied in one call through setContent
or piecemeal through addContent
.
The commands are specified as an array of Object
s, where the object can be either a String or a Component. Components (usually buttons) are placed in the dialog directly; for each string, a button is created and placed with the string as the text.
The show
method indicates the command chosen by the user by returning the corresponding string or component. It returns null
if the user closed the dialog without choosing a command.
Nested Class Summary | |
---|---|
protected static class |
MessageDialog.OptionPane |
static class |
MessageDialog.Type |
Field Summary | |
---|---|
static MessageDialog.Type |
ERROR |
static MessageDialog.Type |
INFORMATION |
static MessageDialog.Type |
PLAIN |
static MessageDialog.Type |
QUESTION |
static MessageDialog.Type |
WARNING |
Constructor Summary | |
---|---|
MessageDialog() Creates an option dialog. |
|
MessageDialog(MessageDialog.Type type) Creates an option dialog of a specific type. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event) Handle the action performed event for a command supplied as a JButton. |
void |
addContent(java.lang.Object content) Adds content to the 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) |
void |
setCommands(java.lang.Object command) Sets the command of the dialog. |
void |
setCommands(java.lang.Object[] commands) Sets the commands of the dialog. |
void |
setCommands(java.lang.Object command1, java.lang.Object command2) Sets the two commands of the dialog. |
void |
setContent(java.lang.Object content) Sets the content of the dialog. |
void |
setResizeable(boolean resizeable) Sets whether the dialog is resizeable. |
void |
setTitle(java.lang.String title) Sets the title of the dialog. |
void |
setType(MessageDialog.Type type) Sets the type of the dialog. |
java.lang.Object |
show() Show the dialog with a default parent. |
java.lang.Object |
show(java.awt.Component parent) Show the dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final MessageDialog.Type ERROR
public static final MessageDialog.Type INFORMATION
public static final MessageDialog.Type PLAIN
public static final MessageDialog.Type QUESTION
public static final MessageDialog.Type WARNING
Constructor Detail |
---|
public MessageDialog()
public MessageDialog(MessageDialog.Type type)
type
- The type of the message, one of the following MessageDialog.Type constants:
ERROR
INFORMATION
PLAIN
No icon.QUESTION
WARNING
setType(oracle.jdevimpl.audit.swing.MessageDialog.Type)
Method Detail |
---|
public void addContent(java.lang.Object content)
content
- The content to be added to the dialog box.public void setCommands(java.lang.Object[] commands)
commands
- The command names or components.public void setCommands(java.lang.Object command)
setCommands(Object[])
.command
- The command name or component.setCommands(java.lang.Object[])
public void setCommands(java.lang.Object command1, java.lang.Object command2)
setCommands(Object[])
.command1
- The first command name or component.command2
- The second command name or component.setCommands(java.lang.Object[])
public void setContent(java.lang.Object content)
content
- The content to be placed in the dialog box.public void setResizeable(boolean resizeable)
public void setTitle(java.lang.String title)
title
- The title of the dialog.public void setType(MessageDialog.Type type)
type
- The type of the message, one of the following MessageDialog.Type constants:
ERROR
INFORMATION
PLAIN
No icon.QUESTION
WARNING
public java.lang.Object show()
public java.lang.Object show(java.awt.Component parent)
parent
- The parent component of this dialog.public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
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
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |