Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-05-05 22:47:54 -0400
committerMichael Valenta2004-05-05 22:47:54 -0400
commit2a65310d1fddda95751fa7df69c410116af525cc (patch)
treed1af411a389987c81347e6c3c34e69ba3f02f055
parent4e09361c26b08bcacfa17fe77f253651d4b6cc2f (diff)
downloadeclipse.platform.team-2a65310d1fddda95751fa7df69c410116af525cc.tar.gz
eclipse.platform.team-2a65310d1fddda95751fa7df69c410116af525cc.tar.xz
eclipse.platform.team-2a65310d1fddda95751fa7df69c410116af525cc.zip
*** empty log message ***
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml203
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java4
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties44
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java43
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantAction.java25
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CompareParticipant.java47
-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/ConfirmMergedAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java91
-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/OverrideAndCommitAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/OverrideAndUpdateAction.java7
-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/WorkspaceCommitAction.java5
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java101
-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/wizards/SharingWizardPageActionGroup.java56
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/SharingWizardSyncPage.java2
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java65
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java77
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizePageConfiguration.java1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/WorkbenchPartSynchronizePageSite.java7
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageConfiguration.java11
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ISynchronizePageSite.java8
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java6
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizeModelAction.java43
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java72
28 files changed, 529 insertions, 431 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 41c01f221..5f979d393 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -607,209 +607,6 @@
</action>
</objectContribution>
</extension>
-<!-- ************* Subscriber Menus ************ -->
- <extension
- point="org.eclipse.ui.popupMenus">
- <viewerContribution
- targetID="org.eclipse.team.cvs.ui.cvsworkspace-participant"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriberContributions">
- <action
- label="%CVSWorkspaceSubscriber.commit.label"
- overrideActionId="org.eclipse.team.ccvs.ui.commit"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_commit_action"
- tooltip="%CVSWorkspaceSubscriber.commit.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberCommitAction"
- menubarPath="SubscriberActionsGroup1"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.commit">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.update.label"
- overrideActionId="org.eclipse.team.ccvs.ui.update"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_update_action"
- tooltip="%CVSWorkspaceSubscriber.update.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceUpdateAction"
- menubarPath="SubscriberActionsGroup1"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.update">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.confirmMerged.label"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
- tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
- menubarPath="SubscriberActionsGroup2"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.confirmMerged">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.overcommit.label"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overcommit_action"
- tooltip="%CVSWorkspaceSubscriber.overcommit.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndCommitAction"
- menubarPath="SubscriberActionsGroup2"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overcommit">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.overupdate.label"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_overupdate_action"
- tooltip="%CVSWorkspaceSubscriber.overupdate.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.OverrideAndUpdateAction"
- menubarPath="SubscriberActionsGroup2"
- id="org.eclipse.team.ccvs.ui.CVSWorkspaceSubscriber.overupdate">
- </action>
- <action
- label="%ShowHistoryAction.label"
- icon="icons/full/ctool16/history.gif"
- helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
- tooltip="%ShowHistoryAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.showHistory">
- </action>
- <action
- label="%ShowAnnotationAction.label"
- icon="icons/full/ctool16/annotate.gif"
- helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
- tooltip="%ShowAnnotationAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.showAnnotation">
- </action>
- <action
- label="%BranchAction.label"
- icon="icons/full/clcl16/newstream_wiz.gif"
- helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context"
- tooltip="%BranchAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.branch">
- </action>
- <action
- label="%GenerateDiff.label"
- helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context"
- tooltip="%GenerateDiff.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.GenerateDiff">
- </action>
- <action
- label="%IgnoreAction.label"
- helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context"
- tooltip="%IgnoreAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.ignore">
- </action>
- <action
- label="%RefreshDirtyStateAction.label"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_refresh_dirty_state_action_context"
- tooltip="%RefreshDirtyStateAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.RefreshDirtyStateAction"
- menubarPath="SubscriberActionsGroup4"
- id="org.eclipse.team.ccvs.ui.ignore">
- </action>
- </viewerContribution>
- <viewerContribution
- targetID="org.eclipse.team.cvs.ui.cvsmerge-participant"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriberContributions">
- <action
- label="%CVSWorkspaceSubscriber.confirmMerged.label"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
- tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
- menubarPath="SubscriberActionsGroup1"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.confirmMerged">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.merge.label"
- overrideActionId="org.eclipse.team.ccvs.ui.update"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_merge_action"
- tooltip="%CVSWorkspaceSubscriber.merge.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeUpdateAction"
- menubarPath="SubscriberActionsGroup1"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.merge">
- </action>
- <action
- label="%ShowHistoryAction.label"
- icon="icons/full/ctool16/history.gif"
- helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
- tooltip="%ShowHistoryAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.showHistory">
- </action>
- <action
- label="%ShowAnnotationAction.label"
- icon="icons/full/ctool16/annotate.gif"
- helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
- tooltip="%ShowAnnotationAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.showAnnotation">
- </action>
- </viewerContribution>
- <viewerContribution
- targetID="org.eclipse.team.cvs.ui.cvsmerge-participant-modal"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriberContributions">
- <action
- label="%CVSWorkspaceSubscriber.confirmMerged.label"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_confirm_merged_action"
- tooltip="%CVSWorkspaceSubscriber.confirmMerged.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.SubscriberConfirmMergedAction"
- menubarPath="SubscriberActionsGroup1"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.confirmMerged">
- </action>
- <action
- label="%CVSWorkspaceSubscriber.merge.label"
- overrideActionId="org.eclipse.team.ccvs.ui.update"
- helpContextId="org.eclipse.team.cvs.ui.workspace_subscriber_merge_action"
- tooltip="%CVSWorkspaceSubscriber.merge.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.MergeUpdateAction"
- menubarPath="SubscriberActionsGroup1"
- id="org.eclipse.team.ccvs.ui.CVSMergeSubscriber.merge">
- </action>
- </viewerContribution>
- <viewerContribution
- targetID="org.eclipse.team.cvs.ui.compare-participant"
- id="org.eclipse.team.ccvs.ui.CVSCompareSubscriberContributions">
- <action
- label="%CVSCompareSubscriber.revert.label"
- helpContextId="org.eclipse.team.cvs.ui.compare_revert_action"
- tooltip="%CVSCompareSubscriber.revert.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.CompareRevertAction"
- menubarPath="SubscriberActionsGroup1"
- id="org.eclipse.team.ccvs.ui.CVSCompareSubscriber.revert">
- </action>
- <action
- label="%ShowHistoryAction.label"
- icon="icons/full/ctool16/history.gif"
- helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context"
- tooltip="%ShowHistoryAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.showHistory">
- </action>
- <action
- label="%ShowAnnotationAction.label"
- icon="icons/full/ctool16/annotate.gif"
- helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context"
- tooltip="%ShowAnnotationAction.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction"
- menubarPath="SubscriberActionsGroup3"
- id="org.eclipse.team.ccvs.ui.showAnnotation">
- </action>
- </viewerContribution>
- <viewerContribution
- targetID="org.eclipse.team.cvs.ui.compare-participant-modal"
- id="org.eclipse.team.ccvs.ui.CVSCompareSubscriberContributions">
- <action
- label="%CVSCompareSubscriber.revert.label"
- helpContextId="org.eclipse.team.cvs.ui.compare_revert_action"
- tooltip="%CVSCompareSubscriber.revert.tooltip"
- class="org.eclipse.team.internal.ccvs.ui.subscriber.CompareRevertAction"
- menubarPath="SubscriberActionsGroup1"
- id="org.eclipse.team.ccvs.ui.CVSCompareSubscriber.revert">
- </action>
- </viewerContribution>
- </extension>
<!-- ************** Views ********************** -->
<extension
point="org.eclipse.ui.views">
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
index 6d269f59d..8468da215 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CompareWithTagAction.java
@@ -18,7 +18,8 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.ui.*;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.TagSelectionDialog;
import org.eclipse.team.internal.ccvs.ui.subscriber.CompareParticipant;
@@ -48,7 +49,6 @@ public class CompareWithTagAction extends WorkspaceAction {
ISynchronizePageConfiguration.NAVIGATE_GROUP,
ISynchronizePageConfiguration.MODE_GROUP,
ISynchronizePageConfiguration.LAYOUT_GROUP });
- configuration.setProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID, CVSCompareSubscriber.ID_MODAL);
participant.refreshInDialog(getShell(), resources, Policy.bind("Participant.comparing"), participant.getName(), configuration, null); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
index 78da800a4..3c1f2fe1d 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/merge/MergeWizard.java
@@ -18,13 +18,14 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber;
import org.eclipse.team.internal.ccvs.core.CVSTag;
-import org.eclipse.team.internal.ccvs.ui.*;
+import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
+import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.subscriber.MergeSynchronizeParticipant;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
-import org.eclipse.ui.*;
public class MergeWizard extends Wizard {
MergeWizardStartPage startPage;
@@ -52,12 +53,6 @@ public class MergeWizard extends Wizard {
*/
public boolean performFinish() {
- IWorkbenchWindow wWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- IWorkbenchPage activePage = null;
- if(wWindow != null) {
- activePage = wWindow.getActivePage();
- }
-
CVSTag startTag = startPage.getTag();
CVSTag endTag = endPage.getTag();
@@ -74,7 +69,6 @@ public class MergeWizard extends Wizard {
ISynchronizePageConfiguration.NAVIGATE_GROUP,
ISynchronizePageConfiguration.MODE_GROUP,
ISynchronizePageConfiguration.LAYOUT_GROUP });
- configuration.setProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID, CVSMergeSubscriber.ID_MODAL);
participant.refreshInDialog(Utils.findShell(), s.roots(), Policy.bind("Participant.merging"), Policy.bind("Participant.mergingDetail", participant.getName()), configuration, null); //$NON-NLS-1$ //$NON-NLS-2$
}
return true;
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 5ce37dbb8..d4cf7a8a5 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
@@ -1044,20 +1044,20 @@ RemoteRevisionQuickDiffProvider.closingFile=Error closing remote file
RemoteRevisionQuickDiffProvider.fetchingFile=CVS QuickDiff: fetching remote contents for ''{0}''
RemoteCompareOperation.0=Comparing tags {0} and {1} of {2}
-action.SynchronizeViewCommit.label=Commit
-action.SynchronizeViewCommit.tooltip=Commit All Outgoing Changes...
-action.SynchronizeViewCommit.description=Commit All Outgoing Changes...
-action.SynchronizeViewCommit.image=checkin_action.gif
+WorkspaceToolbarCommitAction.label=Commit
+WorkspaceToolbarCommitAction.tooltip=Commit All Outgoing Changes...
+WorkspaceToolbarCommitAction.description=Commit All Outgoing Changes...
+WorkspaceToolbarCommitAction.image=checkin_action.gif
-action.SynchronizeViewUpdate.label=Update
-action.SynchronizeViewUpdate.tooltip=Update All Incoming Changes...
-action.SynchronizeViewUpdate.description=Update All Incoming Changes...
-action.SynchronizeViewUpdate.image=checkout_action.gif
+WorkspaceToolbarUpdateAction.label=Update
+WorkspaceToolbarUpdateAction.tooltip=Update All Incoming Changes...
+WorkspaceToolbarUpdateAction.description=Update All Incoming Changes...
+WorkspaceToolbarUpdateAction.image=checkout_action.gif
-action.SharingWizardIgnore.label=Ignore
-action.SharingWizardIgnore.tooltip=Ignore Selected Resources...
-action.SharingWizardIgnore.description=Ignore Selected Resources...
-action.SharingWizardIgnore.image=ignorefiles.gif
+SharingWizardIgnore.label=Ignore
+SharingWizardIgnore.tooltip=Ignore Selected Resources...
+SharingWizardIgnore.description=Ignore Selected Resources...
+SharingWizardIgnore.image=ignorefiles.gif
WorkspaceUpdateAction.label=&Update
WorkspaceUpdateAction.tooltip=Perform an update on the selected resources
@@ -1083,6 +1083,21 @@ ConfirmMergedAction.label=&Mark as Merged
ConfirmMergedAction.tooltip=Mark the conflict as merged by upgrading the base to match the remote
ConfirmMergedAction.helpContextId=org.eclipse.team.cvs.ui.workspace_confirm_merged_action
+BranchAction.label=&Branch...
+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
+
+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.
+
MergeUpdateAction.label=&Update
MergeUpdateAction.tooltip=Perform an update merge on the selected resources
MergeUpdateAction.helpContextId=org.eclipse.team.cvs.ui.merge_update_action
@@ -1091,6 +1106,11 @@ CompareRevertAction.label=&Override and Update
CompareRevertAction.tooltip=Revert the local file contents to match that of their corresponding remotes
CompareRevertAction.helpContextId=org.eclipse.team.cvs.ui.compare_revert_action
+SharingCommitAction.label=Commit
+SharingCommitAction.tooltip=Commit All Changes...
+SharingCommitAction.description=Commit All Changes...
+SharingCommitAction.image=checkin_action.gif
+
MergeSynchronizeParticipant.8=Missing id initializing cvs merge participant
MergeSynchronizeParticipant.9=Unable to initialize cvs merge subscriber
MergeSynchronizeParticipant.10=Missing root nodes in cvs merge subscriber memento: {0}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java
new file mode 100644
index 000000000..1cff07326
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSActionDelegateWrapper.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.team.internal.ccvs.ui.subscriber;
+
+import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.internal.ui.synchronize.ActionDelegateWrapper;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.ui.IActionDelegate;
+
+/**
+ * Superclass of CVS participant action delegates that uses the classname as the key
+ * to access the text from the resource bundle
+ */
+public class CVSActionDelegateWrapper extends ActionDelegateWrapper {
+
+ public CVSActionDelegateWrapper(IActionDelegate delegate, ISynchronizePageConfiguration configuration) {
+ super(delegate, configuration);
+ Utils.initAction(this, getBundleKeyPrefix(), Policy.getBundle());
+ }
+
+ /**
+ * Return the key to the action text in the resource bundle.
+ * The default is the class name followed by a dot (.).
+ * @return the bundle key prefix
+ */
+ protected String getBundleKeyPrefix() {
+ String name = getDelegate().getClass().getName();
+ int lastDot = name.lastIndexOf("."); //$NON-NLS-1$
+ if (lastDot == -1) {
+ return name;
+ }
+ return name.substring(lastDot + 1) + "."; //$NON-NLS-1$
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantAction.java
index 0100f4092..4b00b5a32 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantAction.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/CVSParticipantAction.java
@@ -10,18 +10,21 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ui.Utils;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizeModelAction;
/**
- * Superclass of CVS particpant actions that uses the classname as the key
+ * Superclass of CVS participant actions that uses the classname as the key
* to access the text from the resource bundle
*/
public abstract class CVSParticipantAction extends SynchronizeModelAction {
- protected CVSParticipantAction() {
- super(null);
+ protected CVSParticipantAction(ISynchronizePageConfiguration configuration) {
+ super(null, configuration);
Utils.initAction(this, getBundleKeyPrefix(), Policy.getBundle());
}
@@ -31,6 +34,20 @@ public abstract class CVSParticipantAction extends SynchronizeModelAction {
* @return the bundle key prefix
*/
protected String getBundleKeyPrefix() {
- return getClass().getName() + ".";
+ String name = getClass().getName();
+ int lastDot = name.lastIndexOf("."); //$NON-NLS-1$
+ if (lastDot == -1) {
+ return name;
+ }
+ return name.substring(lastDot + 1) + "."; //$NON-NLS-1$
+ }
+
+ /**
+ * Set the selection of the action to the given object
+ * @param input the selected object
+ */
+ public void setSelection(Object input) {
+ IStructuredSelection selection = new StructuredSelection(input);
+ selectionChanged(selection);
}
}
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 bc329caf1..10732c0dd 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
@@ -21,12 +21,43 @@ import org.eclipse.team.core.synchronize.SyncInfoFilter;
import org.eclipse.team.internal.ccvs.core.CVSCompareSubscriber;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
+import org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction;
+import org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction;
import org.eclipse.team.ui.TeamUI;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
+import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
public class CompareParticipant extends CVSParticipant implements IPropertyChangeListener {
+ public static final String CONTEXT_MENU_CONTRIBUTION_GROUP = "context_group_1"; //$NON-NLS-1$
+ public static final String NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP = "context_group_2"; //$NON-NLS-1$
+
+ /**
+ * Actions for the compare particpant's toolbar
+ */
+ public class CompareParticipantActionContribution extends SynchronizePageActionGroup {
+ public void initialize(ISynchronizePageConfiguration configuration) {
+ super.initialize(configuration);
+
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP,
+ new CompareRevertAction(configuration));
+
+ if (!configuration.getSite().isModal()) {
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP,
+ new CVSActionDelegateWrapper(new ShowAnnotationAction(), configuration));
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP,
+ new CVSActionDelegateWrapper(new ShowResourceInHistoryAction(), configuration));
+ }
+ }
+ }
+
private SyncInfoFilter contentComparison = new SyncInfoFilter() {
private SyncInfoFilter contentCompare = new SyncInfoFilter.ContentComparisonSyncInfoFilter();
public boolean select(SyncInfo info, IProgressMonitor monitor) {
@@ -64,13 +95,6 @@ public class CompareParticipant extends CVSParticipant implements IPropertyChang
public String getName() {
return getSubscriber().getName();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant#isPersistent()
- */
- public boolean isPersistent() {
- return false;
- }
/* (non-Javadoc)
* @see org.eclipse.team.ui.synchronize.subscribers.SubscriberParticipant#initializeConfiguration(org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration)
@@ -78,6 +102,15 @@ public class CompareParticipant extends CVSParticipant implements IPropertyChang
protected void initializeConfiguration(ISynchronizePageConfiguration configuration) {
super.initializeConfiguration(configuration);
configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, ISynchronizePageConfiguration.REMOVE_PARTICPANT_GROUP);
+ 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.addActionContribution(new CompareParticipantActionContribution());
}
/* (non-Javadoc)
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 beece89df..949181633 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
@@ -11,6 +11,7 @@
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;
@@ -19,6 +20,10 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class CompareRevertAction extends CVSParticipantAction {
+ public CompareRevertAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSubscriberOperation(org.eclipse.compare.structuremergeviewer.IDiffElement[])
*/
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 520c35831..6b57fba4f 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
@@ -14,11 +14,16 @@ import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
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 {
+ public ConfirmMergedAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
index 48b52e7ea..932037678 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/MergeSynchronizeParticipant.java
@@ -12,19 +12,30 @@ package org.eclipse.team.internal.ccvs.ui.subscriber;
import java.util.ArrayList;
import java.util.List;
+
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.team.core.subscribers.Subscriber;
-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.CVSProviderPlugin;
+import org.eclipse.team.internal.ccvs.core.CVSStatus;
+import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.synchronize.ActionDelegateWrapper;
+import org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction;
+import org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction;
import org.eclipse.team.ui.TeamUI;
-import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.ui.*;
+import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipantDescriptor;
+import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.PartInitException;
public class MergeSynchronizeParticipant extends CVSParticipant {
@@ -32,9 +43,11 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
* The id of a workspace action group to which additions actions can
* be added.
*/
- public static final String ACTION_GROUP = "cvs_merge_actions"; //$NON-NLS-1$
-
+ public static final String TOOLBAR_CONTRIBUTION_GROUP = "toolbar_group"; //$NON-NLS-1$
+ public static final String CONTEXT_MENU_CONTRIBUTION_GROUP = "context_group_1"; //$NON-NLS-1$
+ public static final String NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP = "context_group_2"; //$NON-NLS-1$
+
private final static String CTX_ROOT = "root"; //$NON-NLS-1$
private final static String CTX_ROOT_PATH = "root_resource"; //$NON-NLS-1$
private final static String CTX_START_TAG = "start_tag"; //$NON-NLS-1$
@@ -46,23 +59,49 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
* Actions for the merge particpant's toolbar
*/
public class MergeParticipantActionContribution extends SynchronizePageActionGroup {
- private ActionDelegateWrapper updateAdapter;
+ private MergeUpdateAction updateAction;
public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
- MergeUpdateAction action = new MergeUpdateAction();
- action.setPromptBeforeUpdate(true);
- updateAdapter = new ActionDelegateWrapper(action, configuration.getSite().getPart());
- Utils.initAction(updateAdapter, "action.SynchronizeViewUpdate.", Policy.getBundle()); //$NON-NLS-1$
- super.initialize(configuration);
+
+ updateAction = new MergeUpdateAction(configuration) {
+ protected void initialize(ISynchronizePageConfiguration configuration) {
+ // Override to avoid registering a selection listener
+ }
+ protected String getBundleKeyPrefix() {
+ return "WorkspaceToolbarUpdateAction."; //$NON-NLS-1$
+ }
+ };
+ updateAction.setPromptBeforeUpdate(true);
+ appendToGroup(
+ ISynchronizePageConfiguration.P_TOOLBAR_MENU,
+ TOOLBAR_CONTRIBUTION_GROUP,
+ updateAction);
+
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP,
+ new MergeUpdateAction(configuration));
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP,
+ new ConfirmMergedAction(configuration));
+
+ if (!configuration.getSite().isModal()) {
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP,
+ new CVSActionDelegateWrapper(new ShowAnnotationAction(), configuration));
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP,
+ new CVSActionDelegateWrapper(new ShowResourceInHistoryAction(), configuration));
+ }
+
}
public void modelChanged(ISynchronizeModelElement input) {
- if (updateAdapter == null) return;
- updateAdapter.setSelection(input);
- }
- public void fillActionBars(IActionBars actionBars) {
- IToolBarManager toolbar = actionBars.getToolBarManager();
- appendToGroup(toolbar, ACTION_GROUP, updateAdapter);
- super.fillActionBars(actionBars);
+ if (updateAction != null) {
+ updateAction.setSelection(input);
+ }
}
}
@@ -192,8 +231,14 @@ public class MergeSynchronizeParticipant extends CVSParticipant {
*/
protected void initializeConfiguration(ISynchronizePageConfiguration configuration) {
super.initializeConfiguration(configuration);
- configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, ACTION_GROUP);
+ configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, TOOLBAR_CONTRIBUTION_GROUP);
configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, ISynchronizePageConfiguration.REMOVE_PARTICPANT_GROUP);
+ configuration.addMenuGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP);
+ configuration.addMenuGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ NON_MODAL_CONTEXT_MENU_CONTRIBUTION_GROUP);
configuration.setSupportedModes(ISynchronizePageConfiguration.INCOMING_MODE | ISynchronizePageConfiguration.CONFLICTING_MODE);
configuration.setMode(ISynchronizePageConfiguration.INCOMING_MODE);
configuration.addActionContribution(new MergeParticipantActionContribution());
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 5cd8b01d6..1c285325c 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
@@ -15,12 +15,17 @@ import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
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 {
+ public MergeUpdateAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+
private boolean 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 45279cdaf..5c47fcf44 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
@@ -14,11 +14,16 @@ import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
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 {
+ public OverrideAndCommitAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.internal.ui.actions.SubscriberAction#getSyncInfoFilter()
*/
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 3be4cfee0..5acdaeeeb 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
@@ -14,6 +14,7 @@ import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
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;
@@ -24,6 +25,10 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class OverrideAndUpdateAction extends CVSParticipantAction {
+ public OverrideAndUpdateAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
*/
@@ -34,4 +39,4 @@ public class OverrideAndUpdateAction extends CVSParticipantAction {
protected SynchronizeModelOperation getSubscriberOperation(IWorkbenchPart part, IDiffElement[] elements) {
return new OverrideAndUpdateSubscriberOperation(part, elements);
}
-}
+} \ No newline at end of file
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 9a7897581..89a43eefd 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
@@ -16,6 +16,7 @@ import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.AndSyncInfoFilter;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoChangeTypeFilter;
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;
@@ -24,6 +25,10 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class RefreshDirtyStateAction extends CVSParticipantAction {
+ public RefreshDirtyStateAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
*/
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 226c2fafc..efb49809e 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
@@ -14,11 +14,16 @@ import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
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 {
+ public WorkspaceCommitAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
*/
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
index b0de5868d..b12f5b097 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/subscriber/WorkspaceSynchronizeParticipant.java
@@ -10,16 +10,16 @@
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui.subscriber;
-import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
-import org.eclipse.team.internal.ccvs.ui.Policy;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.synchronize.ActionDelegateWrapper;
+import org.eclipse.team.internal.ccvs.ui.actions.BranchAction;
+import org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction;
+import org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction;
+import org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction;
+import org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
-import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.PartInitException;
@@ -31,63 +31,104 @@ public class WorkspaceSynchronizeParticipant extends CVSParticipant {
* The id of a workspace action group to which additions actions can
* be added.
*/
- public static final String ACTION_GROUP = "cvs_workspace_actions"; //$NON-NLS-1$
+ public static final String TOOLBAR_CONTRIBUTION_GROUP = "toolbar_group_1"; //$NON-NLS-1$
public static final String CONTEXT_MENU_CONTRIBUTION_GROUP_1 = "context_group_1"; //$NON-NLS-1$
public static final String CONTEXT_MENU_CONTRIBUTION_GROUP_2 = "context_group_2"; //$NON-NLS-1$
public static final String CONTEXT_MENU_CONTRIBUTION_GROUP_3 = "context_group_3"; //$NON-NLS-1$
public static final String CONTEXT_MENU_CONTRIBUTION_GROUP_4 = "context_group_4"; //$NON-NLS-1$
+
/**
* CVS workspace action contribution
*/
public class WorkspaceActionContribution extends SynchronizePageActionGroup {
- private ActionDelegateWrapper commitToolbar;
- private ActionDelegateWrapper updateToolbar;
+ private WorkspaceCommitAction commitToolbar;
+ private WorkspaceUpdateAction updateToolbar;
public void initialize(ISynchronizePageConfiguration configuration) {
super.initialize(configuration);
- commitToolbar = new ActionDelegateWrapper(new WorkspaceCommitAction(), configuration.getSite().getPart());
- WorkspaceUpdateAction action = new WorkspaceUpdateAction();
- action.setPromptBeforeUpdate(true);
- updateToolbar = new ActionDelegateWrapper(action, configuration.getSite().getPart());
- Utils.initAction(commitToolbar, "action.SynchronizeViewCommit.", Policy.getBundle()); //$NON-NLS-1$
- Utils.initAction(updateToolbar, "action.SynchronizeViewUpdate.", Policy.getBundle()); //$NON-NLS-1$
+
+ updateToolbar = new WorkspaceUpdateAction(configuration) {
+ protected void initialize(ISynchronizePageConfiguration configuration) {
+ // Override to prevent registering as a selection listener
+ }
+ protected String getBundleKeyPrefix() {
+ return "WorkspaceToolbarUpdateAction."; //$NON-NLS-1$
+ }
+ };
+ updateToolbar.setPromptBeforeUpdate(true);
+ appendToGroup(
+ ISynchronizePageConfiguration.P_TOOLBAR_MENU,
+ TOOLBAR_CONTRIBUTION_GROUP,
+ updateToolbar);
+
+ commitToolbar = new WorkspaceCommitAction(configuration) {
+ protected void initialize(ISynchronizePageConfiguration configuration) {
+ // Override to prevent registering as a selection listener
+ }
+ protected String getBundleKeyPrefix() {
+ return "WorkspaceToolbarCommitAction."; //$NON-NLS-1$
+ }
+ };
+ appendToGroup(
+ ISynchronizePageConfiguration.P_TOOLBAR_MENU,
+ TOOLBAR_CONTRIBUTION_GROUP,
+ commitToolbar);
appendToGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP_1,
- new WorkspaceUpdateAction());
+ new WorkspaceUpdateAction(configuration));
appendToGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP_1,
- new WorkspaceCommitAction());
+ new WorkspaceCommitAction(configuration));
appendToGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP_2,
- new OverrideAndUpdateAction());
+ new OverrideAndUpdateAction(configuration));
appendToGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP_2,
- new OverrideAndCommitAction());
+ new OverrideAndCommitAction(configuration));
appendToGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP_2,
- new ConfirmMergedAction());
+ new ConfirmMergedAction(configuration));
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP_3,
+ new CVSActionDelegateWrapper(new IgnoreAction(), configuration));
+ if (!configuration.getSite().isModal()) {
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP_3,
+ new CVSActionDelegateWrapper(new GenerateDiffFileAction(), configuration));
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP_3,
+ new CVSActionDelegateWrapper(new BranchAction(), configuration));
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP_3,
+ new CVSActionDelegateWrapper(new ShowAnnotationAction(), configuration));
+ appendToGroup(
+ ISynchronizePageConfiguration.P_CONTEXT_MENU,
+ CONTEXT_MENU_CONTRIBUTION_GROUP_3,
+ new CVSActionDelegateWrapper(new ShowResourceInHistoryAction(), configuration));
+ }
appendToGroup(
ISynchronizePageConfiguration.P_CONTEXT_MENU,
CONTEXT_MENU_CONTRIBUTION_GROUP_4,
- new RefreshDirtyStateAction());
- }
- public void fillActionBars(IActionBars actionBars) {
- IToolBarManager toolbar = actionBars.getToolBarManager();
- appendToGroup(toolbar, ACTION_GROUP, updateToolbar);
- appendToGroup(toolbar, ACTION_GROUP, commitToolbar);
- super.fillActionBars(actionBars);
+ new RefreshDirtyStateAction(configuration));
}
public void modelChanged(ISynchronizeModelElement element) {
- if (commitToolbar == null) return;
- commitToolbar.setSelection(element);
- updateToolbar.setSelection(element);
+ if (commitToolbar != null) {
+ commitToolbar.setSelection(element);
+ }
+ if (updateToolbar != null) {
+ updateToolbar.setSelection(element);
+ }
}
}
@@ -105,7 +146,7 @@ public class WorkspaceSynchronizeParticipant extends CVSParticipant {
*/
protected void initializeConfiguration(ISynchronizePageConfiguration configuration) {
super.initializeConfiguration(configuration);
- configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, ACTION_GROUP);
+ configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, TOOLBAR_CONTRIBUTION_GROUP);
configuration.addActionContribution(new WorkspaceActionContribution());
configuration.setSupportedModes(ISynchronizePageConfiguration.ALL_MODES);
configuration.setMode(ISynchronizePageConfiguration.BOTH_MODE);
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 00caf2bc4..3b19ff84c 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
@@ -14,6 +14,7 @@ import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
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;
@@ -21,6 +22,10 @@ public class WorkspaceUpdateAction extends CVSParticipantAction {
private boolean promptBeforeUpdate;
+ public WorkspaceUpdateAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.team.ui.sync.SubscriberAction#getSyncInfoFilter()
*/
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 0eaeaf3dd..b1ddffac9 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
@@ -11,17 +11,17 @@
package org.eclipse.team.internal.ccvs.ui.wizards;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
-import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter.SyncInfoDirectionFilter;
-import org.eclipse.team.internal.ccvs.ui.Policy;
import org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction;
+import org.eclipse.team.internal.ccvs.ui.subscriber.CVSActionDelegateWrapper;
+import org.eclipse.team.internal.ccvs.ui.subscriber.CVSParticipantAction;
import org.eclipse.team.internal.ccvs.ui.subscriber.WorkspaceCommitOperation;
-import org.eclipse.team.internal.ui.Utils;
-import org.eclipse.team.internal.ui.synchronize.ActionDelegateWrapper;
-import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.ui.IActionBars;
+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;
/**
@@ -29,14 +29,23 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class SharingWizardPageActionGroup extends SynchronizePageActionGroup {
- private ActionDelegateWrapper commitAction;
- private ActionDelegateWrapper ignoreAction;
public static final String ACTION_GROUP = "cvs_sharing_page_actions"; //$NON-NLS-1$
+
+ private SharingCommitAction commitAction;
/**
* Custom commit that includes outgoing and conflicting.
*/
- class SharingCommitAction extends SynchronizeModelAction {
+ class SharingCommitAction extends CVSParticipantAction {
+ protected SharingCommitAction(ISynchronizePageConfiguration configuration) {
+ super(configuration);
+ }
+ protected void initialize(ISynchronizePageConfiguration configuration) {
+ // Override to avoid being registered as a selection listener
+ }
+ protected String getBundleKeyPrefix() {
+ return "SharingCommitAction."; //$NON-NLS-1$
+ }
protected FastSyncInfoFilter getSyncInfoFilter() {
return new SyncInfoDirectionFilter(new int[] {SyncInfo.CONFLICTING, SyncInfo.OUTGOING});
}
@@ -53,23 +62,20 @@ public class SharingWizardPageActionGroup extends SynchronizePageActionGroup {
super.initialize(configuration);
configuration.addMenuGroup(ISynchronizePageConfiguration.P_TOOLBAR_MENU, ACTION_GROUP);
- commitAction = new ActionDelegateWrapper(new SharingCommitAction(), null /* view part */);
- Utils.initAction(commitAction, "action.SynchronizeViewCommit.", Policy.getBundle()); //$NON-NLS-1$
-
- ignoreAction = new ActionDelegateWrapper(new IgnoreAction(), null /* view part */);
- Utils.initAction(ignoreAction, "action.SharingWizardIgnore.", Policy.getBundle()); //$NON-NLS-1$
- }
+ commitAction = new SharingCommitAction(configuration);
+ appendToGroup(
+ ISynchronizePageConfiguration.P_TOOLBAR_MENU,
+ ACTION_GROUP,
+ commitAction);
- /* (non-Javadoc)
- * @see org.eclipse.team.ui.synchronize.viewers.StructuredViewerAdvisor#setActionBars(org.eclipse.ui.IActionBars)
- */
- public void fillActionBars(IActionBars actionBars) {
- super.fillActionBars(actionBars);
- IToolBarManager toolbar = actionBars.getToolBarManager();
- if (toolbar != null) {
- appendToGroup(toolbar, ACTION_GROUP, commitAction);
- appendToGroup(toolbar, ACTION_GROUP, ignoreAction);
- }
+ appendToGroup(
+ ISynchronizePageConfiguration.P_TOOLBAR_MENU,
+ ACTION_GROUP,
+ new CVSActionDelegateWrapper(new IgnoreAction(), configuration){
+ protected String getBundleKeyPrefix() {
+ return "SharingWizardIgnore."; //$NON-NLS-1$
+ }
+ });
}
/* (non-Javadoc)
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 fd0b1d365..ccaaad93a 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
@@ -78,7 +78,7 @@ public class SharingWizardSyncPage extends CVSWizardPage implements ISyncInfoSet
input = createCompareInput();
input.createPartControl(pageBook);
syncPage = input.getControl();
- infos = (SyncInfoSet)configuration.getSyncInfoSet();
+ infos = configuration.getSyncInfoSet();
infos.addSyncSetChangedListener(this);
noChangesPage = createNoChangesPage(pageBook);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java
index 625c038f8..d85b8878d 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/ActionDelegateWrapper.java
@@ -11,20 +11,30 @@
package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.jface.action.Action;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.*;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
/**
* An Action that wraps IActionDelegates so they can be used programatically
* in toolbars, etc.
*/
-public class ActionDelegateWrapper extends Action {
+public class ActionDelegateWrapper extends Action implements ISelectionChangedListener {
private IActionDelegate delegate;
- public ActionDelegateWrapper(IActionDelegate delegate, IWorkbenchPart part) {
+ public ActionDelegateWrapper(IActionDelegate delegate, ISynchronizePageConfiguration configuration) {
this.delegate = delegate;
+ IWorkbenchPart part = configuration.getSite().getPart();
if(part != null) {
if (delegate instanceof IObjectActionDelegate) {
((IObjectActionDelegate)delegate).setActivePart(this, part);
@@ -38,17 +48,38 @@ public class ActionDelegateWrapper extends Action {
((IEditorActionDelegate)delegate).setActiveEditor(this, (IEditorPart)part);
}
}
- // Assume there is no selection until told otherwise
- setSelection(StructuredSelection.EMPTY);
+ initialize(configuration);
}
+ /**
+ * Method invoked from the constructor when a configuration is provided.
+ * The default implementation registers the action as a selection change
+ * listener. Subclass may override.
+ * @param configuration the synchronize page configuration
+ */
+ protected void initialize(final ISynchronizePageConfiguration configuration) {
+ configuration.getSite().getSelectionProvider().addSelectionChangedListener(this);
+ configuration.getPage().getViewer().getControl().addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ configuration.getSite().getSelectionProvider().removeSelectionChangedListener(ActionDelegateWrapper.this);
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ getDelegate().selectionChanged(this, event.getSelection());
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
public void run() {
- delegate.run(this);
+ getDelegate().run(this);
}
-
+
/**
* Return the delegate associated with this action.
* @return the delegate associated with this action
@@ -57,20 +88,4 @@ public class ActionDelegateWrapper extends Action {
return delegate;
}
- /**
- * Set the selection of the action
- * @param selection the selection
- */
- public void setSelection(ISelection selection) {
- getDelegate().selectionChanged(this, selection);
- }
-
- /**
- * Set the selection of the action to the given object
- * @param input the selected object
- */
- public void setSelection(Object input) {
- ISelection selection = new StructuredSelection(input);
- setSelection(selection);
- }
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
index 5f5ee60fa..96d538a0f 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/StructuredViewerAdvisor.java
@@ -11,27 +11,54 @@
package org.eclipse.team.internal.ui.synchronize;
import org.eclipse.compare.internal.INavigatable;
-import org.eclipse.compare.internal.IOpenable;
-import org.eclipse.compare.structuremergeviewer.*;
+import org.eclipse.compare.structuremergeviewer.DiffNode;
+import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.action.*;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IStatusLineManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.events.*;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelDecorator;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.MenuListener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.core.Assert;
-import org.eclipse.team.internal.ui.*;
+import org.eclipse.team.internal.ui.IPreferenceIds;
+import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.synchronize.actions.StatusLineContributionGroup;
import org.eclipse.team.internal.ui.synchronize.actions.WorkingSetFilterActionGroup;
-import org.eclipse.team.ui.synchronize.*;
-import org.eclipse.ui.*;
+import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
+import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
+import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
+import org.eclipse.team.ui.synchronize.SynchronizeModelAction;
+import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.actions.ActionContext;
import org.eclipse.ui.actions.ActionGroup;
-import org.eclipse.ui.internal.PluginAction;
import org.eclipse.ui.model.BaseWorkbenchContentProvider;
/**
@@ -85,7 +112,6 @@ public abstract class StructuredViewerAdvisor implements IAdaptable {
private SynchronizeModelManager modelManager;
private INavigatable nav;
- private IOpenable openable;
// Property change listener which reponds to:
// - working set selection by the user
@@ -125,7 +151,7 @@ public abstract class StructuredViewerAdvisor implements IAdaptable {
if(modelManager == null) {
modelManager = createModelManager(configuration);
}
- Assert.isNotNull(modelManager, "model manager must be set");
+ Assert.isNotNull(modelManager, "model manager must be set"); //$NON-NLS-1$
modelManager.setViewerAdvisor(this);
}
@@ -442,14 +468,7 @@ public abstract class StructuredViewerAdvisor implements IAdaptable {
* @see fillContextMenu(StructuredViewer, IMenuManager)
*/
private void hookContextMenu(final StructuredViewer viewer) {
- String targetID;
- Object o = configuration.getProperty(ISynchronizePageConfiguration.P_OBJECT_CONTRIBUTION_ID);
- if (o instanceof String) {
- targetID = (String)o;
- } else {
- targetID = null;
- }
- final MenuManager menuMgr = new MenuManager(targetID); //$NON-NLS-1$
+ final MenuManager menuMgr = new MenuManager(null); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@@ -467,33 +486,21 @@ public abstract class StructuredViewerAdvisor implements IAdaptable {
// state before the menu is shown. This is required when
// the state of the selection changes and the contributions
// need to update enablement based on this.
+ // TODO: Is this hack still needed
public void menuShown(MenuEvent e) {
IContributionItem[] items = menuMgr.getItems();
for (int i = 0; i < items.length; i++) {
IContributionItem item = items[i];
if (item instanceof ActionContributionItem) {
IAction actionItem = ((ActionContributionItem) item).getAction();
- if (actionItem instanceof PluginAction) {
- ((PluginAction) actionItem).selectionChanged(viewer.getSelection());
+ if (actionItem instanceof SynchronizeModelAction) {
+ ((SynchronizeModelAction) actionItem).selectionChanged(viewer.getSelection());
}
}
}
}
});
viewer.getControl().setMenu(menu);
- if (targetID != null) {
- IWorkbenchSite workbenchSite = configuration.getSite().getWorkbenchSite();
- IWorkbenchPartSite ws = null;
- if (workbenchSite instanceof IWorkbenchPartSite)
- ws = (IWorkbenchPartSite)workbenchSite;
- if (ws == null)
- ws = Utils.findSite();
- if (ws != null) {
- ws.registerContextMenu(targetID, menuMgr, viewer);
- } else {
- TeamUIPlugin.log(IStatus.ERROR, "Cannot add menu contributions because the site cannot be found: " + targetID, null); //$NON-NLS-1$
- }
- }
}
/*
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 997f51567..6dfcd5d4f 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
@@ -109,7 +109,6 @@ public class SynchronizePageConfiguration extends SynchronizePageActionGroup imp
*/
public SynchronizePageConfiguration(ISynchronizeParticipant participant) {
this.participant = participant;
- setProperty(P_OBJECT_CONTRIBUTION_ID, participant.getId());
setProperty(P_CONTEXT_MENU, DEFAULT_CONTEXT_MENU);
setProperty(P_TOOLBAR_MENU, DEFAULT_TOOLBAR_MENU);
setProperty(P_VIEW_MENU, DEFAULT_VIEW_MENU);
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/WorkbenchPartSynchronizePageSite.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/WorkbenchPartSynchronizePageSite.java
index 254475c0d..6334c0410 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/WorkbenchPartSynchronizePageSite.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/WorkbenchPartSynchronizePageSite.java
@@ -94,4 +94,11 @@ public class WorkbenchPartSynchronizePageSite implements ISynchronizePageSite {
public IActionBars getActionBars() {
return site.getActionBars();
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#isModal()
+ */
+ public boolean isModal() {
+ return false;
+ }
}
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 6bb6e1ba2..1a763e520 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
@@ -14,7 +14,6 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.internal.ui.TeamUIPlugin;
-import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkingSet;
/**
@@ -75,14 +74,6 @@ public interface ISynchronizePageConfiguration {
public static final String P_VIEW_MENU = TeamUIPlugin.ID + ".P_VIEW_MENU"; //$NON-NLS-1$
/**
- * The configuration property that defines the filter id that
- * determines which object contribution actions appear in the
- * context menu for the page. This defaults to the id of the
- * participant but can be set to another id or <code>null</code>
- */
- public static final String P_OBJECT_CONTRIBUTION_ID = TeamUIPlugin.ID + ".P_OBJECT_CONTRIBUTION_ID"; //$NON-NLS-1$
-
- /**
* Property constant for the working set used to filter the visible
* elements of the model. The value can be any <code>IWorkingSet</code>
* or <code>null</code>;
@@ -175,7 +166,7 @@ public interface ISynchronizePageConfiguration {
* Clients can remove, add and change the ordering for groups in
* the context menu.
*/
- public static final String[] DEFAULT_CONTEXT_MENU = new String[] { FILE_GROUP, EDIT_GROUP, SYNCHRONIZE_GROUP, NAVIGATE_GROUP, OBJECT_CONTRIBUTIONS_GROUP};
+ public static final String[] DEFAULT_CONTEXT_MENU = new String[] { FILE_GROUP, EDIT_GROUP, SYNCHRONIZE_GROUP, NAVIGATE_GROUP};
/**
* These are the default groups used for the toolbar of a page.
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 7d1b18646..df2f9d6b4 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
@@ -97,4 +97,12 @@ public interface ISynchronizePageSite {
* @return the action bars
*/
IActionBars getActionBars();
+
+ /**
+ * Returns whether the site is associated with a page being
+ * shown in a modal dialog
+ * @return whether the site is associated with a page being
+ * shown in a modal dialog
+ */
+ boolean isModal();
}
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java
index 6c2566269..0196e5c7c 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart.java
@@ -115,6 +115,12 @@ public class ParticipantPageSaveablePart extends SaveablePartAdapter implements
}
public IActionBars getActionBars() {
return ParticipantPageSaveablePart.this.getActionBars();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.team.ui.synchronize.ISynchronizePageSite#isModal()
+ */
+ public boolean isModal() {
+ return true;
}
}
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 f3729e208..7b1dad5bb 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,9 +13,12 @@ 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;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.team.core.synchronize.FastSyncInfoFilter;
import org.eclipse.team.core.synchronize.SyncInfo;
import org.eclipse.team.core.synchronize.SyncInfoSet;
@@ -44,15 +47,30 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
private IWorkbenchPart part;
/**
- * Creates a new action with the given text.
- *
- * @param text the string used as the text for the action,
- * or <code>null</code> if there is no text
+ * Create an action with the given text and configuration.
+ * @param text the action's text
+ * @param configuration the actions synchronize page configuration
*/
- protected SynchronizeModelAction(String text) {
+ protected SynchronizeModelAction(String text, ISynchronizePageConfiguration configuration) {
super(text);
+ initialize(configuration);
}
+ /**
+ * Method invoked from the constructor when a configuration is provided.
+ * The default implementation registers the action as a selection change
+ * listener. Subclass may override.
+ * @param configuration the synchronize page configuration
+ */
+ protected void initialize(final ISynchronizePageConfiguration configuration) {
+ configuration.getSite().getSelectionProvider().addSelectionChangedListener(this);
+ configuration.getPage().getViewer().getControl().addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ configuration.getSite().getSelectionProvider().removeSelectionChangedListener(SynchronizeModelAction.this);
+ }
+ });
+ }
+
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
@@ -134,4 +152,17 @@ public abstract class SynchronizeModelAction extends BaseSelectionListenerAction
}
return (IDiffElement[]) filtered.toArray(new IDiffElement[filtered.size()]);
}
+
+ /**
+ * Set the selection of this action to the given selection
+ * @param selection the selection
+ */
+ public void selectionChanged(ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ selectionChanged((IStructuredSelection)selection);
+ } else {
+ selectionChanged(StructuredSelection.EMPTY);
+ }
+
+ }
} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
index b804914f2..778d35025 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/ui/synchronize/SynchronizePageActionGroup.java
@@ -20,9 +20,8 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.team.internal.ui.synchronize.SynchronizePageConfiguration;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.actions.ActionGroup;
/**
@@ -101,30 +100,6 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
if (configuration != null) {
configuration.removeActionContribution(this);
}
- disposeMenu(ISynchronizePageConfiguration.P_CONTEXT_MENU);
- disposeMenu(ISynchronizePageConfiguration.P_TOOLBAR_MENU);
- disposeMenu(ISynchronizePageConfiguration.P_VIEW_MENU);
- }
-
- private void disposeMenu(String menuId) {
- Map groups = (Map)menuContributions.get(menuId);
- if (groups != null) {
- for (Iterator iter = groups.keySet().iterator(); iter.hasNext(); ) {
- String groupId = (String) iter.next();
- List actions = (List)groups.get(groupId);
- if (actions != null) {
- for (Iterator iter2 = actions.iterator(); iter2.hasNext();) {
- Object element = iter2.next();
- if (element instanceof ISelectionChangedListener) {
- ISelectionProvider selectionProvider = configuration.getSite().getSelectionProvider();
- if (selectionProvider != null) {
- selectionProvider.removeSelectionChangedListener((ISelectionChangedListener)element);
- }
- }
- }
- }
- }
- }
}
/**
@@ -197,17 +172,46 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
* @param groupId the group id in the menu to which the action is to be added
* @param action the action to be added
*/
- public void appendToGroup(String menuId, String groupId, IAction action) {
+ protected void appendToGroup(String menuId, String groupId, IAction action) {
internalAppendToGroup(menuId, groupId, action);
}
+ /**
+ * Helper method that can be invoked during initialization to add an
+ * item to a particular menu (one of P_TOOLBAR_MENU, P_VIEW_MENU, P_CONTEXT_MENU
+ * from ISynchronizePageConfiguration). The item is added to the given group
+ * if it is present. Otherwise the item is not added to the menu.
+ * @param menuId the menu id (one of P_TOOLBAR_MENU, P_VIEW_MENU, P_CONTEXT_MENU
+ * from ISynchronizePageConfiguration)
+ * @param groupId the group id in the menu to which the item is to be added
+ * @param item the item to be added
+ */
+ protected void appendToGroup(String menuId, String groupId, IContributionItem item) {
+ internalAppendToGroup(menuId, groupId, item);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
public void fillContextMenu(IMenuManager menu) {
super.fillContextMenu(menu);
- Map groups = (Map)menuContributions.get(ISynchronizePageConfiguration.P_CONTEXT_MENU);
- if (groups != null) {
+ fillMenu(menu, ISynchronizePageConfiguration.P_CONTEXT_MENU);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars)
+ */
+ public void fillActionBars(IActionBars actionBars) {
+ super.fillActionBars(actionBars);
+ if (actionBars != null) {
+ fillMenu(actionBars.getMenuManager(), ISynchronizePageConfiguration.P_VIEW_MENU);
+ fillMenu(actionBars.getToolBarManager(), ISynchronizePageConfiguration.P_TOOLBAR_MENU);
+ }
+ }
+
+ private void fillMenu(IContributionManager menu, String menuId) {
+ Map groups = (Map)menuContributions.get(menuId);
+ if (menu != null && groups != null) {
for (Iterator iter = groups.keySet().iterator(); iter.hasNext(); ) {
String groupId = (String) iter.next();
List actions = (List)groups.get(groupId);
@@ -224,24 +228,18 @@ public abstract class SynchronizePageActionGroup extends ActionGroup {
}
}
}
-
+
private void internalAppendToGroup(String menuId, String groupId, Object action) {
Map groups = (Map)menuContributions.get(menuId);
if (groups == null) {
groups = new HashMap();
menuContributions.put(menuId, groups);
}
- List actions = (List)menuContributions.get(groupId);
+ List actions = (List)groups.get(groupId);
if (actions == null) {
actions = new ArrayList();
groups.put(groupId, actions);
}
actions.add(action);
- if (action instanceof ISelectionChangedListener) {
- ISelectionProvider selectionProvider = configuration.getSite().getSelectionProvider();
- if (selectionProvider != null) {
- selectionProvider.addSelectionChangedListener((ISelectionChangedListener)action);
- }
- }
}
}

Back to the top