Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.core
Interface IRSEInteractionProvider


public interface IRSEInteractionProvider

Interaction Provider Interface. Classes implementing this interface provide a means for RSE to communicate with the outside world: via progress monitors, events and messages. A UI implementation of this interface would typically use UI components for user interaction; although this can be changed also intermittently. Non-UI headless applications may log messages rather than doing interactive messages, and may use different Threads for sending messages.

EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is no guarantee that this API will work or that it will remain the same. Please do not use this API without consulting with the Target Management team.

Since:
org.eclipse.rse.core 3.0

Method Summary
 void asyncExec ( Runnable runnable)
          Asynchronously run the given runnable in a separate thread.
 void eventExec ( Runnable runnable)
          Run the given runnable with "event" semantics, that is: asynchronously run it through asyncExec(Runnable) on the interaction provider's designated event thread, unless the call is already coming from that very thread.
 void flushRunnableQueue ()
          Flush the Queue of Runnables enqueued with asyncExec(Runnable).
  IProgressMonitor getDefaultProgressMonitor ()
          Return a default progress monitor for the context that's currently active.
 void runInDefaultContext (boolean fork, boolean cancellable, IRSERunnableWithProgress runnable)
           Runs the given IRSERunnableWithProgress in the default context available to this interaction provider, that provides a progress monitor.
 void showMessage ( SystemMessage msg)
          Show the given message or log it.
 

Method Detail

getDefaultProgressMonitor

IProgressMonitor getDefaultProgressMonitor()
Return a default progress monitor for the context that's currently active. Usually, long-running operations should always be created from the client with a progress monitor that they can use. Historically, however, this has not always been done and is especially problematic in operations that are performed as the result of Callbacks. For such situations, this method returns a default progress monitor in a context that we guess. We try to use one default progress use one for all phases of a single operation, such as connecting and resolving.

Returns:
a default progress monitor

runInDefaultContext

void runInDefaultContext(boolean fork,
                         boolean cancellable,
                         
IRSERunnableWithProgress runnable)
                         throws 
InvocationTargetException,
                                
InterruptedException

Runs the given IRSERunnableWithProgress in the default context available to this interaction provider, that provides a progress monitor. For example, if the default context is a ProgressMonitorDialog then the runnable is run using the dialog's progress monitor. This method is derived from IRunnableContext#run().

If fork is false, the current thread is used to run the runnable. Note that if fork is true, it is unspecified whether or not this method blocks until the runnable has been run. Implementers should document whether the runnable is run synchronously (blocking) or asynchronously (non-blocking), or if no assumption can be made about the blocking behaviour.

Parameters:
fork - true if the runnable should be run in a separate thread, and false to run in the same thread
cancellable - true to enable the cancellation, and false to make the operation uncancellable
runnable - the runnable to run
Throws:
InvocationTargetException - wraps any exception or error which occurs while running the runnable
InterruptedException - propagated by the context if the runnable acknowledges cancellation by throwing this exception. This should not be thrown if cancellable is false.

asyncExec

void asyncExec(
Runnable runnable)
Asynchronously run the given runnable in a separate thread. UI implementations should have the runnable run in the dispatch thread, where it has access to UI components. This is used for notifications. Non-UI applications may choose any Thread they like, provided that two conditions are met:
  1. All Runnables are run on the same Thread.
  2. The ordering of Runnables remains intact.

Parameters:
runnable - the Runnable to run asynchronously

eventExec

void eventExec(
Runnable runnable)
Run the given runnable with "event" semantics, that is: asynchronously run it through asyncExec(Runnable) on the interaction provider's designated event thread, unless the call is already coming from that very thread. In that case, the Runnable is run immediately and synchronously.

Parameters:
runnable - the Runnable to run asynchronously with "event" semantics
See Also:
asyncExec(Runnable)

flushRunnableQueue

void flushRunnableQueue()
Flush the Queue of Runnables enqueued with asyncExec(Runnable). This needs to be done when this interaction provider is to be replaced by a different one, in order to ensure that the ordering of all Runnables remains intact.


showMessage

void showMessage(
SystemMessage msg)
Show the given message or log it. In an interactive environment, this pops up a dialog asking the user to press an OK button. The method will not return before the OK button is pressed.

Parameters:
msg - the message to show

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire