|
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
org.eclipse.team.ui.synchronize.ModelMergeOperation
org.eclipse.team.ui.synchronize.ModelParticipantMergeOperation
A model merge operation that uses a participant to preview the changes in either a dialog or the Synchronize view.
Field Summary | |
---|---|
static int |
REQUEST_PREVIEW
Status code that can be returned from the ModelMergeOperation.performMerge(IProgressMonitor)
method to indicate that a subclass would like to force a preview of the merge.
|
Constructor Summary | |
---|---|
protected |
ModelParticipantMergeOperation(IWorkbenchPart part,
ISynchronizationScopeManager manager)
Create a merge participant operation for the scope of the given manager. |
Method Summary | |
---|---|
boolean |
belongsTo(Object family)
Return whether the job that is running this operation should be considered a member member of the given family. |
protected abstract SynchronizationContext |
createMergeContext()
Create a merge context for use by this operation. |
protected ModelSynchronizeParticipant |
createParticipant()
Create the synchronize participant to be used by this operation to preview changes. |
protected void |
execute(IProgressMonitor monitor)
Perform a merge. |
protected void |
executeMerge(IProgressMonitor monitor)
Perform a merge. |
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.
|
protected void |
handlePreviewRequest()
A preview of the merge has been requested. |
protected void |
initializeContext(IProgressMonitor monitor)
Initialize the merge context for this merge operation. |
protected boolean |
isPreviewInDialog()
Return whether previews should occur in a dialog or in the synchronize view. |
Methods inherited from class org.eclipse.team.ui.synchronize.ModelMergeOperation |
---|
handleMergeFailure, handleNoChanges, handleValidationFailure, hasChangesOfInterest, performMerge, performMerge, validateMerge |
Methods inherited from class org.eclipse.team.ui.synchronize.ModelOperation |
---|
beginOperation, endOperation, getScope, getScopeManager, initializeScope, isPreviewRequested, promptForInputChange, promptIfInputChange, run, sortByExtension |
Methods inherited from class org.eclipse.team.ui.TeamOperation |
---|
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 |
Field Detail |
public static final int REQUEST_PREVIEW
ModelMergeOperation.performMerge(IProgressMonitor)
method to indicate that a subclass would like to force a preview of the merge.
The message of such a status should be ignored.
Constructor Detail |
protected ModelParticipantMergeOperation(IWorkbenchPart part, ISynchronizationScopeManager manager)
part
- the workbench part from which the merge was launched or null
manager
- the scope managerMethod Detail |
protected void initializeContext(IProgressMonitor monitor) throws CoreException
ModelMergeOperation
ModelOperation.getContext()
method must return an instance of IMergeContext
that is fully initialized.
initializeContext
in class ModelMergeOperation
monitor
- a progress monitor
CoreException
protected void execute(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
ModelMergeOperation
ModelMergeOperation.initializeContext(IProgressMonitor)
is
called to determine the set of resource changes. Then the
ModelMergeOperation.executeMerge(IProgressMonitor)
method is invoked.
execute
in class ModelMergeOperation
monitor
- a progress monitor
InvocationTargetException
InterruptedException
protected void executeMerge(IProgressMonitor monitor) throws CoreException
ModelMergeOperation
ModelMergeOperation.execute(IProgressMonitor)
after the context has been
initialized. If there are changes in the context, they will be validating
by calling ModelMergeOperation.validateMerge(IMergeContext, IProgressMonitor)
. If
there are no validation problems, ModelMergeOperation.performMerge(IProgressMonitor)
will then be called to perform the merge. If there are problems encountered
or if a preview was requested, ModelMergeOperation.handlePreviewRequest()
is called.
executeMerge
in class ModelMergeOperation
monitor
- a progress monitor
CoreException
protected void handlePreviewRequest()
ModelMergeOperation
ModelOperation.getPreviewRequestMessage()
to have the option presented to the user if the scope changes.
handlePreviewRequest
in class ModelMergeOperation
public boolean belongsTo(Object family)
TeamOperation
IJobManager
.
By default, false
is always returned. Subclasses that override the
isKeepOneProgressServiceEntry
method do not need to override
this method, but instead should override isSameFamilyAs
.
belongsTo
in class TeamOperation
family
- the family being tested.
protected boolean isPreviewInDialog()
protected ISynchronizationContext getContext()
ModelOperation
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.
getContext
in class ModelOperation
null
protected String getPreviewRequestMessage()
ModelOperation
null
if a preview of the operation results is not possible.
By default, null
is returned but subclasses may override.
getPreviewRequestMessage
in class ModelOperation
null
if a preview of the operation results is not possibleprotected ModelSynchronizeParticipant createParticipant()
ModelSynchronizeParticipant
is created using the scope manager (ModelOperation.getScopeManager()
) context
from (createMergeContext()
) and job name (TeamOperation.getJobName()
)
of this operation. Subclasses may override this method.
Once created, it is the responsibility of the participant to dispose of the synchronization context when it is no longer needed.
protected abstract SynchronizationContext createMergeContext()
|
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.