edu.rice.cs.util.swing
Class Utilities

java.lang.Object
  extended by edu.rice.cs.util.swing.Utilities

public class Utilities
extends Object


Field Summary
static String JGOODIES_PACKAGE
           
static boolean TEST_MODE
          True if the program is run in non-interactive test mode.
 
Constructor Summary
Utilities()
           
 
Method Summary
static void clearEventQueue()
           
static AbstractAction createDelegateAction(String newName, Action delegate)
           
static String getClipboardSelection(Component c)
           
static void invokeAndWait(Runnable task)
           
static void invokeLater(Runnable task)
          Runs the task synchronously if the current thread is the event thread; otherwise passes it to the event thread to be run asynchronously after all events already on the queue have been processed.
static boolean isPlasticLaf()
           
static boolean isPlasticLaf(String name)
           
static void main(String[] args)
           
static void show(String msg)
          Show a modal debug message box with an OK button regardless of TEST_MODE.
static void showDebug(String msg)
          Shows a modal debug message box with an OK button when not in TEST_MODE.
static void showMessageBox(String msg, String title)
          Shows a modal message box with an OK button.
static void showStackTrace(Throwable t)
           
static void showTrace(Throwable t)
          Show a modal debug message box containing a backtrace for the Throwable t.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_MODE

public static volatile boolean TEST_MODE
True if the program is run in non-interactive test mode.


JGOODIES_PACKAGE

public static final String JGOODIES_PACKAGE
See Also:
Constant Field Values
Constructor Detail

Utilities

public Utilities()
Method Detail

invokeLater

public static void invokeLater(Runnable task)
Runs the task synchronously if the current thread is the event thread; otherwise passes it to the event thread to be run asynchronously after all events already on the queue have been processed.


invokeAndWait

public static void invokeAndWait(Runnable task)

main

public static void main(String[] args)

clearEventQueue

public static void clearEventQueue()

show

public static void show(String msg)
Show a modal debug message box with an OK button regardless of TEST_MODE.

Parameters:
msg - string to display

showTrace

public static void showTrace(Throwable t)
Show a modal debug message box containing a backtrace for the Throwable t.

Parameters:
t - the Throwable to be back traced.

showDebug

public static void showDebug(String msg)
Shows a modal debug message box with an OK button when not in TEST_MODE.

Parameters:
msg - string to display

showMessageBox

public static void showMessageBox(String msg,
                                  String title)
Shows a modal message box with an OK button.

Parameters:
msg - string to display

showStackTrace

public static void showStackTrace(Throwable t)

getClipboardSelection

public static String getClipboardSelection(Component c)
Returns:
a string with the current clipboard selection, or null if not available.

createDelegateAction

public static AbstractAction createDelegateAction(String newName,
                                                  Action delegate)
Returns:
an action with a new name that delegates to another action.

isPlasticLaf

public static boolean isPlasticLaf()
Returns:
whether the current LookAndFeel is a Plastic (i.e. JGoodies) LookAndFeel

isPlasticLaf

public static boolean isPlasticLaf(String name)
Parameters:
name - the fully-qualified classname of the LookAndFeel
Returns:
whether a given LookAndFeel name is a Plastic (i.e. JGoodies) LookAndFeel