Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 161773 Details for
Bug 303784
Keybindings for Team > Show Annotation and Show History don't work any more
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Show Annotation and Show History v03
team-v03.txt (text/plain), 6.93 KB, created by
Paul Webster
on 2010-03-11 12:04:54 EST
(
hide
)
Description:
Show Annotation and Show History v03
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2010-03-11 12:04:54 EST
Size:
6.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.team.cvs.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/plugin.xml,v >retrieving revision 1.286 >diff -u -r1.286 plugin.xml >--- plugin.xml 22 Dec 2009 11:45:22 -0000 1.286 >+++ plugin.xml 11 Mar 2010 17:03:43 -0000 >@@ -1321,11 +1321,13 @@ > description="%ShowAnnotationAction.tooltip" > categoryId="org.eclipse.team.cvs.ui.actionSet" > name="%ShowAnnotationAction.name" >+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.ShowAnnotationAction" > id="org.eclipse.team.cvs.ui.showAnnotation"/> > <command > description="%ShowHistoryAction.tooltip" > categoryId="org.eclipse.team.cvs.ui.actionSet" > name="%ShowHistoryAction.name" >+ defaultHandler="org.eclipse.team.internal.ccvs.ui.actions.ShowResourceInHistoryAction" > id="org.eclipse.team.cvs.ui.showHistory"/> > <command > description="%AddAction.tooltip" >Index: src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java,v >retrieving revision 1.24 >diff -u -r1.24 ShowAnnotationAction.java >--- src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java 21 Jun 2006 19:11:14 -0000 1.24 >+++ src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java 11 Mar 2010 17:03:43 -0000 >@@ -12,11 +12,14 @@ > > import java.lang.reflect.InvocationTargetException; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.dialogs.MessageDialogWithToggle; > import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.osgi.util.NLS; > import org.eclipse.team.internal.ccvs.core.*; > import org.eclipse.team.internal.ccvs.core.client.listeners.LogEntry; >@@ -24,6 +27,9 @@ > import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo; > import org.eclipse.team.internal.ccvs.ui.*; > import org.eclipse.team.internal.ccvs.ui.operations.ShowAnnotationOperation; >+import org.eclipse.ui.*; >+import org.eclipse.ui.handlers.HandlerUtil; >+import org.eclipse.ui.ide.ResourceUtil; > > public class ShowAnnotationAction extends WorkspaceAction { > >@@ -155,4 +161,39 @@ > public String getId() { > return ICVSUIConstants.CMD_ANNOTATE; > } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object) >+ */ >+ public void setEnabled(Object evaluationContext) { >+ IWorkbenchWindow activeWorkbenchWindow = (IWorkbenchWindow) HandlerUtil >+ .getVariable(evaluationContext, >+ ISources.ACTIVE_WORKBENCH_WINDOW_NAME); >+ if (activeWorkbenchWindow != null) { >+ ISelection selection = (ISelection) HandlerUtil.getVariable( >+ evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME); >+ if (selection == null) { >+ selection = StructuredSelection.EMPTY; >+ } >+ IWorkbenchPart part = (IWorkbenchPart) HandlerUtil.getVariable( >+ evaluationContext, ISources.ACTIVE_PART_NAME); >+ updateSelection(activeWorkbenchWindow, part, selection); >+ } >+ } >+ >+ private void updateSelection(IWorkbenchWindow activeWorkbenchWindow, >+ IWorkbenchPart part, ISelection selection) { >+ // If the action is run from within an editor, try and find the >+ // file for the given editor. >+ if (part != null && part instanceof IEditorPart) { >+ IEditorInput input = ((IEditorPart) part).getEditorInput(); >+ IFile file = ResourceUtil.getFile(input); >+ if (file != null) { >+ selectionChanged((IAction) null, new StructuredSelection(file)); >+ } >+ } else { >+ // Fallback is to prime the action with the selection >+ selectionChanged((IAction) null, selection); >+ } >+ } > } >Index: src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java,v >retrieving revision 1.28 >diff -u -r1.28 ShowResourceInHistoryAction.java >--- src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java 7 Dec 2006 19:05:53 -0000 1.28 >+++ src/org/eclipse/team/internal/ccvs/ui/actions/ShowResourceInHistoryAction.java 11 Mar 2010 17:03:43 -0000 >@@ -12,16 +12,22 @@ > > import java.lang.reflect.InvocationTargetException; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.operation.IRunnableWithProgress; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.team.internal.ccvs.core.CVSException; > import org.eclipse.team.internal.ccvs.core.ICVSResource; > import org.eclipse.team.internal.ccvs.ui.CVSUIMessages; > import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants; > import org.eclipse.team.internal.ui.TeamUIPlugin; > import org.eclipse.team.ui.TeamUI; >+import org.eclipse.ui.*; >+import org.eclipse.ui.handlers.HandlerUtil; >+import org.eclipse.ui.ide.ResourceUtil; > > public class ShowResourceInHistoryAction extends WorkspaceAction { > /* >@@ -86,4 +92,39 @@ > protected boolean isEnabledForIgnoredResources() { > return true; > } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object) >+ */ >+ public void setEnabled(Object evaluationContext) { >+ IWorkbenchWindow activeWorkbenchWindow = (IWorkbenchWindow) HandlerUtil >+ .getVariable(evaluationContext, >+ ISources.ACTIVE_WORKBENCH_WINDOW_NAME); >+ if (activeWorkbenchWindow != null) { >+ ISelection selection = (ISelection) HandlerUtil.getVariable( >+ evaluationContext, ISources.ACTIVE_CURRENT_SELECTION_NAME); >+ if (selection == null) { >+ selection = StructuredSelection.EMPTY; >+ } >+ IWorkbenchPart part = (IWorkbenchPart) HandlerUtil.getVariable( >+ evaluationContext, ISources.ACTIVE_PART_NAME); >+ updateSelection(activeWorkbenchWindow, part, selection); >+ } >+ } >+ >+ private void updateSelection(IWorkbenchWindow activeWorkbenchWindow, >+ IWorkbenchPart part, ISelection selection) { >+ // If the action is run from within an editor, try and find the >+ // file for the given editor. >+ if (part != null && part instanceof IEditorPart) { >+ IEditorInput input = ((IEditorPart) part).getEditorInput(); >+ IFile file = ResourceUtil.getFile(input); >+ if (file != null) { >+ selectionChanged((IAction) null, new StructuredSelection(file)); >+ } >+ } else { >+ // Fallback is to prime the action with the selection >+ selectionChanged((IAction) null, selection); >+ } >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 303784
:
161751
|
161758
| 161773