diff options
author | Michael Valenta | 2006-01-26 13:23:18 +0000 |
---|---|---|
committer | Michael Valenta | 2006-01-26 13:23:18 +0000 |
commit | 048909cc12849bf7404e56ce6bdb06fe4d36c1d5 (patch) | |
tree | 624af244165cccd8d07c2abf1b8cc4c0889fdf98 | |
parent | 38e69104597b020f62550b28cd0a9d6f8d7d2a94 (diff) | |
download | eclipse.platform.team-048909cc12849bf7404e56ce6bdb06fe4d36c1d5.tar.gz eclipse.platform.team-048909cc12849bf7404e56ce6bdb06fe4d36c1d5.tar.xz eclipse.platform.team-048909cc12849bf7404e56ce6bdb06fe4d36c1d5.zip |
Fixed javadoc warnings
16 files changed, 92 insertions, 88 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationContext.java index edfa816d3..fe660a4cc 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationContext.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/ISynchronizationContext.java @@ -185,20 +185,18 @@ public interface ISynchronizationContext { /** * Refresh the portion of the context related to the given resource - * mappings. The provided mappings must be mappings that appear in the scope - * of this context. The refresh will first regenerate the scope for the - * mappings in case new resources are included in the mappings. Then the - * synchronization state of the resources covered by the mapping will be - * refreshed. If new resources are included in the scope, a property change - * event will be fired from the scope. If the synchronization state of any - * of the resources covered by the mapping change, a change event will be - * fired from the diff tree of this contet. + * mappings. The provided mappings must be within the scope of this context. + * Refreshing mappings may result in additional resources being added to the + * scope of this context. If new resources are included in the scope, a + * property change event will be fired from the scope. If the + * synchronization state of any of the resources covered by the mapping + * change, a change event will be fired from the diff tree of this contet. * <p> - * Changes to the diff tree may be triggered by a call to this method or by a - * refresh triggered by some other source. Hence, the callback from the diff tree - * to report changes may occur in the same thread as the refresh or - * <a href="#async">asynchronously</a> in a separate thread, regardless of who triggered - * the refresh. + * Changes to the diff tree may be triggered by a call to this method or by + * a refresh triggered by some other source. Hence, the callback from the + * diff tree to report changes may occur in the same thread as the refresh + * or <a href="#async">asynchronously</a> in a separate thread, regardless + * of who triggered the refresh. * * @param mappings * the mappings to be refreshed diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ScopeGenerator.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ScopeGenerator.java index 9cdd329b4..0d115433b 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ScopeGenerator.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/ScopeGenerator.java @@ -119,19 +119,22 @@ public class ScopeGenerator { * @param scope the scope being refreshed * @param mappings the mappings to be refreshed * @param monitor a progress monitor + * @return a set of traversals that cover the given mappings * @throws CoreException */ - public void refreshScope(final IResourceMappingScope scope, final ResourceMapping[] mappings, IProgressMonitor monitor) throws CoreException { + public ResourceTraversal[] refreshScope(final IResourceMappingScope scope, final ResourceMapping[] mappings, IProgressMonitor monitor) throws CoreException { // We need to lock the workspace when building the scope + final ResourceTraversal[][] traversals = new ResourceTraversal[][] { new ResourceTraversal[0] }; IWorkspace workspace = ResourcesPlugin.getWorkspace(); workspace.run(new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { - internalRefreshScope(scope, mappings, monitor); + traversals[0] = internalRefreshScope(scope, mappings, monitor); } }, workspace.getRoot(), IResource.NONE, monitor); + return traversals[0]; } - private void internalRefreshScope(IResourceMappingScope scope, ResourceMapping[] mappings, IProgressMonitor monitor) throws CoreException { + private ResourceTraversal[] internalRefreshScope(IResourceMappingScope scope, ResourceMapping[] mappings, IProgressMonitor monitor) throws CoreException { monitor.beginTask(null, 100 * mappings.length + 100); ResourceTraversal[] originalTraversals = scope.getTraversals(); Set newResources = new HashSet(); @@ -153,6 +156,7 @@ public class ScopeGenerator { } monitor.done(); + return scope.getTraversals(); } private void addResourcesToScope(IResourceMappingScope scope, IResource[] newResources, IProgressMonitor monitor) throws CoreException { @@ -207,7 +211,6 @@ public class ScopeGenerator { /** * Create the scope that will be populated and returned by the builder. This * method is not intended to be overridden by clients. - * @param label a label that describes the operation * @param inputMappings the input mappings * @return a newly created scope that will be populated and returned by the * builder diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationContext.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationContext.java index 16631a72b..e6fdb3c1a 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationContext.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/mapping/provider/SynchronizationContext.java @@ -10,9 +10,6 @@ *******************************************************************************/ package org.eclipse.team.core.mapping.provider; -import java.util.ArrayList; -import java.util.List; - import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.mapping.ResourceMapping; import org.eclipse.core.resources.mapping.ResourceTraversal; @@ -39,28 +36,28 @@ import org.eclipse.team.internal.core.mapping.ResourceMappingScope; */ public abstract class SynchronizationContext implements ISynchronizationContext { - private IResourceMappingScope input; + private IResourceMappingScope scope; private final int type; - private final IResourceDiffTree deltaTree; + private final IResourceDiffTree diffTree; private DiffCache cache; /** - * Create a synchronization context - * @param input the input that defines the scope of the synchronization + * Create a synchronization context. + * @param scope the input that defines the scope of the synchronization * @param type the type of synchronization (ONE_WAY or TWO_WAY) - * @param tree the sync info tree that contains all out-of-sync resources + * @param diffTree the sync info tree that contains all out-of-sync resources */ - protected SynchronizationContext(IResourceMappingScope input, int type, IResourceDiffTree deltaTree) { - this.input = input; + protected SynchronizationContext(IResourceMappingScope scope, int type, IResourceDiffTree diffTree) { + this.scope = scope; this.type = type; - this.deltaTree = deltaTree; + this.diffTree = diffTree; } /** * {@inheritDoc} */ public IResourceMappingScope getScope() { - return input; + return scope; } /** @@ -93,7 +90,7 @@ public abstract class SynchronizationContext implements ISynchronizationContext * {@inheritDoc} */ public IResourceDiffTree getDiffTree() { - return deltaTree; + return diffTree; } /** @@ -102,25 +99,20 @@ public abstract class SynchronizationContext implements ISynchronizationContext public void refresh(ResourceMapping[] mappings, IProgressMonitor monitor) throws CoreException { monitor.beginTask(null, 100); ScopeGenerator scopeGenerator = getScopeGenerator(); - if (scopeGenerator != null) - scopeGenerator.refreshScope(getScope(), mappings, Policy.subMonitorFor(monitor, 50)); - List traversals = new ArrayList(); - for (int i = 0; i < mappings.length; i++) { - ResourceMapping mapping = mappings[i]; - ResourceTraversal[] mappingTraversals = input.getTraversals(mapping); - for (int j = 0; j < mappingTraversals.length; j++) { - ResourceTraversal traversal = mappingTraversals[j]; - traversals.add(traversal); - } + if (scopeGenerator == null) { + // The scope generator is missing so just refresh everything + refresh(scope.getTraversals(), IResource.NONE, Policy.subMonitorFor(monitor, 50)); + } else { + ResourceTraversal[] traversals = scopeGenerator.refreshScope(getScope(), mappings, Policy.subMonitorFor(monitor, 50)); + if (traversals.length > 0) + refresh(traversals, IResource.NONE, Policy.subMonitorFor(monitor, 50)); } - if (!traversals.isEmpty()) - refresh((ResourceTraversal[]) traversals.toArray(new ResourceTraversal[traversals.size()]), IResource.NONE, Policy.subMonitorFor(monitor, 50)); monitor.done(); } private ScopeGenerator getScopeGenerator() { - if (input instanceof ResourceMappingScope) { - ResourceMappingScope rms = (ResourceMappingScope) input; + if (scope instanceof ResourceMappingScope) { + ResourceMappingScope rms = (ResourceMappingScope) scope; rms.getGenerator(); } return null; diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java index 0d00c5b9c..022d5a5a1 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/mappings/WorkspaceSubscriberContext.java @@ -194,6 +194,9 @@ public class WorkspaceSubscriberContext extends CVSSubscriberMergeContext { public ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException { return traversals; } + public boolean isAncestorOf(ResourceMapping mapping) { + return false; + } }}; try { monitor.beginTask(null, 50); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java index f7593785e..52b6a846a 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/operations/WorkspaceResourceMapper.java @@ -66,4 +66,7 @@ public final class WorkspaceResourceMapper extends ResourceMapping { private ResourceTraversal[] asTraversal(IResource resource, final int depth, ResourceMappingContext context) { return new ResourceTraversal[] { new ResourceTraversal(new IResource[] { resource }, depth, IResource.NONE)} ; } + public boolean isAncestorOf(ResourceMapping mapping) { + return false; + } } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java index 8af058b14..8bd911408 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/RefreshModelParticipantJob.java @@ -13,6 +13,7 @@ package org.eclipse.team.internal.ui.synchronize; import java.util.HashMap; import java.util.Map; +import org.eclipse.core.resources.mapping.ResourceMapping; import org.eclipse.core.runtime.*; import org.eclipse.team.core.diff.*; import org.eclipse.team.core.mapping.ISynchronizationContext; @@ -21,8 +22,9 @@ import org.eclipse.team.ui.synchronize.ISynchronizeParticipant; public class RefreshModelParticipantJob extends RefreshParticipantJob { - public class ChangeDescription implements IChangeDescription, IDiffChangeListener { + private final ResourceMapping[] mappings; + public class ChangeDescription implements IChangeDescription, IDiffChangeListener { Map changes = new HashMap(); public int getChangeCount() { @@ -43,8 +45,13 @@ public class RefreshModelParticipantJob extends RefreshParticipantJob { } } - public RefreshModelParticipantJob(ISynchronizeParticipant participant, String jobName, String taskName, IRefreshSubscriberListener listener) { + public RefreshModelParticipantJob(ISynchronizeParticipant participant, String jobName, String taskName, ResourceMapping[] mappings, IRefreshSubscriberListener listener) { super(participant, jobName, taskName, listener); + ISynchronizationContext context = ((ResourceMappingSynchronizeParticipant)getParticipant()).getContext(); + if (mappings.length == 0) + this.mappings = context.getScope().getMappings(); + else + this.mappings = mappings; } protected void doRefresh(IChangeDescription changeListener, @@ -53,7 +60,7 @@ public class RefreshModelParticipantJob extends RefreshParticipantJob { try { context.getDiffTree().addDiffChangeListener((ChangeDescription)changeListener); // TODO: finer grained refresh - context.refresh(context.getScope().getMappings(), monitor); + context.refresh(mappings, monitor); // Wait for any asynchronous updating to complete try { Platform.getJobManager().join(context, monitor); @@ -71,11 +78,16 @@ public class RefreshModelParticipantJob extends RefreshParticipantJob { protected void handleProgressGroupSet(IProgressMonitor group) { // TODO Auto-generated method stub - } protected IChangeDescription createChangeDescription() { return new ChangeDescription(); } + + public boolean belongsTo(Object family) { + if (family == ((ResourceMappingSynchronizeParticipant)getParticipant()).getContext()) + return true; + return super.belongsTo(family); + } } diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshActionContribution.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshActionContribution.java index 182a7c2d0..9d3fda31c 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshActionContribution.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/actions/RefreshActionContribution.java @@ -39,11 +39,7 @@ public class RefreshActionContribution extends SynchronizePageActionGroup { public void run() { IStructuredSelection selection = (IStructuredSelection)site.getSelectionProvider().getSelection(); ResourceMapping[] mappings = Utils.getResourceMappings(selection.toArray()); - if (mappings.length == 0) { - // Refresh all participant resources - mappings = null; - } - participant.refresh(null, null, null, null, site.getWorkbenchSite()); + participant.refresh(site.getWorkbenchSite(), mappings); } }; Utils.initAction(refreshSelectionAction, "action.refreshWithRemote."); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/compare/IModelBufferAdapter.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/compare/IModelBufferAdapter.java index 2ca15836d..23c5c8da1 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/compare/IModelBufferAdapter.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/compare/IModelBufferAdapter.java @@ -34,8 +34,8 @@ public interface IModelBufferAdapter { /** * Return the buffer for the given model element. - * @param modelElement - * @return + * @param modelElement the modle element + * @return a model buffer for the element */ IModelBuffer getBuffer(Object modelElement); diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java index dd006b03a..cd42c8ea0 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/MergeActionHandler.java @@ -102,7 +102,7 @@ public abstract class MergeActionHandler extends AbstractHandler { /** * Return the configuration of the synchronize page that is surfacing * the merge action to which this handler is registered. - * @return + * @return the synchronize page configuration */ protected final ISynchronizePageConfiguration getConfiguration() { return configuration; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java index d11f4194d..235366420 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/mapping/SynchronizationContentProvider.java @@ -376,7 +376,7 @@ public abstract class SynchronizationContentProvider implements ICommonContentPr * @param children the children * @return the subset of children that are of interest from the given context */ - protected Object[] getChildrenInContext(Object parentElemnt, Object[] children) { + protected Object[] getChildrenInContext(Object parent, Object[] children) { ISynchronizationContext context = getContext(); if (context == null) return children; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/MergeActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/MergeActionGroup.java index 626bef99d..f0e973187 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/MergeActionGroup.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/MergeActionGroup.java @@ -160,7 +160,7 @@ public class MergeActionGroup extends SynchronizePageActionGroup { * Add the merge action to the context menu manager. * Subclasses may override but should invoke the overridden * method for unrecognized ids in order to support future additions. - * @param id the id of the merge action (one of + * @param mergeActionId the id of the merge action (one of * {@link SynchronizationActionProvider#MERGE_ACTION_ID}, * {@link SynchronizationActionProvider#OVERWRITE_ACTION_ID} or * {@link SynchronizationActionProvider#MARK_AS_MERGE_ACTION_ID}) diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingMergeOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingMergeOperation.java index 87cde3622..3a3fa1025 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingMergeOperation.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingMergeOperation.java @@ -112,7 +112,6 @@ public abstract class ResourceMappingMergeOperation extends ResourceMappingOpera * Create a merge operation * @param part the workbench part from which the merge was launched or <code>null</code> * @param selectedMappings the selected mappings - * @param context the resource mapping context used to generate the full scope of the operation */ protected ResourceMappingMergeOperation(IWorkbenchPart part, ResourceMapping[] selectedMappings) { super(part, selectedMappings); @@ -190,7 +189,6 @@ public abstract class ResourceMappingMergeOperation extends ResourceMappingOpera /** * Preview the merge so the user can perform the merge manually. - * @param title the title of the merge. * @param monitor a progress monitor */ protected void showPreview(IProgressMonitor monitor) { @@ -357,7 +355,6 @@ public abstract class ResourceMappingMergeOperation extends ResourceMappingOpera * Return whether the given diff tree contains any deltas that match the given filter. * @param tree the diff tree * @param filter the diff node filter - * @param monitor a progress monitor * @return whether the given diff tree contains any deltas that match the given filter */ protected boolean hasChangesMatching(IDiffTree tree, final FastDiffFilter filter) { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingOperation.java index d04c69ff0..ec8324379 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingOperation.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingOperation.java @@ -52,7 +52,6 @@ public abstract class ResourceMappingOperation extends TeamOperation { * Create a resoure mapping operation * @param part the workbench part from which the merge was launched or <code>null</code> * @param selectedMappings the selected mappings - * @param context the resource mapping context used to generate the full scope of the operation */ protected ResourceMappingOperation(IWorkbenchPart part, ResourceMapping[] selectedMappings) { super(part); @@ -289,10 +288,9 @@ public abstract class ResourceMappingOperation extends TeamOperation { * operation from the input mappings. By default, this method passes * the resource mapping context and the result of {@link #consultModelsWhenGeneratingScope()} * to the scope builder constructor. - * + * <p> * This method can be overridden by subclasses. - * @param context the resource mapping context used to obtain traversals from - * the mappings in the input + * * @return the scope builder used to build the scope of this * operation from the input mappings. */ @@ -306,7 +304,7 @@ public abstract class ResourceMappingOperation extends TeamOperation { * @param requestPreviewMessage message to be displayed for the option to force a preview * (or <code>null</code> if the preview option shoudl not be presented * @param monitor a progress monitor - * @returns whether a preview of the operation results was requested + * @return whether a preview of the operation results was requested * @throws OperationCanceledException if the user choose to cancel */ protected boolean promptForInputChange(String requestPreviewMessage, IProgressMonitor monitor) { diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingSynchronizeParticipant.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingSynchronizeParticipant.java index fb22dbeff..ef5272f4a 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingSynchronizeParticipant.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/operations/ResourceMappingSynchronizeParticipant.java @@ -12,7 +12,6 @@ package org.eclipse.team.ui.operations; import org.eclipse.compare.structuremergeviewer.ICompareInput; import org.eclipse.core.resources.mapping.ResourceMapping; -import org.eclipse.core.resources.mapping.ResourceTraversal; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Platform; import org.eclipse.osgi.util.NLS; @@ -133,28 +132,22 @@ public class ResourceMappingSynchronizeParticipant extends * @see org.eclipse.team.ui.synchronize.ISynchronizeParticipant#run(org.eclipse.ui.IWorkbenchPart) */ public void run(IWorkbenchPart part) { - refresh(getContext().getScope().getMappings(), null, null, null, part != null ? part.getSite() : null); + refresh(part != null ? part.getSite() : null, new ResourceMapping[0]); } /** * Refresh a participant in the background the result of the refresh are shown in the progress view. Refreshing * can also be considered synchronizing, or refreshing the synchronization state. Basically this is a long - * running operation that will update the participants sync info sets with new changes detected on the - * server. Either or both of the <code>shortTaskName</code> and <code>longTaskName</code> can be <code>null</code> - * in which case, the default values for these are returned by the methods <code>getShortTaskName()</code> and - * <code>getLongTaskName(IResource[])</code> will be used. + * running operation that will update the participant's context with new changes detected on the + * server. Passing an empty array of resource mappings will refresh all mappings in the context. * - * @param resources the resources to be refreshed. - * @param shortTaskName the taskName of the background job that will run the synchronize or <code>null</code> - * if the default job name is desired. - * @param longTaskName the taskName of the progress monitor running the synchronize or <code>null</code> - * if the default job name is desired. * @param site the workbench site the synchronize is running from. This can be used to notify the site * that a job is running. + * @param mappings the resource mappings to be refreshed */ - public final void refresh(ResourceMapping[] mappings, ResourceTraversal[] traversals, String shortTaskName, String longTaskName, IWorkbenchSite site) { + public final void refresh(IWorkbenchSite site, ResourceMapping[] mappings) { IRefreshSubscriberListener listener = new RefreshUserNotificationPolicy(this); - internalRefresh(mappings, traversals, shortTaskName, longTaskName, site, listener); + internalRefresh(mappings, null, null, site, listener); } /* (non-Javadoc) @@ -162,6 +155,8 @@ public class ResourceMappingSynchronizeParticipant extends */ public void dispose() { context.dispose(); + Platform.getJobManager().cancel(this); + refreshSchedule.dispose(); } /** @@ -184,17 +179,17 @@ public class ResourceMappingSynchronizeParticipant extends /** * Return a compare input for the given model object or <code>null</code> * if the object is not eligible for comparison. - * @param o the model object + * @param object the model object * @return a compare input for the model object or <code>null</code> */ - public ICompareInput asCompareInput(Object o) { - if (o instanceof ICompareInput) { - return (ICompareInput) o; + public ICompareInput asCompareInput(Object object) { + if (object instanceof ICompareInput) { + return (ICompareInput) object; } // Get a compare input from the model provider's compare adapter - ICompareAdapter adapter = Utils.getCompareAdapter(o); + ICompareAdapter adapter = Utils.getCompareAdapter(object); if (adapter != null) - return adapter.asCompareInput(getContext(), o); + return adapter.asCompareInput(getContext(), object); return null; } @@ -231,13 +226,13 @@ public class ResourceMappingSynchronizeParticipant extends this.mergingEnabled = mergingEnabled; } - private void internalRefresh(ResourceMapping[] mappings, ResourceTraversal[] traversals, String jobName, String taskName, IWorkbenchSite site, IRefreshSubscriberListener listener) { + private void internalRefresh(ResourceMapping[] mappings, String jobName, String taskName, IWorkbenchSite site, IRefreshSubscriberListener listener) { if (jobName == null) jobName = getShortTaskName(); if (taskName == null) taskName = getLongTaskName(mappings); Platform.getJobManager().cancel(this); - RefreshParticipantJob job = new RefreshModelParticipantJob(this, jobName, taskName, listener); + RefreshParticipantJob job = new RefreshModelParticipantJob(this, jobName, taskName, mappings, listener); job.setUser(true); Utils.schedule(job, site); @@ -291,7 +286,8 @@ public class ResourceMappingSynchronizeParticipant extends public RefreshParticipantJob createJob(String interval) { return new RefreshModelParticipantJob(ResourceMappingSynchronizeParticipant.this, TeamUIMessages.RefreshSchedule_14, - NLS.bind(TeamUIMessages.RefreshSchedule_15, new String[] { ResourceMappingSynchronizeParticipant.this.getName(), interval }), + NLS.bind(TeamUIMessages.RefreshSchedule_15, new String[] { ResourceMappingSynchronizeParticipant.this.getName(), interval }), + new ResourceMapping[0], new RefreshUserNotificationPolicy(ResourceMappingSynchronizeParticipant.this)); } public ISynchronizeParticipant getParticipant() { diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java index 5f73fd587..cfcfdc316 100644 --- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java +++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/mapping/ScopeBuildingTests.java @@ -119,6 +119,9 @@ public class ScopeBuildingTests extends TeamTest { public String getModelProviderId() { return TEST_MODEL_PROVIDER_ID; } + public boolean isAncestorOf(ResourceMapping mapping) { + return false; + } }; } diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/mappings/ResourceMapperTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/mappings/ResourceMapperTests.java index 1b08a4f95..610b0ce0d 100644 --- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/mappings/ResourceMapperTests.java +++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/mappings/ResourceMapperTests.java @@ -308,6 +308,9 @@ public class ResourceMapperTests extends EclipseTest { public String getModelProviderId() { return "org.eclipse.team.tests.cvs.core.modelProvider"; } + public boolean isAncestorOf(ResourceMapping mapping) { + return false; + } }; } |