|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.freeshell.zs.common.SwingManipulator
public class SwingManipulator
Perform Swing-related operations.
| Constructor Summary | |
|---|---|
SwingManipulator()
|
|
| Method Summary | |
|---|---|
static void |
addStandardEditingPopupMenu(javax.swing.text.JTextComponent[] fields)
Add a standard editing popup menu (Cut, Copy, Paste, Select All) to the specified text fields. |
static char[] |
getPasswordJPasswordField(javax.swing.JPasswordField f)
Wrapper for the getPassword() method of a JPasswordField that always returns a char array. |
static java.lang.String |
getTextJTextField(javax.swing.JTextField f)
Wrapper for the getText() method of a JTextField that always returns a String. |
static void |
showErrorDialog(java.awt.Component parent,
java.lang.String title,
java.lang.String message)
Display a modal error dialog. |
static void |
showInfoDialog(java.awt.Component parent,
java.lang.String title,
java.lang.String label,
java.lang.String message,
int rows)
Display a modal information dialog. |
static int |
showOptionTextDialog(java.awt.Component parentComponent,
java.lang.String label,
java.lang.String text,
int rows,
java.lang.String title,
int optionType,
int messageType,
javax.swing.Icon icon,
java.lang.Object[] options,
int initialValue)
Convenience method to display a JOptionPane option dialog with a label and text area. |
static void |
showWarningDialog(java.awt.Component parent,
java.lang.String title,
java.lang.String message)
Display a modal warning dialog. |
static void |
updateLabel(javax.swing.JLabel label,
java.lang.String text)
Update label. |
static void |
updateProgressBar(javax.swing.JProgressBar progress,
java.lang.String text,
int percent)
Update progress bar. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SwingManipulator()
| Method Detail |
|---|
public static void addStandardEditingPopupMenu(javax.swing.text.JTextComponent[] fields)
fields - array of JTextField's for which to add the popup menupublic static java.lang.String getTextJTextField(javax.swing.JTextField f)
f - JTextField object on which to call getText()
public static char[] getPasswordJPasswordField(javax.swing.JPasswordField f)
f - JPasswordField object on which to call getPassword()
public static void updateProgressBar(javax.swing.JProgressBar progress,
java.lang.String text,
int percent)
progress - JProgressBar object to be updatedtext - Text string to be shown on the progress barpercent - Percentage of the task completed (if less than 0 or more than 100,
then indeterminate mode is used)
public static void updateLabel(javax.swing.JLabel label,
java.lang.String text)
label - JLabel object to be updated
public static int showOptionTextDialog(java.awt.Component parentComponent,
java.lang.String label,
java.lang.String text,
int rows,
java.lang.String title,
int optionType,
int messageType,
javax.swing.Icon icon,
java.lang.Object[] options,
int initialValue)
throws java.awt.HeadlessException
parentComponent - Frame in which the dialog is to be displayed; if null, or if the
parentComponent has no Frame, then a default Frame is usedlabel - Label String to be displayedtext - Text String to be displayed in the text arearows - Height of the text area in number of rowstitle - Title String for the dialogoptionType - Options available for the dialog: JOptionPane.DEFAULT_OPTION,
YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTIONmessageType - Type of message; primarily used to determine the icon from the
pluggable Look and Feel: JOptionPane.ERROR_MESSAGE,
INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE,
or PLAIN_MESSAGEicon - Icon to be displayedObject[] - options
Array of objects indicating the possible choices the user can make;
if the objects are components, they are rendered properly;
non-String objects are rendered using their toString methods;
if this parameter is null, the options are determined by the
Look and FeelinitialValue - Index of the default selection for the dialog; meaningful
only if options is used; ignored if negative
java.awt.HeadlessException
public static void showErrorDialog(java.awt.Component parent,
java.lang.String title,
java.lang.String message)
parent - Parent component of this dialogtitle - Title of dialogmessage - Error message to be displayed
public static void showWarningDialog(java.awt.Component parent,
java.lang.String title,
java.lang.String message)
parent - Parent component of this dialogtitle - Title of dialogmessage - Warning message to be displayed
public static void showInfoDialog(java.awt.Component parent,
java.lang.String title,
java.lang.String label,
java.lang.String message,
int rows)
parent - Parent component of this dialogtitle - Title of dialoglabel - Label string to be displayedmessage - Information message to be displayedrows - Height of the text area in number of rows
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||