diff options
author | Jean Michel-Lemieux | 2004-12-08 20:25:29 +0000 |
---|---|---|
committer | Jean Michel-Lemieux | 2004-12-08 20:25:29 +0000 |
commit | d5ae416cf0221f795a8a26642038749e210c3876 (patch) | |
tree | 4edf834b9b5dcfc95d54b28c226029cbc1187cb5 | |
parent | 9147b0c95a2ca62b0c453636eca750dad71a4125 (diff) | |
download | eclipse.platform.team-d5ae416cf0221f795a8a26642038749e210c3876.tar.gz eclipse.platform.team-d5ae416cf0221f795a8a26642038749e210c3876.tar.xz eclipse.platform.team-d5ae416cf0221f795a8a26642038749e210c3876.zip |
first cut at CVS top level menu
4 files changed, 288 insertions, 55 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties index f30a91177..86b2ae831 100644 --- a/bundles/org.eclipse.team.cvs.ui/plugin.properties +++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties @@ -40,12 +40,15 @@ DecoratorStandard.name=CVS DecoratorStandard.desc=Shows CVS specific information on resources in projects under CVS control. Information includes the revision number, branch or version name, etc. AddAction.label=Add to &Version Control +AddAction.name=Add to Version Control AddAction.tooltip=Add the Selected Resources to Version Control MergeAction.label=&Merge... +MergeAction.name=Merge MergeAction.tooltip=Merge BranchAction.label=&Branch... +BranchAction.name=Branch BranchAction.tooltip=Branch CompareRemoteResourcesAction.label=Com&pare @@ -73,6 +76,7 @@ CopyRepositoryNameAction.label=&Copy to Clipboard CopyRepositoryNameAction.tooltip=Copy Repository Names to Clipboard IgnoreAction.label=A&dd to .cvsignore... +IgnoreAction.name=Add to .cvsignore IgnoreAction.tooltip=Ignore the Selected Resources when Synchronizing RefreshTagsAction.label=Refresh &Branches... @@ -88,22 +92,27 @@ ReplaceWithTagAction.label=&Another Branch or Version... ReplaceWithTagAction.tooltip=Replace with Branch or Version on the CVS Server TagAction.label=&Tag as Version... +TagAction.name=Tag as Version TagAction.tooltip=Tag the resources with a CVS version tag TagInRepositoryAction.label=&Tag as Version... +TagInRepositoryAction.name=Tag as Version TagInRepositoryAction.tooltip=Tag the resources with a CVS version tag MoveTagAction.label=Tag with &Existing... MoveTagAction.tooltip=Tag the selected resources with an existing tag SetKeywordSubstitutionAction.label=Cha&nge ASCII/Binary Property... +SetKeywordSubstitutionAction.name=Change ASCII/Binary Property SetKeywordSubstitutionAction.tooltip=Change whether the selected resources should be treated as ASCII or binary on the CVS Server UpdateAction.label=&Update -UpdateAction.tooltip=Update +UpdateAction.name=Update +UpdateAction.tooltip=Update resources with new content from the repository -UpdateActionSwitch.label=S&witch to another branch or version... -UpdateActionSwitch.tooltip=Switch to another branch or version +UpdateActionSwitch.label=S&witch to Another Branch or Version... +UpdateActionSwitch.name=Switch to Another Branch or Version +UpdateActionSwitch.tooltip=Switch to Another Branch or Version ReplaceWithAction.label=&Latest from Repository ReplaceWithAction.tooltip=Replace with last committed content from CVS Server @@ -115,7 +124,8 @@ AddToBranch.label=Add &to Branch List... AddToBranch.tooltip=Add the selected remote folder to a branch CommitAction.label=&Commit... -CommitAction.tooltip=Commit +CommitAction.name=Commit +CommitAction.tooltip=Commit resources to the repository CheckoutAction.label=&Check Out CheckoutAction.tooltip=Check out a module from the repository to the workspace @@ -129,19 +139,23 @@ OpenLogEntryAction.tooltip=Open Remote File OpenRemoteFileAction.label=&Open OpenRemoteFileAction.tooltip=Open Remote File -ShowHistoryAction.label=Show in Resource &History -ShowHistoryAction.tooltip=Show in Resource History +ShowHistoryAction.label=Show Resource &History +ShowHistoryAction.name=Show Resource History +ShowHistoryAction.tooltip=Show Resource History ShowAnnotationAction.label=Show &Annotation +ShowAnnotationAction.name=Show Annotation ShowAnnotationAction.tooltip=Show Annotation GenerateDiff.label=Create &Patch... +GenerateDiff.name=Create Patch GenerateDiff.tooltip=Compare your workspace contents with the server and generate a diff file that can be used as a patch file. RefreshFromLocal.label=&Refresh from local CVS state RefreshFromLocal.tooltip=Refresh the workbench with changes made to CVS projects from outside the workbench. Synchronize.label=&Synchronize with Repository +Synchronize.name=Synchronize with Repository Synchronize.tooltip=Synchronize the workspace resources with those in the repository EditAction.label=&Edit diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml index 898dd1266..69e04f155 100644 --- a/bundles/org.eclipse.team.cvs.ui/plugin.xml +++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml @@ -192,7 +192,7 @@ </action> <action label="%ShowHistoryAction.label" - icon="icons/full/ctool16/history.gif" + icon="icons/full/etool16/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" @@ -201,7 +201,7 @@ </action> <action label="%ShowAnnotationAction.label" - icon="icons/full/ctool16/annotate.gif" + icon="icons/full/etool16/annotate.gif" helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context" tooltip="%ShowAnnotationAction.tooltip" class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction" @@ -265,26 +265,29 @@ id="org.eclipse.team.ccvs.ui.updateSwitch"> </action> <action - label="%MergeAction.label" helpContextId="org.eclipse.team.cvs.ui.team_merge_action_context" - tooltip="%MergeAction.tooltip" + label="%MergeAction.label" + icon="icons/full/obj16/branches_rep.gif" class="org.eclipse.team.internal.ccvs.ui.actions.MergeAction" + tooltip="%MergeAction.tooltip" menubarPath="team.main/group2" id="org.eclipse.team.ccvs.ui.merge"> </action> <action - label="%BranchAction.label" helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context" - tooltip="%BranchAction.tooltip" + label="%BranchAction.label" + icon="icons/full/elcl16/newstream_wiz.gif" class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction" + tooltip="%BranchAction.tooltip" menubarPath="team.main/group2" id="org.eclipse.team.ccvs.ui.branch"> </action> <action - label="%TagAction.label" helpContextId="org.eclipse.team.cvs.ui.team_tag_as_version_action_context" - tooltip="%TagAction.tooltip" + label="%TagAction.label" + icon="icons/full/obj16/versions_rep.gif" class="org.eclipse.team.internal.ccvs.ui.actions.TagLocalAction" + tooltip="%TagAction.tooltip" menubarPath="team.main/group2" id="org.eclipse.team.ccvs.ui.tag"> </action> @@ -870,7 +873,7 @@ label="%CVS" description="%CVSActionSet.description" visible="false" - id="org.eclipse.team.cvs.ui.CVSActionSet"> + id="cvs"> <action definitionId="org.eclipse.team.cvs.ui.checkout" label="%CVSActionSet.checkoutLabel" @@ -880,6 +883,165 @@ toolbarPath="Normal/CVS" id="org.eclipse.team.cvs.ui.actions.CheckoutAction"> </action> + <menu + label="%CVS" + path="additions" + id="cvs.main"> + <separator + name="group1"> + </separator> + <separator + name="group2"> + </separator> + <separator + name="group3"> + </separator> + <separator + name="group4"> + </separator> + <separator + name="group5"> + </separator> + <separator + name="group6"> + </separator> + <separator + name="group7"> + </separator> + <separator + name="group8"> + </separator> + <separator + name="group9"> + </separator> + <separator + name="group10"> + </separator> + <separator + name="projectGroup"> + </separator> + </menu> + <action + helpContextId="org.eclipse.team.cvs.ui.team_ignore_action_context" + label="%IgnoreAction.label" + definitionId="org.eclipse.team.cvs.ui.ignore" + class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction" + tooltip="%IgnoreAction.tooltip" + menubarPath="cvs.main/group3" + id="org.eclipse.team.cvs.ui.ignore"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_add_action_context" + label="%AddAction.label" + definitionId="org.eclipse.team.cvs.ui.add" + class="org.eclipse.team.internal.ccvs.ui.actions.AddAction" + tooltip="%AddAction.tooltip" + menubarPath="cvs.main/group3" + id="org.eclipse.team.cvs.ui.add"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.show_in_history_action_context" + label="%ShowHistoryAction.label" + definitionId="org.eclipse.team.cvs.ui.showHistory" + class="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction" + tooltip="%ShowHistoryAction.tooltip" + icon="icons/full/eview16/history_view.gif" + menubarPath="cvs.main/group2" + id="org.eclipse.team.cvs.ui.showHistory"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.get_annotate_action_context" + label="%ShowAnnotationAction.label" + definitionId="org.eclipse.team.cvs.ui.showAnnotation" + class="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction" + tooltip="%ShowAnnotationAction.tooltip" + icon="icons/full/etool16/annotate.gif" + menubarPath="cvs.main/group2" + id="org.eclipse.team.cvs.ui.showAnnotation"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_set_keyword_mode_action_context" + label="%SetKeywordSubstitutionAction.label" + definitionId="org.eclipse.team.cvs.ui.setKeywordSubstitution" + class="org.eclipse.team.internal.ccvs.ui.actions.SetKeywordSubstitutionAction" + tooltip="%SetKeywordSubstitutionAction.tooltip" + menubarPath="cvs.main/group3" + id="org.eclipse.team.cvs.ui.setKeywordSubstitution"> + </action> + <action + label="%UpdateActionSwitch.label" + definitionId="org.eclipse.team.cvs.ui.updateSwitch" + class="org.eclipse.team.internal.ccvs.ui.actions.UpdateAction" + tooltip="%UpdateActionSwitch.tooltip" + menubarPath="cvs.main/group2" + id="org.eclipse.team.cvs.ui.updateSwitch"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_merge_action_context" + label="%MergeAction.label" + icon="icons/full/obj16/branches_rep.gif" + tooltip="%MergeAction.tooltip" + class="org.eclipse.team.internal.ccvs.ui.actions.MergeAction" + definitionId="org.eclipse.team.cvs.ui.merge" + menubarPath="cvs.main/group2" + id="org.eclipse.team.cvs.ui.merge"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_branch_action_context" + label="%BranchAction.label" + icon="icons/full/elcl16/newstream_wiz.gif" + tooltip="%BranchAction.tooltip" + class="org.eclipse.team.internal.ccvs.ui.actions.BranchAction" + definitionId="org.eclipse.team.cvs.ui.branch" + menubarPath="cvs.main/group2" + id="org.eclipse.team.cvs.ui.branch"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_tag_as_version_action_context" + label="%TagAction.label" + icon="icons/full/obj16/versions_rep.gif" + tooltip="%TagAction.tooltip" + class="org.eclipse.team.internal.ccvs.ui.actions.TagLocalAction" + definitionId="org.eclipse.team.cvs.ui.tag" + menubarPath="cvs.main/group2" + id="org.eclipse.team.cvs.ui.tag"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_create_patch_action_context" + label="%GenerateDiff.label" + definitionId="org.eclipse.team.cvs.ui.GenerateDiff" + class="org.eclipse.team.internal.ccvs.ui.actions.GenerateDiffFileAction" + tooltip="%GenerateDiff.tooltip" + menubarPath="cvs.main/group1" + id="org.eclipse.team.cvs.ui.GenerateDiff"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_update_action_context" + label="%UpdateAction.label" + tooltip="%UpdateAction.tooltip" + class="org.eclipse.team.internal.ccvs.ui.actions.UpdateSilentAction" + definitionId="org.eclipse.team.cvs.ui.update" + menubarPath="cvs.main/group1" + id="org.eclipse.team.cvs.ui.update"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_commit_action_context" + label="%CommitAction.label" + definitionId="org.eclipse.team.cvs.ui.commit" + class="org.eclipse.team.internal.ccvs.ui.actions.CommitAction" + tooltip="%CommitAction.tooltip" + menubarPath="cvs.main/group1" + id="org.eclipse.team.cvs.ui.commit"> + </action> + <action + helpContextId="org.eclipse.team.cvs.ui.team_synchronize_action_context" + label="%Synchronize.label" + tooltip="%Synchronize.tooltip" + class="org.eclipse.team.internal.ccvs.ui.actions.SyncAction" + definitionId="org.eclipse.team.cvs.ui.sync" + menubarPath="cvs.main/group1" + id="org.eclipse.team.cvs.ui.sync"> + </action> </actionSet> </extension> <!-- ******************* Action Definitions ******************** --> @@ -945,6 +1107,71 @@ command="org.eclipse.team.ccvs.ui.AnnotateView" configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> </keyBinding> + <command + description="%CommitAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%CommitAction.name" + id="org.eclipse.team.cvs.ui.commit"/> + <command + category="org.eclipse.team.cvs.ui.actionSet" + description="%Synchronize.tooltip" + name="%Synchronize.name" + id="org.eclipse.team.cvs.ui.sync"/> + <command + description="%UpdateAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%UpdateAction.name" + id="org.eclipse.team.cvs.ui.command3"/> + <command + description="%GenerateDiff.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%GenerateDiff.name" + id="org.eclipse.team.cvs.ui.GenerateDiff"/> + <command + description="%TagAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%TagAction.name" + id="org.eclipse.team.cvs.ui.tag"/> + <command + description="%BranchAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%BranchAction.name" + id="org.eclipse.team.cvs.ui.branch"/> + <command + description="%MergeAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%MergeAction.name" + id="org.eclipse.team.cvs.ui.merge"/> + <command + description="%UpdateActionSwitch.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%UpdateActionSwitch.name" + id="org.eclipse.team.cvs.ui.updateSwitch"/> + <command + description="%SetKeywordSubstitutionAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%SetKeywordSubstitutionAction.name" + id="org.eclipse.team.cvs.ui.setKeywordSubstitution"/> + <command + description="%ShowAnnotationAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%ShowAnnotationAction.name" + id="org.eclipse.team.cvs.ui.showAnnotation"/> + <command + description="%ShowHistoryAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%ShowHistoryAction.name" + id="org.eclipse.team.cvs.ui.showHistory"/> + <command + description="%AddAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%AddAction.name" + id="org.eclipse.team.cvs.ui.add"/> + <command + description="%IgnoreAction.tooltip" + category="org.eclipse.team.cvs.ui.actionSet" + name="%IgnoreAction.name" + id="org.eclipse.team.cvs.ui.ignore"/> </extension> <!-- ********** Color and Font Definitions ************** --> diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java index 5a9b337a3..55d601f85 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/CVSAction.java @@ -11,38 +11,20 @@ package org.eclipse.team.internal.ccvs.ui.actions; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - +import java.util.*; import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.*; import org.eclipse.jface.action.IAction; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.dialogs.*; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.team.core.TeamException; -import org.eclipse.team.internal.ccvs.core.CVSException; -import org.eclipse.team.internal.ccvs.core.CVSStatus; -import org.eclipse.team.internal.ccvs.core.CVSTag; -import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder; -import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource; -import org.eclipse.team.internal.ccvs.core.ICVSResource; -import org.eclipse.team.internal.ccvs.core.ILogEntry; +import org.eclipse.team.internal.ccvs.core.*; import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; -import org.eclipse.team.internal.ccvs.ui.AvoidableMessageDialog; -import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; -import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; +import org.eclipse.team.internal.ccvs.ui.*; import org.eclipse.team.internal.ccvs.ui.Policy; import org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager; import org.eclipse.team.internal.ui.Utils; diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java index 8f92eb7cf..8608002a2 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/actions/TeamAction.java @@ -13,14 +13,8 @@ package org.eclipse.team.internal.ui.actions; import java.lang.reflect.Array; import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceStatus; +import java.util.*; +import org.eclipse.core.resources.*; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.action.IAction; @@ -36,14 +30,7 @@ import org.eclipse.team.core.TeamException; import org.eclipse.team.internal.core.TeamPlugin; import org.eclipse.team.internal.ui.TeamUIPlugin; import org.eclipse.team.internal.ui.Utils; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IViewActionDelegate; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; +import org.eclipse.ui.*; import org.eclipse.ui.actions.ActionDelegate; /** @@ -55,7 +42,7 @@ import org.eclipse.ui.actions.ActionDelegate; * Team providers may also instantiate or subclass any of the * subclasses of TeamAction provided in this package. */ -public abstract class TeamAction extends ActionDelegate implements IObjectActionDelegate, IViewActionDelegate { +public abstract class TeamAction extends ActionDelegate implements IObjectActionDelegate, IViewActionDelegate, IWorkbenchWindowActionDelegate { // The current selection protected IStructuredSelection selection; @@ -68,6 +55,14 @@ public abstract class TeamAction extends ActionDelegate implements IObjectAction public final static int PROGRESS_BUSYCURSOR = 2; private IWorkbenchPart targetPart; + private IWorkbenchWindow window; + + private ISelectionListener selectionListener = new ISelectionListener() { + public void selectionChanged(IWorkbenchPart part, ISelection selection) { + if(selection instanceof IStructuredSelection) + TeamAction.this.selection = (IStructuredSelection)selection; + } + }; /** * Creates an array of the given class type containing all the @@ -316,6 +311,10 @@ public abstract class TeamAction extends ActionDelegate implements IObjectAction * @return IWorkbenchPart */ protected IWorkbenchPart getTargetPart() { + if(targetPart == null) { + IWorkbenchPage page = TeamUIPlugin.getActivePage(); + targetPart = page.getActivePart(); + } return targetPart; } @@ -349,4 +348,15 @@ public abstract class TeamAction extends ActionDelegate implements IObjectAction public void init(IViewPart view) { targetPart = view; } + + public void init(IWorkbenchWindow window) { + window.getSelectionService().addPostSelectionListener(selectionListener); + } + + public void dispose() { + super.dispose(); + if(window != null) { + window.getSelectionService().removePostSelectionListener(selectionListener); + } + } } |