|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.gui.GUIUtilities
public class GUIUtilities
A collection of utilities for the GUI.
Field Summary | |
---|---|
static String |
ACCELERATOR_KEY
JDK1.2 doesn't have this string defined in javax.swing.Action. |
static String |
LARGE_ICON
This key is used in an action to specify an icon used in toolbars. |
static String |
MNEMONIC_KEY
JDK1.2 doesn't have this string defined in javax.swing.Action. |
Constructor Summary | |
---|---|
GUIUtilities()
|
Method Summary | |
---|---|
static void |
addHotKey(JComponent pane,
Action action)
Add a quick keystroke on the given pane for the given action. |
static void |
addHotKey(JComponent pane,
Action action,
KeyStroke key)
Add a quick keystroke on the given pane for the given action. |
static JMenuItem |
addMenuItem(JMenu menu,
Action action)
Add an action to a menu and return the menu item created. |
static JMenuItem |
addMenuItem(JMenu menu,
Action action,
int mnemonic,
String tooltip)
Add an action to a menu and return the menu item created. |
static JMenuItem |
addMenuItem(JMenu menu,
String label,
Action action,
int mnemonic,
String tooltip,
boolean isEnabled)
Add an action to a menu and return the menu item created. |
static JButton |
addToolBarButton(JToolBar toolbar,
Action action)
Add the action to the given toolbar. |
static JButton |
addToolBarButton(JToolBar toolbar,
Action action,
String tooltip,
Icon icon)
Add an action to the toolbar. |
static JButton |
addToolBarButton(JToolBar toolbar,
Action action,
String tooltip,
Icon icon,
boolean isEnabled)
Add an action to the toolbar. |
static JButton |
addToolBarButton(JToolBar toolbar,
Action action,
String tooltip,
Icon icon,
String lbl)
Add an action to the toolbar. |
static JButton |
addToolBarButton(JToolBar toolbar,
Action action,
String tooltip,
Icon icon,
String lbl,
boolean isEnabled)
Add an action to the toolbar. |
static JButton |
addToolBarButton(JToolBar toolbar,
Action action,
String tooltip,
String lbl)
Add an action to the toolbar. |
static String |
ellipsis(String string,
int length)
Return a string that contains the original string, limited to the given number of characters. |
static String |
getFileExtension(File file)
Get the extension of a file. |
static String |
keyStrokeToString(KeyStroke key)
Return a good string representation of the given keystroke, since the toString method returns more garbage than we want to see in a user interface. |
static void |
showException(Component parent,
Exception e,
String info)
Display an exception in a nice user-oriented way. |
static void |
showStackTrace(Component parent,
Exception e)
Display a stack trace dialog. |
static void |
showStackTrace(Component parent,
Exception e,
String info)
Display a stack trace dialog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ACCELERATOR_KEY
public static final String MNEMONIC_KEY
public static final String LARGE_ICON
Constructor Detail |
---|
public GUIUtilities()
Method Detail |
---|
public static void addHotKey(JComponent pane, Action action)
public static void addHotKey(JComponent pane, Action action, KeyStroke key)
public static JMenuItem addMenuItem(JMenu menu, Action action)
public static JMenuItem addMenuItem(JMenu menu, Action action, int mnemonic, String tooltip)
public static JMenuItem addMenuItem(JMenu menu, String label, Action action, int mnemonic, String tooltip, boolean isEnabled)
public static JButton addToolBarButton(JToolBar toolbar, Action action)
public static JButton addToolBarButton(JToolBar toolbar, Action action, String tooltip, Icon icon)
public static JButton addToolBarButton(JToolBar toolbar, Action action, String tooltip, Icon icon, boolean isEnabled)
public static JButton addToolBarButton(JToolBar toolbar, Action action, String tooltip, String lbl)
public static JButton addToolBarButton(JToolBar toolbar, Action action, String tooltip, Icon icon, String lbl)
public static JButton addToolBarButton(JToolBar toolbar, Action action, String tooltip, Icon icon, String lbl, boolean isEnabled)
public static String ellipsis(String string, int length)
public static String getFileExtension(File file)
public static String keyStrokeToString(KeyStroke key)
public static void showException(Component parent, Exception e, String info)
public static void showStackTrace(Component parent, Exception e)
public static void showStackTrace(Component parent, Exception e, String info)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |