Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-05-05 23:46:22 -0400
committerMichael Valenta2004-05-05 23:46:22 -0400
commit0e63e706a5f3f46dd4859d6b09c1a5a46ff1871c (patch)
treefcaa89702412dd7882c241f98c8b2c004fb83e59
parent2a65310d1fddda95751fa7df69c410116af525cc (diff)
downloadeclipse.platform.team-0e63e706a5f3f46dd4859d6b09c1a5a46ff1871c.tar.gz
eclipse.platform.team-0e63e706a5f3f46dd4859d6b09c1a5a46ff1871c.tar.xz
eclipse.platform.team-0e63e706a5f3f46dd4859d6b09c1a5a46ff1871c.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java29
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java8
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertOperation.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedOperation.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java11
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java17
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java7
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateOperation.java10
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardPageActionGroup.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java28
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java16
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageSite.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java21
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelOperation.java7
27 files changed, 182 insertions, 89 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index d4cf7a8a5..0c008be1d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -1089,14 +1089,14 @@ BranchAction.tooltip=Branch
IgnoreAction.label=A&dd to .cvsignore...
IgnoreAction.tooltip=Ignore the Selected Resources when Synchronizing
-ShowHistoryAction.label=Show in Resource &History
-ShowHistoryAction.tooltip=Show in Resource History
+ShowResourceInHistoryAction.label=Show in Resource &History
+ShowResourceInHistoryAction.tooltip=Show in Resource History
ShowAnnotationAction.label=Show &Annotation
ShowAnnotationAction.tooltip=Show Annotation
-GenerateDiff.label=Create &Patch...
-GenerateDiff.tooltip=Compare your workspace contents with the server and generate a diff file that can be used as a patch file.
+GenerateDiffFileAction.label=Create &Patch...
+GenerateDiffFileAction.tooltip=Compare your workspace contents with the server and generate a diff file that can be used as a patch file.
MergeUpdateAction.label=&Update
MergeUpdateAction.tooltip=Perform an update merge on the selected resources
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java
index a87fbbc16..381643b69 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSSubscriberOperation.java
@@ -11,30 +11,45 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.lang.reflect.InvocationTargetException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.core.variants.IResourceVariant;
-import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
+import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
+import org.eclipse.team.internal.ccvs.core.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
import org.eclipse.team.internal.ccvs.core.client.PruneFolderVisitor;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ui.TeamUIPlugin;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
public abstract class CVSSubscriberOperation extends SynchronizeModelOperation {
- protected CVSSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- super(part, elements);
+ protected CVSSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ super(configuration, elements);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
index 10732c0dd..7b6790e74 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java
@@ -105,11 +105,9 @@ public class CompareParticipant extends CVSParticipant implements IPropertyChang
configuration.addMenuGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP);
- if (!configuration.getSite().isModal()) {
- configuration.addMenuGroup(
- ISynchronizePageConfiguration.P_CONTEXT_MENU,
- NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP);
- }
+ configuration.addMenuGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP);
configuration.addActionContribution(new CompareParticipantActionContribution());
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertAction.java
index 949181633..4656e73a0 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertAction.java
@@ -13,7 +13,6 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
/**
* Action in compare editor that reverts the local contents to match the contents on the server.
@@ -27,8 +26,8 @@ public class CompareRevertAction extends CVSParticipantAction {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
*/
- protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- return new CompareRevertOperation(part, elements);
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new CompareRevertOperation(configuration, elements);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertOperation.java
index 1e091b22b..92e0abde4 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareRevertOperation.java
@@ -10,7 +10,10 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
@@ -19,12 +22,12 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
public class CompareRevertOperation extends CVSSubscriberOperation {
- protected CompareRevertOperation(IWorkbenchPart part, IDiffElement[] elements) {
- super(part, elements);
+ protected CompareRevertOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ super(configuration, elements);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedAction.java
index 6b57fba4f..830240c62 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedAction.java
@@ -16,7 +16,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
public class ConfirmMergedAction extends CVSParticipantAction {
@@ -34,7 +33,7 @@ public class ConfirmMergedAction extends CVSParticipantAction {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
*/
- protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- return new ConfirmMergedOperation(part, elements);
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new ConfirmMergedOperation(configuration, elements);
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedOperation.java
index cea1c54c8..73b769b5a 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/ConfirmMergedOperation.java
@@ -16,11 +16,13 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
+import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
/**
* This action marks the local resource as merged by updating the base
@@ -28,8 +30,8 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class ConfirmMergedOperation extends CVSSubscriberOperation {
- public ConfirmMergedOperation(IWorkbenchPart part, IDiffElement[] elements) {
- super(part, elements);
+ public ConfirmMergedOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ super(configuration, elements);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
index 1c285325c..15811ac00 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateAction.java
@@ -17,7 +17,6 @@ import org.eclipse.team.core.synchronize.FastSyncInfoFilter.OrSyncInfoFilter;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
public class MergeUpdateAction extends CVSParticipantAction {
@@ -42,8 +41,8 @@ public class MergeUpdateAction extends CVSParticipantAction {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
*/
- protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- return new MergeUpdateOperation(part, elements, promptBeforeUpdate);
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new MergeUpdateOperation(configuration, elements, promptBeforeUpdate);
}
public void setPromptBeforeUpdate(boolean prompt) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java
index bb86bd80e..fdd4b1d93 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeUpdateOperation.java
@@ -22,11 +22,14 @@ import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
+import org.eclipse.team.internal.ccvs.core.CVSSyncInfo;
+import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
/**
* This action performs a "cvs update -j start -j end ..." to merge changes
@@ -36,8 +39,8 @@ public class MergeUpdateOperation extends SafeUpdateOperation {
Subscriber currentSubcriber = null;
- protected MergeUpdateOperation(IWorkbenchPart part, IDiffElement[] elements, boolean promptBeforeUpdate) {
- super(part, elements, promptBeforeUpdate);
+ protected MergeUpdateOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements, boolean promptBeforeUpdate) {
+ super(configuration, elements, promptBeforeUpdate);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
index 5c47fcf44..340dc0e2e 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndCommitAction.java
@@ -16,7 +16,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
public class OverrideAndCommitAction extends CVSParticipantAction {
@@ -34,8 +33,8 @@ public class OverrideAndCommitAction extends CVSParticipantAction {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
*/
- protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- return new WorkspaceCommitOperation(part, elements, true /* override */);
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new WorkspaceCommitOperation(configuration, elements, true /* override */);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java
index 5acdaeeeb..2f46bfc98 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java
@@ -16,7 +16,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
/**
* Runs an update command that will prompt the user for overwritting local
@@ -36,7 +35,7 @@ public class OverrideAndUpdateAction extends CVSParticipantAction {
return new SyncInfoDirectionFilter(new int[] {SyncInfo.CONFLICTING, SyncInfo.OUTGOING});
}
- protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- return new OverrideAndUpdateSubscriberOperation(part, elements);
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new OverrideAndUpdateSubscriberOperation(configuration, elements);
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java
index 2bb005828..0f05ce9c7 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateSubscriberOperation.java
@@ -18,15 +18,17 @@ import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.synchronize.*;
+import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.OverrideAndUpdateOperation;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
public class OverrideAndUpdateSubscriberOperation extends CVSSubscriberOperation {
- protected OverrideAndUpdateSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- super(part, elements);
+ protected OverrideAndUpdateSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ super(configuration, elements);
}
/* (non-Javadoc)
* @see org.eclipse.team.ui.TeamOperation#shouldRun()
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateAction.java
index 89a43eefd..160aca024 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateAction.java
@@ -18,7 +18,6 @@ import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoChangeTypeFi
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
/**
* Resets the dirty state of files whose contents match their base.
@@ -44,7 +43,7 @@ public class RefreshDirtyStateAction extends CVSParticipantAction {
* @see org.eclipse.team.ui.synchronize.SynchronizeModelAction#getSubscriberOperation(org.eclipse.ui.IWorkbenchPart, org.eclipse.compare.structuremergeviewer.IDiffElement[])
*/
protected SynchronizeModelOperation getSubscriberOperation(
- IWorkbenchPart part, IDiffElement[] elements) {
- return new RefreshDirtyStateOperation(part, elements);
+ ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new RefreshDirtyStateOperation(configuration, elements);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java
index 90c971875..e749fe36b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/RefreshDirtyStateOperation.java
@@ -11,25 +11,30 @@
package org.eclipse.team.internal.ccvs.ui.subscriber;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
-import org.eclipse.team.core.synchronize.*;
+import org.eclipse.team.core.synchronize.SyncInfo;
+import org.eclipse.team.core.synchronize.SyncInfoFilter;
+import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.core.synchronize.SyncInfoFilter.ContentComparisonSyncInfoFilter;
-import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.ICVSRunnable;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
/**
* Resets the dirty state of files whose contents match their base.
*/
public class RefreshDirtyStateOperation extends CVSSubscriberOperation {
- protected RefreshDirtyStateOperation(IWorkbenchPart part, IDiffElement[] elements) {
- super(part, elements);
+ protected RefreshDirtyStateOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ super(configuration, elements);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java
index 13f8905ae..b83c707eb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/SafeUpdateOperation.java
@@ -15,6 +15,7 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -38,7 +39,7 @@ import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.UpdateOnlyMergableOperation;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
/**
* This update action will update all mergable resources first and then prompt the
@@ -53,8 +54,8 @@ public abstract class SafeUpdateOperation extends CVSSubscriberOperation {
private SyncInfoSet skipped = new SyncInfoSet();
- protected SafeUpdateOperation(IWorkbenchPart part, IDiffElement[] elements, boolean promptBeforeUpdate) {
- super(part, elements);
+ protected SafeUpdateOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements, boolean promptBeforeUpdate) {
+ super(configuration, elements);
this.promptBeforeUpdate = promptBeforeUpdate;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java
index efb49809e..d8aa8da25 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitAction.java
@@ -16,7 +16,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
public class WorkspaceCommitAction extends CVSParticipantAction {
@@ -34,7 +33,7 @@ public class WorkspaceCommitAction extends CVSParticipantAction {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
*/
- protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- return new WorkspaceCommitOperation(part, elements, false /* override */);
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new WorkspaceCommitOperation(configuration, elements, false /* override */);
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
index d81f192a6..fb5f11f77 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceCommitOperation.java
@@ -24,7 +24,9 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
-import org.eclipse.team.internal.ccvs.core.*;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.ICVSFolder;
+import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Commit;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
@@ -35,7 +37,7 @@ import org.eclipse.team.internal.ccvs.ui.operations.CommitOperation;
import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager;
import org.eclipse.team.internal.ccvs.ui.sync.ToolTipMessageDialog;
import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
public class WorkspaceCommitOperation extends CVSSubscriberOperation {
@@ -43,8 +45,8 @@ public class WorkspaceCommitOperation extends CVSSubscriberOperation {
private SyncInfoSet syncSet;
private boolean override;
- public WorkspaceCommitOperation(IWorkbenchPart part, IDiffElement[] elements, boolean override) {
- super(part, elements);
+ public WorkspaceCommitOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements, boolean override) {
+ super(configuration, elements);
this.override = override;
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
index 3b19ff84c..fe4d57930 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateAction.java
@@ -16,7 +16,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
-import org.eclipse.ui.IWorkbenchPart;
public class WorkspaceUpdateAction extends CVSParticipantAction {
@@ -36,8 +35,8 @@ public class WorkspaceUpdateAction extends CVSParticipantAction {
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
*/
- protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- return new WorkspaceUpdateOperation(part, elements, promptBeforeUpdate);
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new WorkspaceUpdateOperation(configuration, elements, promptBeforeUpdate);
}
public void setPromptBeforeUpdate(boolean prompt) {
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateOperation.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateOperation.java
index c1bfc6eaa..b35dc5896 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateOperation.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceUpdateOperation.java
@@ -13,7 +13,9 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.core.resources.*;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
@@ -25,15 +27,15 @@ import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.operations.ReplaceOperation;
-import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
/**
* This action performs an update for the CVSWorkspaceSubscriber.
*/
public class WorkspaceUpdateOperation extends SafeUpdateOperation {
- protected WorkspaceUpdateOperation(IWorkbenchPart part, IDiffElement[] elements, boolean promptBeforeUpdate) {
- super(part, elements, promptBeforeUpdate);
+ protected WorkspaceUpdateOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements, boolean promptBeforeUpdate) {
+ super(configuration, elements, promptBeforeUpdate);
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardPageActionGroup.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardPageActionGroup.java
index b1ddffac9..60057d774 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardPageActionGroup.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardPageActionGroup.java
@@ -22,7 +22,6 @@ import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelOperation;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
-import org.eclipse.ui.IWorkbenchPart;
/**
* Adviser used to add toolbar buttons to the last page of the sharing wizard.
@@ -49,8 +48,8 @@ public class SharingWizardPageActionGroup extends SynchronizePageActionGroup {
protected FastSyncInfoFilter getSyncInfoFilter() {
return new SyncInfoDirectionFilter(new int[] {SyncInfo.CONFLICTING, SyncInfo.OUTGOING});
}
- protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
- return new WorkspaceCommitOperation(part, elements, true /* override */);
+ protected SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ return new WorkspaceCommitOperation(configuration, elements, true /* override */);
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java
index ccaaad93a..c01530387 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java
@@ -142,6 +142,7 @@ public class SharingWizardSyncPage extends CVSWizardPage implements ISyncInfoSet
IWorkingSetManager manager = TeamUIPlugin.getPlugin().getWorkbench().getWorkingSetManager();
IWorkingSet newSet = manager.createWorkingSet("sharing wizard", new IAdaptable[] {project});
configuration.setWorkingSet(newSet);
+ configuration.setRunnableContext(getContainer());
CompareConfiguration cc = new CompareConfiguration();
cc.setLeftEditable(false);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
index 6dfcd5d4f..b7b132b92 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java
@@ -15,6 +15,7 @@ import java.util.Map;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.util.*;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.team.core.synchronize.SyncInfoSet;
@@ -102,6 +103,7 @@ public class SynchronizePageConfiguration extends SynchronizePageActionGroup imp
private Map properties = new HashMap();
private boolean actionsInitialized = false;
private ISynchronizePage page;
+ private IRunnableContext context;
/**
* Create a configuration for creating a page from the given particpant.
@@ -540,4 +542,18 @@ public class SynchronizePageConfiguration extends SynchronizePageActionGroup imp
public void setComparisonType(String type) {
setProperty(P_COMPARISON_TYPE,type);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration#setRunnableContext(org.eclipse.jface.operation.IRunnableContext)
+ */
+ public void setRunnableContext(IRunnableContext context) {
+ this.context = context;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration#getRunnableContext()
+ */
+ public IRunnableContext getRunnableContext() {
+ return context;
+ }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java
index cbd7646ec..2eceb112c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/TeamOperation.java
@@ -15,6 +15,7 @@ import java.net.URL;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
@@ -45,16 +46,36 @@ import org.eclipse.ui.IWorkbenchSite;
public abstract class TeamOperation extends JobChangeAdapter implements IRunnableWithProgress {
private IWorkbenchPart part;
+ private IRunnableContext context;
/**
* Create an team operation associated with the given part.
* @param part the part the operation is associated with or <code>null</code>
*/
protected TeamOperation(IWorkbenchPart part) {
- this.part = part;
+ this(part, null);
+ }
+
+ /**
+ * Create an team operation that will run in the given context.
+ * @param context a runnable context
+ */
+ protected TeamOperation(IRunnableContext context) {
+ this(null, context);
}
/**
+ * Create an team operation associated with the given part
+ * that will run in the given context.
+ * @param part the part the operation is associated with or <code>null</code>
+ * @param context a runnable context
+ */
+ protected TeamOperation(IWorkbenchPart part, IRunnableContext context) {
+ this.part = part;
+ this.context = context;
+ }
+
+ /**
* Return the part that is associated with this operation.
* @return Returns the part or <code>null</code>
*/
@@ -192,7 +213,7 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl
* @return the runnable context in which to run this action.
*/
private ITeamRunnableContext getRunnableContext() {
- if (canRunAsJob()) {
+ if (context == null && canRunAsJob()) {
JobRunnableContext context = new JobRunnableContext(getJobName(), getOperationIcon(), getGotoAction(), getKeepOperation(), this, getSite());
context.setPostponeBuild(isPostponeAutobuild());
context.setSchedulingRule(getSchedulingRule());
@@ -201,6 +222,9 @@ public abstract class TeamOperation extends JobChangeAdapter implements IRunnabl
ProgressDialogRunnableContext context = new ProgressDialogRunnableContext(getShell());
context.setPostponeBuild(isPostponeAutobuild());
context.setSchedulingRule(getSchedulingRule());
+ if (this.context != null) {
+ context.setRunnableContext(this.context);
+ }
return context;
}
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
index 1a763e520..1f988732f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.team.ui.synchronize;
+import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.team.core.synchronize.SyncInfoSet;
@@ -385,4 +386,19 @@ public interface ISynchronizePageConfiguration {
* or a cusom type).
*/
void setComparisonType(String type);
+
+ /**
+ * Sets the runnable context that can be used by the page's
+ * actions to display progress.
+ * @param context a runnable context (or null)
+ */
+ void setRunnableContext(IRunnableContext context);
+
+ /**
+ * Return the runnable context. If <code>null</code> is returned,
+ * actions can use their own method of progress feedback either
+ * using a background job or the progress service
+ * @return a runnable context (or <code>null</code>)
+ */
+ IRunnableContext getRunnableContext();
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageSite.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageSite.java
index df2f9d6b4..c9602f150 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageSite.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageSite.java
@@ -13,7 +13,10 @@ package org.eclipse.team.ui.synchronize;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.*;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IKeyBindingService;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchSite;
/**
* A site which provides access to the context in which this page
@@ -105,4 +108,5 @@ public interface ISynchronizePageSite {
* shown in a modal dialog
*/
boolean isModal();
+
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
index 7b1dad5bb..61a420308 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java
@@ -13,6 +13,7 @@ package org.eclipse.team.ui.synchronize;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
+
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -24,7 +25,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
-import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
/**
@@ -42,10 +42,9 @@ import org.eclipse.ui.actions.BaseSelectionListenerAction;
* @since 3.0
*/
public abstract class SynchronizeModelAction extends BaseSelectionListenerAction {
-
- // TODO: Should be replaced by sync site
- private IWorkbenchPart part;
+ private ISynchronizePageConfiguration configuration;
+
/**
* Create an action with the given text and configuration.
* @param text the action's text
@@ -53,6 +52,7 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
*/
protected SynchronizeModelAction(String text, ISynchronizePageConfiguration configuration) {
super(text);
+ this.configuration = configuration;
initialize(configuration);
}
@@ -78,7 +78,7 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
// TODO: We used to prompt for unsaved changes in any editor. We don't anymore. Would
// it be better to prompt for unsaved changes to editors affected by this action?
try {
- getSubscriberOperation(part, getFilteredDiffElements()).run();
+ getSubscriberOperation(configuration, getFilteredDiffElements()).run();
} catch (InvocationTargetException e) {
handle(e);
} catch (InterruptedException e) {
@@ -91,10 +91,12 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
* will be run when the action is run. Subclass may implement this method and provide
* an operation subclass or may override the <code>run(IAction)</code> method directly
* if they choose not to implement a <code>SynchronizeModelOperation</code>.
+ * @param configuration the synchronize page configuration for the page
+ * to which this action is associated
* @param elements the selected diff element for which this action is enabled.
* @return the subscriber operation to be run by this action.
*/
- protected abstract SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements);
+ protected abstract SynchronizeModelOperation getSubscriberOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements);
/**
* Generic error handling code that uses an error dialog to show the error to the
@@ -165,4 +167,11 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
}
}
+
+ /**
+ * @return Returns the configuration.
+ */
+ public ISynchronizePageConfiguration getConfiguration() {
+ return configuration;
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelOperation.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelOperation.java
index dab39fbcd..363cb0462 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelOperation.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelOperation.java
@@ -19,7 +19,6 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.ui.TeamOperation;
-import org.eclipse.ui.IWorkbenchPart;
/**
* A subscriber operation provides access to a {@link SyncInfoSet} containing
@@ -37,13 +36,13 @@ public abstract class SynchronizeModelOperation extends TeamOperation {
private IDiffElement[] elements;
/**
- * Create a subscriber operation that will operate on the given diff elements
+ * Create an operation that will operate on the given diff elements
* that were obtained from a view populated by a
* {@link org.eclipse.team.ui.synchronize.viewers.SynchronizeModelProvider}.
* @param elements
*/
- protected SynchronizeModelOperation(IWorkbenchPart part, IDiffElement[] elements) {
- super(part);
+ protected SynchronizeModelOperation(ISynchronizePageConfiguration configuration, IDiffElement[] elements) {
+ super(configuration.getSite().getPart(), configuration.getRunnableContext());
this.elements = elements;
}

Back to the top