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 157764 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), 10.14 KB, created by
Deepak Azad
on 2010-02-01 06:27:01 EST
(
hide
)
Description:
fix
Filename:
MIME Type:
Creator:
Deepak Azad
Created:
2010-02-01 06:27:01 EST
Size:
10.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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 1 Feb 2010 11:25:32 -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 Hover >+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 1 Feb 2010 11:25:33 -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 1 Feb 2010 11:25:34 -0000 >@@ -102,6 +102,8 @@ > import org.eclipse.jface.text.source.ISourceViewerExtension3; > import org.eclipse.jface.text.source.IVerticalRuler; > import org.eclipse.jface.text.source.IVerticalRulerColumn; >+import org.eclipse.jface.text.source.IVerticalRulerInfo; >+import org.eclipse.jface.text.source.IVerticalRulerInfoExtension; > import org.eclipse.jface.text.source.LineChangeHover; > import org.eclipse.jface.text.source.LineNumberChangeRulerColumn; > import org.eclipse.jface.text.source.LineNumberRulerColumn; >@@ -1255,6 +1257,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 +1315,61 @@ > } > > /** >+ * 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= null; >+ >+ for (Iterator it= compositeRuler.getDecoratorIterator(); it.hasNext();) { >+ Object o= it.next(); >+ if (o instanceof IVerticalRulerInfoExtension && o instanceof IVerticalRulerInfo) { >+ hover= ((IVerticalRulerInfoExtension) o).getHover(); >+ break; >+ } >+ } >+ if (hover == null) >+ return; >+ >+ 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 1 Feb 2010 11:25: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 Annotaiton Hover >+Editor.ShowRulerAnnotationInformation.tooltip= Show Ruler Annotation Hover >+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 1 Feb 2010 11:25: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 1 Feb 2010 11:25: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