|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.jobs.JobChangeAdapter
org.eclipse.rse.ui.operations.SystemFetchOperation
public class SystemFetchOperation
A SystemFetchOperation is used to perform a query of a remote system on behalf of a subsystem. The operation has some knowledge of the containing user interface, e.g. the workbench part which is responsible for issuing the query. It is created with a "collector" that will contain the results of the query.
This class may be subclassed but usually is used directly.
Nested Class Summary | |
---|---|
class |
SystemFetchOperation.PromptForPassword
An action that prompts the user for credentials to connect the subsystem that is issued the fetch. |
class |
SystemFetchOperation.UpdateRegistry
A sub-operation that broadcasts any connection status change. |
Field Summary | |
---|---|
protected ISystemViewElementAdapter |
_adapter
|
protected boolean |
_canRunAsJob
|
protected IElementCollector |
_collector
|
protected InvocationTargetException |
_exc
|
protected IWorkbenchPart |
_part
|
protected Object |
_remoteObject
|
Constructor Summary | |
---|---|
SystemFetchOperation(IWorkbenchPart part,
Object remoteObject,
ISystemViewElementAdapter adapter,
IElementCollector collector)
Creates an instance of this fetch operation. |
|
SystemFetchOperation(IWorkbenchPart part,
Object remoteObject,
ISystemViewElementAdapter adapter,
IElementCollector collector,
boolean canRunAsJob)
Creates an instance of this fetch operation. |
Method Summary | |
---|---|
protected boolean |
canRunAsJob()
If this operation can safely be run in the background, then subclasses can override this method and return true . |
protected void |
displayAsyncMsg(SubSystem ss,
SystemMessageException msg)
Display message on message thread |
protected void |
endOperation()
|
protected void |
execute(IProgressMonitor monitor)
Subclasses must override this method to perform the operation. |
protected IAction |
getGotoAction()
This method is called to allow subclasses to configure an action that could be run to show the results of the action to the user. |
protected String |
getJobName()
Return the job name to be used if the action can run as a job. |
protected boolean |
getKeepOperation()
This method is called to allow subclasses to have the operation remain in the progress indicator even after the job is done. |
protected URL |
getOperationIcon()
This method is called to allow subclasses to configure an icon to show when running this operation. |
IWorkbenchPart |
getPart()
Return the part that is associated with this operation. |
protected ISchedulingRule |
getSchedulingRule()
Returns the scheduling rule that is to be obtained before this operation is executed by it's context or null if
no scheduling rule is to be obtained. |
protected Shell |
getShell()
Return a shell that can be used by the operation to display dialogs, etc. |
protected String |
getTaskName()
|
protected boolean |
isPostponeAutobuild()
Return whether the auto-build should be postponed until after the operation is complete. |
void |
run()
Run the operation in a context that is determined by the canRunAsJob()
hint. |
void |
run(IProgressMonitor monitor)
|
void |
setException(InvocationTargetException exc)
|
protected boolean |
shouldRun()
This method is invoked from the run() method before
the operation is run in the operation's context. |
protected void |
showOperationErrorMessage(Shell shell,
Throwable exc,
SubSystem ss)
Show an error message as a result of running this operation. |
protected void |
startOperation()
|
Methods inherited from class org.eclipse.core.runtime.jobs.JobChangeAdapter |
---|
aboutToRun, awake, done, running, scheduled, sleeping |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IWorkbenchPart _part
protected Object _remoteObject
protected IElementCollector _collector
protected ISystemViewElementAdapter _adapter
protected boolean _canRunAsJob
protected InvocationTargetException _exc
Constructor Detail |
---|
public SystemFetchOperation(IWorkbenchPart part, Object remoteObject, ISystemViewElementAdapter adapter, IElementCollector collector)
part
- the workbench part associated with this fetch.remoteObject
- the remote object that provides the context for this fetchadapter
- the adapter that can be used to extract information from the remote objects that will be retrieved by this fetch.collector
- the collector for the fetch results.public SystemFetchOperation(IWorkbenchPart part, Object remoteObject, ISystemViewElementAdapter adapter, IElementCollector collector, boolean canRunAsJob)
part
- the workbench part associated with this fetch.remoteObject
- the remote object that provides the context for this fetchadapter
- the adapter that can be used to extract information from the remote objects that will be retrieved by this fetch.collector
- the collector for the fetch results.canRunAsJob
- true if this fetch operation can be run in a job of its own, false otherwiseMethod Detail |
---|
public void setException(InvocationTargetException exc)
public IWorkbenchPart getPart()
null
public final void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
run
in interface IRunnableWithProgress
InvocationTargetException
InterruptedException
protected void startOperation()
protected void endOperation()
protected void execute(IProgressMonitor monitor) throws Exception, InterruptedException
monitor
-
Exception
InterruptedException
protected void showOperationErrorMessage(Shell shell, Throwable exc, SubSystem ss)
May be overridden by subclasses but it usually used directly.
shell
- The parent shell for a message dialog box.exc
- the exception that was recieved and should be shownss
- the subsystem that this operation is being issued forprotected void displayAsyncMsg(SubSystem ss, SystemMessageException msg)
protected String getTaskName()
public final void run() throws InvocationTargetException, InterruptedException
canRunAsJob()
hint. If this operation can run as a job then it will be run in a background thread.
Otherwise it will run in the foreground and block the caller.
InvocationTargetException
InterruptedException
protected boolean shouldRun()
run()
method before
the operation is run in the operation's context. Subclasses may
override in order to perform prechecks to determine if the operation
should run. This may include prompting the user for information, etc.
protected ISchedulingRule getSchedulingRule()
null
if
no scheduling rule is to be obtained. If the operation is run
as a job, the schdulin rule is used as the schduling rule of the
job. Otherwise, it is obtained before execution of the operation
occurs.
By default, no scheduling rule is obtained. Sublcasses can override to in order ot obtain a scheduling rule or can obtain schduling rules withing their operation if finer grained schduling is desired.
null
.protected boolean isPostponeAutobuild()
protected boolean canRunAsJob()
true
. This will make their
action run in a Job
.
Subsclass that override this method should
also override the getJobName()
method.
true
if this action can be run in the background and
false
otherwise.protected String getJobName()
canRunAsJob()
returns true
).
protected IAction getGotoAction()
protected URL getOperationIcon()
protected boolean getKeepOperation()
true
to keep the operation and false
otherwise.protected Shell getShell()
|
RSE Release 3.4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |