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 158969 Details for
Bug 272172
[rulers][hovering] Add a command that allows to show the vertical ruler hover
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fix
272172.txt (text/plain), 14.00 KB, created by
Deepak Azad
on 2010-02-12 07:11:25 EST
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Deepak Azad
Created:
2010-02-12 07:11:25 EST
Size:
14.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface.text >Index: src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java,v >retrieving revision 1.53 >diff -u -r1.53 AnnotationBarHoverManager.java >--- src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java 25 Sep 2009 10:55:58 -0000 1.53 >+++ src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java 12 Feb 2010 11:48:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -747,6 +747,32 @@ > } > > /** >+ * Returns the annotation hover for the current keyboard action or <code>null</code> if no >+ * hover is shown. >+ * >+ * @return the annotation hover for the current keyboard action or <code>null</code> >+ * @since 3.6 >+ */ >+ public IAnnotationHover getAnnotationHoverForKeyboardAction() { >+ IAnnotationHover hover= null; >+ if (fVerticalRulerInfo instanceof CompositeRuler) { >+ CompositeRuler comp= (CompositeRuler)fVerticalRulerInfo; >+ for (Iterator it= comp.getDecoratorIterator(); it.hasNext();) { >+ Object o= it.next(); >+ if (o instanceof IVerticalRulerInfoExtension && o instanceof IVerticalRulerInfo) { >+ hover= ((IVerticalRulerInfoExtension)o).getHover(); >+ break; >+ } >+ } >+ } >+ >+ if (hover == null) { >+ hover= fAnnotationHover; >+ } >+ return hover; >+ } >+ >+ /** > * Returns an adapter that gives access to internal methods. > * <p> > * <strong>Note:</strong> This method is not intended to be referenced or overridden by clients. >Index: src/org/eclipse/jface/text/source/ISourceViewerExtension3.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISourceViewerExtension3.java,v >retrieving revision 1.6 >diff -u -r1.6 ISourceViewerExtension3.java >--- src/org/eclipse/jface/text/source/ISourceViewerExtension3.java 31 Dec 2008 21:14:34 -0000 1.6 >+++ src/org/eclipse/jface/text/source/ISourceViewerExtension3.java 12 Feb 2010 11:48:28 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2008 IBM Corporation and others. >+ * Copyright (c) 2006, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -48,4 +48,13 @@ > */ > IAnnotationHover getCurrentAnnotationHover(); > >+ /** >+ * Returns the annotation hover for the current keyboard action if any, <code>null</code> >+ * otherwise. >+ * >+ * @return the annotation hover for the current keyboard action or <code>null</code> >+ * @since 3.6 >+ */ >+ IAnnotationHover getAnnotationHoverForKeyboardAction(); >+ > } >Index: src/org/eclipse/jface/text/source/SourceViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java,v >retrieving revision 1.90 >diff -u -r1.90 SourceViewer.java >--- src/org/eclipse/jface/text/source/SourceViewer.java 11 Dec 2009 12:47:02 -0000 1.90 >+++ src/org/eclipse/jface/text/source/SourceViewer.java 12 Feb 2010 11:48:29 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -1190,4 +1190,14 @@ > return null; > return fVerticalRulerHoveringController.getCurrentAnnotationHover(); > } >+ >+ /* >+ * @see org.eclipse.jface.text.source.ISourceViewer#getCurrentAnnotationHover(int y) >+ * @since 3.6 >+ */ >+ public IAnnotationHover getAnnotationHoverForKeyboardAction() { >+ if (fVerticalRulerHoveringController == null) >+ return null; >+ return fVerticalRulerHoveringController.getAnnotationHoverForKeyboardAction(); >+ } > } >#P org.eclipse.ui.editors >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/plugin.properties,v >retrieving revision 1.75 >diff -u -r1.75 plugin.properties >--- plugin.properties 27 May 2009 15:25:30 -0000 1.75 >+++ plugin.properties 12 Feb 2010 11:48:31 -0000 >@@ -1,5 +1,5 @@ > ############################################################################### >-# Copyright (c) 2000, 2009 IBM Corporation and others. >+# Copyright (c) 2000, 2010 IBM Corporation and others. > # All rights reserved. This program and the accompanying materials > # are made available under the terms of the Eclipse Public License v1.0 > # which accompanies this distribution, and is available at >@@ -111,6 +111,9 @@ > command.showChangeRulerInformation.name = Show Quick Diff Ruler Tooltip > command.showChangeRulerInformation.description = Displays quick diff or revision information for the caret line in a focused hover > >+command.showRulerAnnotationInformation.name = Show Ruler Annotation Tooltip >+command.showRulerAnnotationInformation.description = Displays annotation information for the caret line in a focused hover >+ > conversionActionSet.label= Convert Line Delimiters > conversionSubMenu.label= Con&vert Line Delimiters To > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/plugin.xml,v >retrieving revision 1.119 >diff -u -r1.119 plugin.xml >--- plugin.xml 13 May 2009 15:57:09 -0000 1.119 >+++ plugin.xml 12 Feb 2010 11:48:32 -0000 >@@ -135,6 +135,12 @@ > categoryId="org.eclipse.ui.category.textEditor" > id="org.eclipse.ui.edit.text.showChangeRulerInformation"> > </command> >+ <command >+ name="%command.showRulerAnnotationInformation.name" >+ description="%command.showRulerAnnotationInformation.description" >+ categoryId="org.eclipse.ui.category.textEditor" >+ id="org.eclipse.ui.edit.text.showRulerAnnotationInformation"> >+ </command> > </extension> > > <extension >Index: src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java,v >retrieving revision 1.137 >diff -u -r1.137 AbstractDecoratedTextEditor.java >--- src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java 20 Jan 2010 16:48:10 -0000 1.137 >+++ src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java 12 Feb 2010 11:48:34 -0000 >@@ -1255,6 +1255,14 @@ > }; > action.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_CHANGE_RULER_INFORMATION_ID); > setAction(ITextEditorActionConstants.SHOW_CHANGE_RULER_INFORMATION, action); >+ >+ action= new ResourceAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ShowRulerAnnotationInformation.", IAction.AS_PUSH_BUTTON) { //$NON-NLS-1$ >+ public void run() { >+ showRulerAnnotationInformation(); >+ } >+ }; >+ action.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_RULER_ANNOTATION_INFORMATION_ID); >+ setAction(ITextEditorActionConstants.SHOW_RULER_ANNOTATION_INFORMATION, action); > } > > /** >@@ -1305,6 +1313,51 @@ > } > > /** >+ * Opens a sticky ruler annotation hover for the caret line. Does nothing if no annotation hover >+ * is available. >+ * >+ * @since 3.6 >+ */ >+ private void showRulerAnnotationInformation() { >+ IVerticalRuler ruler= getVerticalRuler(); >+ if (!(ruler instanceof CompositeRuler) || fLineNumberRulerColumn == null) >+ return; >+ >+ CompositeRuler compositeRuler= (CompositeRuler)ruler; >+ >+ // fake a mouse move (some hovers rely on this to determine the hovered line): >+ int x= fLineNumberRulerColumn.getControl().getLocation().x; >+ >+ ISourceViewer sourceViewer= getSourceViewer(); >+ StyledText textWidget= sourceViewer.getTextWidget(); >+ int caretOffset= textWidget.getCaretOffset(); >+ int caretLine= textWidget.getLineAtOffset(caretOffset); >+ int y= textWidget.getLinePixel(caretLine); >+ >+ compositeRuler.setLocationOfLastMouseButtonActivity(x, y); >+ >+ IAnnotationHover hover= ((SourceViewer)sourceViewer).getAnnotationHoverForKeyboardAction(); >+ >+ int modelCaretOffset= widgetOffset2ModelOffset(sourceViewer, caretOffset); >+ if (modelCaretOffset == -1) >+ return; >+ >+ IDocument document= sourceViewer.getDocument(); >+ if (document == null) >+ return; >+ >+ try { >+ int line= document.getLineOfOffset(modelCaretOffset); >+ if (fInformationPresenter == null) { >+ fInformationPresenter= new FocusedInformationPresenter(sourceViewer, getSourceViewerConfiguration()); >+ } >+ fInformationPresenter.openFocusedAnnotationHover(hover, line); >+ } catch (BadLocationException e) { >+ return; >+ } >+ } >+ >+ /** > * Creates and registers the print action. > * > * @since 3.4 >Index: src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties,v >retrieving revision 1.12 >diff -u -r1.12 ConstructedTextEditorMessages.properties >--- src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties 16 Nov 2009 09:10:56 -0000 1.12 >+++ src/org/eclipse/ui/texteditor/ConstructedTextEditorMessages.properties 12 Feb 2010 11:48:34 -0000 >@@ -1,5 +1,5 @@ > ############################################################################### >-# Copyright (c) 2000, 2009 IBM Corporation and others. >+# Copyright (c) 2000, 2010 IBM Corporation and others. > # All rights reserved. This program and the accompanying materials > # are made available under the terms of the Eclipse Public License v1.0 > # which accompanies this distribution, and is available at >@@ -109,3 +109,8 @@ > Editor.ShowChangeRulerInformation.tooltip= Show Quick Diff Ruler Tooltip > Editor.ShowChangeRulerInformation.image= > Editor.ShowChangeRulerInformation.description= Displays change information for the caret line in a focused hover >+ >+Editor.ShowRulerAnnotationInformation.label= Show Ruler Annotation Tooltip >+Editor.ShowRulerAnnotationInformation.tooltip= Show Ruler Annotation Tooltip >+Editor.ShowRulerAnnotationInformation.image= >+Editor.ShowRulerAnnotationInformation.description= Displays annotation information for the caret line in a focused hover >#P org.eclipse.ui.workbench.texteditor >Index: src/org/eclipse/ui/texteditor/ITextEditorActionConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionConstants.java,v >retrieving revision 1.47 >diff -u -r1.47 ITextEditorActionConstants.java >--- src/org/eclipse/ui/texteditor/ITextEditorActionConstants.java 12 Oct 2009 12:18:58 -0000 1.47 >+++ src/org/eclipse/ui/texteditor/ITextEditorActionConstants.java 12 Feb 2010 11:48:37 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -680,4 +680,12 @@ > * @since 3.6 > */ > public static final String SHOW_CHANGE_RULER_INFORMATION= "ShowChangeRulerInformation"; //$NON-NLS-1$ >+ >+ /** >+ * Name of the action displaying a sticky ruler annotation hover for the current caret location. >+ * >+ * Value: <code>"ShowRulerAnnotationInformation"</code> >+ * @since 3.6 >+ */ >+ public static final String SHOW_RULER_ANNOTATION_INFORMATION= "ShowRulerAnnotationInformation"; //$NON-NLS-1$ > } >Index: src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java,v >retrieving revision 1.40 >diff -u -r1.40 ITextEditorActionDefinitionIds.java >--- src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java 12 Oct 2009 12:18:58 -0000 1.40 >+++ src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java 12 Feb 2010 11:48:37 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -585,4 +585,12 @@ > * @since 3.6 > */ > public static final String SHOW_CHANGE_RULER_INFORMATION_ID= "org.eclipse.ui.edit.text.showChangeRulerInformation"; //$NON-NLS-1$ >+ >+ /** >+ * Command ID of the command to display a sticky ruler annotation hover for the current caret >+ * location. Value <code>"org.eclipse.ui.edit.text.showRulerAnnotationInformation"</code>. >+ * >+ * @since 3.6 >+ */ >+ public static final String SHOW_RULER_ANNOTATION_INFORMATION_ID= "org.eclipse.ui.edit.text.showRulerAnnotationInformation"; //$NON-NLS-1$ > }
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 272172
:
157764
|
158965
|
158969
|
159013
|
159294
|
159881
|
160032
|
160185
|
161266
|
161267