|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object thinwire.ui.MessageBox
public final class MessageBox
A MessageBox
displays a message (or a component) and allows a
user to respond.
Example:
MessageBox.confirm("resources/ngLF/info.png", "ThinWire", "Get ready for ThinWire");
Keyboard Navigation:
KEY | RESPONSE | NOTE |
Constructor Summary | |
---|---|
MessageBox()
|
Method Summary | |
---|---|
void |
close()
Close the message box. |
static void |
closeCurrent()
Closes the current message box. |
int |
confirm()
Make the MessageBox visible, and then block. |
static void |
confirm(java.lang.String message)
Display a dialog window with an OK button and message. |
static void |
confirm(java.lang.String title,
java.lang.String message)
Display a dialog window with an OK button, title and message. |
static int |
confirm(java.lang.String icon,
java.lang.String title,
Component component,
java.lang.String buttons)
Display a dialog window with the specified icon, title, component, and buttons. |
static void |
confirm(java.lang.String icon,
java.lang.String title,
java.lang.String message)
Display a dialog window with an OK button, icon, title and message. |
static int |
confirm(java.lang.String icon,
java.lang.String title,
java.lang.String message,
java.lang.String buttons)
Display a dialog window with specified buttons, message and icons. |
java.lang.String |
getButtons()
Returns the string that sets all the buttons for the message box. |
Component |
getComponent()
Returns the component for the MessageBox. |
java.lang.String |
getIcon()
Returns the icon for the message box. |
java.lang.String |
getText()
Returns the message in the message box. |
java.lang.String |
getTitle()
Returns the title of the MessageBox. |
void |
setButtons(java.lang.String buttons)
Sets the buttons based on a string. |
void |
setComponent(Component component)
Set the component for the MessageBox. |
void |
setIcon(java.lang.String icon)
Set the icon for the MessageBox. |
void |
setText(java.lang.String text)
Set the message for the MessageBox. |
void |
setTitle(java.lang.String title)
Set the title for the MessageBox. |
void |
show()
Makes the MessageBox visible. |
static void |
show(java.lang.String message)
Display a dialog window without buttons. |
static void |
show(java.lang.String title,
java.lang.String message)
Display a dialog window without buttons. |
static void |
show(java.lang.String icon,
java.lang.String title,
java.lang.String message)
Display a dialog window without buttons. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageBox()
Method Detail |
---|
public static void show(java.lang.String message)
Adds the MessageBox to the MessageBox stack on the application
instance.
This method will not block.
For multiple line messages, separate the lines with "\n".
message
- The dialog message, a \n separated sequence of lines.public static void show(java.lang.String title, java.lang.String message)
Adds the MessageBox to the MessageBox stack on the application
instance.
This method will not block.
For multiple line messages, separate the lines with "\n".
title
- the dialog titlemessage
- The dialog message, a \n separated sequence of lines.public static void show(java.lang.String icon, java.lang.String title, java.lang.String message)
Adds the MessageBox to the MessageBox stack on the application
instance.
This method will not block.
For multiple line messages, separate the lines with "\n".
icon
- name of the image file without path info or file extension.title
- the dialog titlemessage
- The dialog message, a \n separated sequence of lines.public static void confirm(java.lang.String message)
Sample usage:
MessageBox.confirm("Invalid Return by Time\nInvalid Zip Code");For multiple line messages, separate the lines with "\n".
message
- The dialog message, a \n separated sequence of lines.public static void confirm(java.lang.String title, java.lang.String message)
Sample usage:
MessageBox.confirm("Operator Message", "Invalid Return by Time\nInvalid Zip Code");For multiple line messages, separate the lines with "\n".
title
- the dialog titlemessage
- The dialog message, a \n separated sequence of lines.public static void confirm(java.lang.String icon, java.lang.String title, java.lang.String message)
Sample usage:
MessageBox.confirm("error", "Operator Message", "Invalid Return by Time\nInvalid Zip Code");For multiple line messages, separate the lines with "\n".
icon
- name of the image file without path info or file extension.title
- the dialog titlemessage
- The dialog message, a \n separated sequence of lines.public static int confirm(java.lang.String icon, java.lang.String title, java.lang.String message, java.lang.String buttons)
Sample usage:
MessageBox.confirm("question", "Operator Message", "Would you like to shut down the server?", "text1;image1|text2,image2");For multiple line messages, separate the lines with "\n".
The buttons string should specify text and optionally an image for each button.
Use a semi-colon to separate the text and image for a button, and a
pipe to separate one button's info from that of the next.
e.g. "text1;image1|text2;image2|......|textk;imagek"
The buttons string can also specify int return values for the buttons.
e.g. "text1;image1;5|text2;image2;17|......|textK;imageK;27"
Warning: Give all of the buttons return values or none of them. If you don't specify return values, a button's return value will depend on the order in which it is added to the dialog. Also, return values must be integers greater than or equal to 0.
icon
- The dialog's icon.title
- The dialog's title.message
- The dialog's message.buttons
- specifies what text and icon each button will have
public static int confirm(java.lang.String icon, java.lang.String title, Component component, java.lang.String buttons)
icon
- the name of the icon, optionaltitle
- the MessageBox titlecomponent
- the Component for the content panel.buttons
- a string specifying the buttons
public static void closeCurrent()
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- the MessageBox titlepublic java.lang.String getText()
public void setText(java.lang.String text)
For multiple line messages, separate the lines with "\n".
Don't set both a message and a Component.
text
- the messagepublic Component getComponent()
public void setComponent(Component component)
The component will appear in the content panel.
Don't set both a message and a Component.
component
- the content for the MessageBox.public java.lang.String getIcon()
public void setIcon(java.lang.String icon)
icon
- name of the iconpublic java.lang.String getButtons()
public void setButtons(java.lang.String buttons)
currentMB.setButtons("Delete;ERASE|Activate;STAR|Cancel;CANCEL");
buttons
- a String describing the buttonspublic void show()
Adds the MessageBox to the MessageBox stack on the application instance.
This method is non-blocking.
public int confirm()
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |