public abstract class ModelParticipantMergeOperation extends ModelMergeOperation
A model merge operation that uses a participant to preview the changes in either a dialog or the Synchronize view.
Field SummaryModifier and TypeFieldDescription
static final intStatus 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.
Method SummaryModifier and TypeMethodDescription
booleanReturn whether the job that is running this operation should be considered a member member of the given family.
protected abstract SynchronizationContextCreate a merge context for use by this operation.
protected ModelSynchronizeParticipantCreate the synchronize participant to be used by this operation to preview changes.
protected voidPerform a merge.
protected voidPerform a merge.
protected ISynchronizationContextReturn the synchronization context for the operation or
nullif the operation doesn't have one or if it has not yet been created.
protected StringReturn a string to be used in the preview request on the scope prompt or
nullif a preview of the operation results is not possible.
protected voidA preview of the merge has been requested.
protected voidInitialize the merge context for this merge operation.
protected booleanReturn 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
REQUEST_PREVIEWpublic static final int REQUEST_PREVIEWStatus 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. The message of such a status should be ignored.
- See Also:
ModelParticipantMergeOperationCreate a merge participant operation for the scope of the given manager.
part- the workbench part from which the merge was launched or
manager- the scope manager
initializeContextInitialize the merge context for this merge operation. After this method is invoked, the
ModelOperation.getContext()method must return an instance of
IMergeContextthat is fully initialized.
executeprotected void execute
(IProgressMonitor monitor) throws InvocationTargetException, InterruptedExceptionPerform a merge. First
ModelMergeOperation.initializeContext(IProgressMonitor)is called to determine the set of resource changes. Then the
ModelMergeOperation.executeMerge(IProgressMonitor)method is invoked.
executeMergePerform a merge. This method is invoked from
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,
handlePreviewRequestprotected void handlePreviewRequest()A preview of the merge has been requested. By default, this method does nothing. Subclasses that wish to support previewing must override this method to preview the merge and the
ModelOperation.getPreviewRequestMessage()to have the option presented to the user if the scope changes.
belongsTopublic boolean belongsTo
(Object family)Description copied from class:
TeamOperationReturn whether the job that is running this operation should be considered a member member of the given family. Subclasses can override this method in order to support the family based functionality provided by the
IJobManager. By default,
falseis always returned. Subclasses that override the
isKeepOneProgressServiceEntrymethod do not need to override this method, but instead should override
isPreviewInDialogprotected boolean isPreviewInDialog()Return whether previews should occur in a dialog or in the synchronize view.
- whether previews should occur in a dialog or in the synchronize view
getContextprotected ISynchronizationContext getContext()Description copied from class:
ModelOperationReturn the synchronization context for the operation or
nullif the operation doesn't have one or if it has not yet been created. By default, the method always returns
null. Subclasses may override.
getPreviewRequestMessageprotected String getPreviewRequestMessage()Description copied from class:
ModelOperationReturn a string to be used in the preview request on the scope prompt or
nullif a preview of the operation results is not possible. By default,
nullis returned but subclasses may override.
createParticipantprotected ModelSynchronizeParticipant createParticipant()Create the synchronize participant to be used by this operation to preview changes. By default, a
ModelSynchronizeParticipantis 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.
- a newly created synchronize participant to be used by this operation
createMergeContextprotected abstract SynchronizationContext createMergeContext()Create a merge context for use by this operation. This method is not long running so the operation should not refresh the context or perform other long running operations in this thread. However the context may start initializing in another thread as long as the job used to perform the initialization belongs to the family that matches the context.
- a merge context for use by this operation