| java.lang.Object thinwire.ui.MessageBox
MessageBox | final public class MessageBox (Code) | | 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:
author: Joshua J. Gertzen |
Method Summary | |
public void | close() Close the message box. | public static void | closeCurrent() Closes the current message box. | public static void | confirm(String message) Display a dialog window with an OK button and message.
Sample usage:
MessageBox.confirm("Invalid Return by Time\nInvalid Zip Code");
For multiple line messages, separate the lines with "\n". | public static void | confirm(String title, String message) Display a dialog window with an OK button, title and message.
Sample usage:
MessageBox.confirm("Operator Message",
"Invalid Return by Time\nInvalid Zip Code");
For multiple line messages, separate the lines with "\n". | public static void | confirm(String icon, String title, String message) Display a dialog window with an OK button, icon, title and message.
Sample usage:
MessageBox.confirm("error", "Operator Message",
"Invalid Return by Time\nInvalid Zip Code");
For multiple line messages, separate the lines with "\n". | public static int | confirm(String icon, String title, String message, String buttons) Display a dialog window with specified buttons, message and icons.
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. | public static int | confirm(String icon, String title, Component component, String buttons) Display a dialog window with the specified icon, title,
component, and buttons. | public int | confirm() Make the MessageBox visible, and then block. | public String | getButtons() Returns the string that sets all the buttons for the message box. | public Component | getComponent() Returns the component for the MessageBox. | public String | getIcon() Returns the icon for the message box. | public String | getText() Returns the message in the message box. | public String | getTitle() Returns the title of the MessageBox. | public void | setButtons(String buttons) Sets the buttons based on a string. | public void | setComponent(Component component) Set the component for the MessageBox.
The component will appear in the content panel.
Don't set both a message and a Component. | public void | setIcon(String icon) Set the icon for the MessageBox. | public void | setText(String text) Set the message for the MessageBox.
For multiple line messages, separate the lines with "\n".
Don't set both a message and a Component. | public void | setTitle(String title) Set the title for the MessageBox. | public static void | show(String message) Display a dialog window without buttons.
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". | public static void | show(String title, String message) Display a dialog window without buttons.
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". | public static void | show(String icon, String title, String message) Display a dialog window without buttons.
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". | public void | show() Makes the MessageBox visible. |
close | public void close()(Code) | | Close the message box.
|
closeCurrent | public static void closeCurrent()(Code) | | Closes the current message box.
|
confirm | public static void confirm(String message)(Code) | | Display a dialog window with an OK button and message.
Sample usage:
MessageBox.confirm("Invalid Return by Time\nInvalid Zip Code");
For multiple line messages, separate the lines with "\n".
Parameters: message - The dialog message, a \n separated sequence of lines. |
confirm | public static void confirm(String title, String message)(Code) | | Display a dialog window with an OK button, title and message.
Sample usage:
MessageBox.confirm("Operator Message",
"Invalid Return by Time\nInvalid Zip Code");
For multiple line messages, separate the lines with "\n".
Parameters: title - the dialog title Parameters: message - The dialog message, a \n separated sequence of lines. |
confirm | public static void confirm(String icon, String title, String message)(Code) | | Display a dialog window with an OK button, icon, title and message.
Sample usage:
MessageBox.confirm("error", "Operator Message",
"Invalid Return by Time\nInvalid Zip Code");
For multiple line messages, separate the lines with "\n".
Parameters: icon - name of the image file without path info or file extension. Parameters: title - the dialog title Parameters: message - The dialog message, a \n separated sequence of lines. |
confirm | public static int confirm(String icon, String title, String message, String buttons)(Code) | | Display a dialog window with specified buttons, message and icons.
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.
Parameters: icon - The dialog's icon. Parameters: title - The dialog's title. Parameters: message - The dialog's message. Parameters: buttons - specifies what text and icon each button will have the clicked button's return value |
confirm | public static int confirm(String icon, String title, Component component, String buttons)(Code) | | Display a dialog window with the specified icon, title,
component, and buttons.
Parameters: icon - the name of the icon, optional Parameters: title - the MessageBox title Parameters: component - the Component for the content panel. Parameters: buttons - a string specifying the buttons the clicked button's return value |
confirm | public int confirm()(Code) | | Make the MessageBox visible, and then block.
the clicked button's return value |
getButtons | public String getButtons()(Code) | | Returns the string that sets all the buttons for the message box.
the string describing this MessageBox's buttons |
getComponent | public Component getComponent()(Code) | | Returns the component for the MessageBox.
a Component |
getIcon | public String getIcon()(Code) | | Returns the icon for the message box.
the name for the icon for the MessageBox |
getText | public String getText()(Code) | | Returns the message in the message box.
the message in this MessageBox |
getTitle | public String getTitle()(Code) | | Returns the title of the MessageBox.
the title of this MessageBox |
setButtons | public void setButtons(String buttons)(Code) | | Sets the buttons based on a string.
Example:
currentMB.setButtons("Delete;ERASE|Activate;STAR|Cancel;CANCEL");
Parameters: buttons - a String describing the buttons |
setComponent | public void setComponent(Component component)(Code) | | Set the component for the MessageBox.
The component will appear in the content panel.
Don't set both a message and a Component.
Parameters: component - the content for the MessageBox. |
setIcon | public void setIcon(String icon)(Code) | | Set the icon for the MessageBox. It appears in the
top left corner.
Parameters: icon - name of the icon |
setText | public void setText(String text)(Code) | | Set the message for the MessageBox.
For multiple line messages, separate the lines with "\n".
Don't set both a message and a Component.
Parameters: text - the message |
setTitle | public void setTitle(String title)(Code) | | Set the title for the MessageBox.
Parameters: title - the MessageBox title |
show | public static void show(String message)(Code) | | Display a dialog window without buttons.
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".
Parameters: message - The dialog message, a \n separated sequence of lines. |
show | public static void show(String title, String message)(Code) | | Display a dialog window without buttons.
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".
Parameters: title - the dialog title Parameters: message - The dialog message, a \n separated sequence of lines. |
show | public static void show(String icon, String title, String message)(Code) | | Display a dialog window without buttons.
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".
Parameters: icon - name of the image file without path info or file extension. Parameters: title - the dialog title Parameters: message - The dialog message, a \n separated sequence of lines. |
show | public void show()(Code) | | Makes the MessageBox visible.
Adds the MessageBox to the MessageBox stack on the application
instance.
This method is non-blocking.
|
|
|