org.knime.core.node.util
Class ViewUtils

java.lang.Object
  extended by org.knime.core.node.util.ViewUtils

public final class ViewUtils
extends Object

Provides helper methods mostly useful when implementing NodeViews.

Author:
ohl, University of Konstanz

Method Summary
static void invokeAndWaitInEDT(Runnable runMe)
          Executes the specified runnable in the Swing Event Dispatch Thread.
static void runOrInvokeLaterInEDT(Runnable runMe)
          Executes the specified runnable some time in the Swing Event Dispatch Thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

invokeAndWaitInEDT

public static void invokeAndWaitInEDT(Runnable runMe)
                               throws InvocationTargetRuntimeException
Executes the specified runnable in the Swing Event Dispatch Thread. If the caller is already running in the EDT, it just executes the run method of the runnable, otherwise it passes the runnable to the EDT and waits until its run method returns.

Parameters:
runMe - the run method of this will be executed.
Throws:
InvocationTargetRuntimeException - if the executed code throws an exception (the cause of it is set to the exception thrown by the executed code then), or if the execution was interrupted in the EDT.
See Also:
SwingUtilities.invokeAndWait(Runnable)

runOrInvokeLaterInEDT

public static void runOrInvokeLaterInEDT(Runnable runMe)
Executes the specified runnable some time in the Swing Event Dispatch Thread. If the caller is already running in the EDT, it immediately executes the run method and does not return until it finishes. Otherwise it queues the argument for execution in the EDT and returns (not waiting for the run method to finish).

Parameters:
runMe - the run method of this will be executed.
See Also:
SwingUtilities.invokeLater(Runnable)


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.