|
Eclipse Platform Release 3.3 |
|||||||||||
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.team.ui.TeamOperation
org.eclipse.team.ui.synchronize.ModelOperation
An abstract operation that uses an ISynchronizationScopeManager
to
create an operation scope that includes the complete set of mappings that
must be included in the operation to ensure model consistency. The scope
generation phase will prompt the user if additional resources have been added
to the scope.
Constructor Summary | |
---|---|
protected |
ModelOperation(IWorkbenchPart part,
ISynchronizationScopeManager manager)
Create a model operation that operates on the given scope. |
Method Summary | |
---|---|
protected void |
beginOperation(IProgressMonitor monitor)
Method called from run(IProgressMonitor) before
the execute(IProgressMonitor) method is invoked.
|
protected void |
endOperation(IProgressMonitor monitor)
Method called from run(IProgressMonitor) after the
execute(IProgressMonitor) completes of if an exception
is thrown from the beginOperation(IProgressMonitor)
or the execute(IProgressMonitor) . |
protected abstract void |
execute(IProgressMonitor monitor)
Execute the operation. |
protected ISynchronizationContext |
getContext()
Return the synchronization context for the operation or null
if the operation doesn't have one or if it has not yet been created.
|
protected String |
getPreviewRequestMessage()
Return a string to be used in the preview request on the scope prompt or null if a preview of the operation results is not possible.
|
ISynchronizationScope |
getScope()
Return the scope of this operation. |
protected ISynchronizationScopeManager |
getScopeManager()
Return the scope manager for this operation. |
protected void |
initializeScope(IProgressMonitor monitor)
Adjust the input of the operation according to the selected resource mappings and the set of interested participants. |
boolean |
isPreviewRequested()
Return whether a preview of the operation before it is performed is desired. |
protected boolean |
promptForInputChange(String requestPreviewMessage,
IProgressMonitor monitor)
Prompt the user to inform them that additional resource mappings have been included in the operations. |
protected void |
promptIfInputChange(IProgressMonitor monitor)
Prompt the user by calling promptForInputChange(String, IProgressMonitor)
if the scope of the operation was expanded (as described in
initializeScope(IProgressMonitor) ). |
void |
run(IProgressMonitor monitor)
Run the operation. |
static ModelProvider[] |
sortByExtension(ModelProvider[] providers)
Return the list of provides sorted by their extends relationship. |
Methods inherited from class org.eclipse.team.ui.TeamOperation |
---|
belongsTo, canRunAsJob, getGotoAction, getJobName, getKeepOperation, getOperationIcon, getPart, getSchedulingRule, getShell, isKeepOneProgressServiceEntry, isPostponeAutobuild, isSameFamilyAs, isUserInitiated, run, shouldRun |
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 |
Constructor Detail |
protected ModelOperation(IWorkbenchPart part, ISynchronizationScopeManager manager)
part
- the workbench part from which the merge was launched or null
manager
- the scope manager for this operationMethod Detail |
public static ModelProvider[] sortByExtension(ModelProvider[] providers)
providers
- the model providers
public final void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
initializeScope(IProgressMonitor)
and then invokes the
execute(IProgressMonitor)
method.
monitor
- a progress monitor
InterruptedException
- if the operation detects a request to cancel,
using IProgressMonitor.isCanceled()
, it should exit by throwing
InterruptedException
InvocationTargetException
- if the run method must propagate a checked exception,
it should wrap it inside an InvocationTargetException
; runtime exceptions are automatically
wrapped in an InvocationTargetException
by the calling contextIRunnableWithProgress.run(org.eclipse.core.runtime.IProgressMonitor)
protected void beginOperation(IProgressMonitor monitor) throws InvocationTargetException
run(IProgressMonitor)
before
the execute(IProgressMonitor)
method is invoked.
This is done to give the operation a chance to initialize
any state required to execute. By default, the
ISynchronizationScopeManager
for this operation
is initialized if it was not previously initialized.
monitor
- a progress monitor
InvocationTargetException
protected void endOperation(IProgressMonitor monitor) throws InvocationTargetException
run(IProgressMonitor)
after the
execute(IProgressMonitor)
completes of if an exception
is thrown from the beginOperation(IProgressMonitor)
or the execute(IProgressMonitor)
. By default,
this method does nothing. Subclasses may override.
monitor
- a progress monitor
InvocationTargetException
protected final void initializeScope(IProgressMonitor monitor) throws InvocationTargetException
The scope of this operation will only be prepared once. Subsequent calls to this method will do nothing. Also, if the scope was provided as an argument to a constructor, this method will do nothing (i.e. the scope will not be prepared again and no prompting will occur).
Subclasses can customize how the scope is generated by overriding
the getScopeManager()
to return a custom scope manager.
monitor
- a progress monitor
InvocationTargetException
protected void promptIfInputChange(IProgressMonitor monitor)
promptForInputChange(String, IProgressMonitor)
if the scope of the operation was expanded (as described in
initializeScope(IProgressMonitor)
).
monitor
- a progress monitorprotected String getPreviewRequestMessage()
null
if a preview of the operation results is not possible.
By default, null
is returned but subclasses may override.
null
if a preview of the operation results is not possibleprotected boolean promptForInputChange(String requestPreviewMessage, IProgressMonitor monitor)
requestPreviewMessage
- message to be displayed for the option to force a preview
(or null
if the preview option should not be presentedmonitor
- a progress monitor
OperationCanceledException
- if the user choose to cancelprotected ISynchronizationContext getContext()
null
if the operation doesn't have one or if it has not yet been created.
By default, the method always returns null
. Subclasses may override.
null
protected abstract void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
monitor
- a progress monitor
InvocationTargetException
InterruptedException
public ISynchronizationScope getScope()
public boolean isPreviewRequested()
protected ISynchronizationScopeManager getScopeManager()
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.