com.alee.utils
Class CoreSwingUtils

java.lang.Object
  extended by com.alee.utils.CoreSwingUtils
Direct Known Subclasses:
SwingUtils

public class CoreSwingUtils
extends java.lang.Object

Author:
Mikle Garin

Constructor Summary
CoreSwingUtils()
           
 
Method Summary
static java.awt.Window getWindowAncestor(java.awt.Component component)
          Returns window ancestor for specified component or null if it doesn't exist.
static void invokeAndWait(java.lang.Runnable runnable)
          Will invoke the specified action in EDT in case it is called from non-EDT thread.
static void invokeAndWaitSafely(java.lang.Runnable runnable)
          Will invoke the specified action in EDT in case it is called from non-EDT thread.
static void invokeLater(java.lang.Runnable runnable)
          Will invoke the specified action later in EDT in case it is called from non-EDT thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CoreSwingUtils

public CoreSwingUtils()
Method Detail

getWindowAncestor

public static java.awt.Window getWindowAncestor(java.awt.Component component)
Returns window ancestor for specified component or null if it doesn't exist.

Parameters:
component - component to process
Returns:
window ancestor for specified component or null if it doesn't exist

invokeLater

public static void invokeLater(java.lang.Runnable runnable)
Will invoke the specified action later in EDT in case it is called from non-EDT thread. Otherwise action will be performed immediately.

Parameters:
runnable - runnable

invokeAndWait

public static void invokeAndWait(java.lang.Runnable runnable)
                          throws java.lang.InterruptedException,
                                 java.lang.reflect.InvocationTargetException
Will invoke the specified action in EDT in case it is called from non-EDT thread.

Parameters:
runnable - runnable
Throws:
java.lang.InterruptedException
java.lang.reflect.InvocationTargetException

invokeAndWaitSafely

public static void invokeAndWaitSafely(java.lang.Runnable runnable)
Will invoke the specified action in EDT in case it is called from non-EDT thread. It will also block any exceptions thrown by "invokeAndWait" method.

Parameters:
runnable - runnable