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 150218 Details for
Bug 163769
[rulers] overview ruler annotation arming not correct
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]
Patch v03
OverviewRuler 03.txt (text/plain), 5.89 KB, created by
Prakash Rangaraj
on 2009-10-22 06:16:04 EDT
(
hide
)
Description:
Patch v03
Filename:
MIME Type:
Creator:
Prakash Rangaraj
Created:
2009-10-22 06:16:04 EDT
Size:
5.89 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface.text >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.text/META-INF/MANIFEST.MF,v >retrieving revision 1.28 >diff -u -r1.28 MANIFEST.MF >--- META-INF/MANIFEST.MF 22 Sep 2009 06:55:58 -0000 1.28 >+++ META-INF/MANIFEST.MF 22 Oct 2009 10:12:01 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %pluginName > Bundle-SymbolicName: org.eclipse.jface.text >-Bundle-Version: 3.5.100.qualifier >+Bundle-Version: 3.6.100.qualifier > Bundle-Vendor: %providerName > Bundle-Localization: plugin > Export-Package: >Index: src/org/eclipse/jface/text/source/DefaultAnnotationHover.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultAnnotationHover.java,v >retrieving revision 1.7 >diff -u -r1.7 DefaultAnnotationHover.java >--- src/org/eclipse/jface/text/source/DefaultAnnotationHover.java 31 Dec 2008 21:14:34 -0000 1.7 >+++ src/org/eclipse/jface/text/source/DefaultAnnotationHover.java 22 Oct 2009 10:12:01 -0000 >@@ -26,7 +26,7 @@ > * > * @since 3.2 > */ >-public class DefaultAnnotationHover implements IAnnotationHover { >+public class DefaultAnnotationHover implements IAnnotationHover, IAnnotationHoverExtension3 { > > > /** >@@ -90,7 +90,18 @@ > return formatMultipleMessages(messages); > } > } >+ >+ return getHoverInfo(lineNumber); > >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.text.source.IAnnotationHoverExtension3#getHoverInfo(int) >+ */ >+ /** >+ * @since 3.6 >+ */ >+ public String getHoverInfo(int lineNumber) { > if (fShowLineNumber && lineNumber > -1) > return JFaceTextMessages.getFormattedString("DefaultAnnotationHover.lineNumber", new String[] { Integer.toString(lineNumber + 1) }); //$NON-NLS-1$ > >@@ -232,4 +243,5 @@ > > return javaAnnotations; > } >+ > } >Index: src/org/eclipse/jface/text/source/IAnnotationHoverExtension3.java >=================================================================== >RCS file: src/org/eclipse/jface/text/source/IAnnotationHoverExtension3.java >diff -N src/org/eclipse/jface/text/source/IAnnotationHoverExtension3.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/jface/text/source/IAnnotationHoverExtension3.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,38 @@ >+/******************************************************************************* >+ * Copyright (c) 2009 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.jface.text.source; >+ >+/** >+ * Extension interface for {@link org.eclipse.jface.text.source.IAnnotationHover} for >+ * <ul> >+ * <li>providing the hover information of a line without any annotations</li> >+ * </ul> >+ * >+ * @since 3.6 >+ * @author Prakash G.R. >+ * >+ */ >+public interface IAnnotationHoverExtension3 { >+ >+ /** >+ * Returns the text which should be presented in the a >+ * hover popup window. This information is requested based on >+ * the specified line number. The implementation should ignore any >+ * annotations in the line >+ * >+ * @param lineNumber the line number for which information is requested >+ * @return the requested information or <code>null</code> if no such information exists >+ * @since 3.6 >+ */ >+ String getHoverInfo(int lineNumber); >+ >+ >+} >Index: src/org/eclipse/jface/text/source/OverviewRulerHoverManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRulerHoverManager.java,v >retrieving revision 1.12 >diff -u -r1.12 OverviewRulerHoverManager.java >--- src/org/eclipse/jface/text/source/OverviewRulerHoverManager.java 11 Sep 2008 11:58:24 -0000 1.12 >+++ src/org/eclipse/jface/text/source/OverviewRulerHoverManager.java 22 Oct 2009 10:12:04 -0000 >@@ -51,7 +51,8 @@ > */ > protected void computeInformation() { > Point location= getHoverEventLocation(); >- int line= getVerticalRulerInfo().toDocumentLineNumber(location.y); >+ IVerticalRulerInfo verticalRulerInfo= getVerticalRulerInfo(); >+ int line= verticalRulerInfo.toDocumentLineNumber(location.y); > IAnnotationHover hover= getAnnotationHover(); > > IInformationControlCreator controlCreator= null; >@@ -59,7 +60,35 @@ > controlCreator= ((IAnnotationHoverExtension)hover).getHoverControlCreator(); > setCustomInformationControlCreator(controlCreator); > >- setInformation(hover.getHoverInfo(getSourceViewer(), line), computeArea(location.y)); >+ String hoverInfo; >+ if(hover instanceof IAnnotationHoverExtension3 && hasAnnotation(verticalRulerInfo, location.y)) { >+ hoverInfo= ((IAnnotationHoverExtension3)hover).getHoverInfo(line); >+ }else { >+ hoverInfo= hover.getHoverInfo(getSourceViewer(), line); >+ } >+ >+ setInformation(hoverInfo, computeArea(location.y)); >+ } >+ >+ /** >+ * This method calculates whether an annotation is shown in the particular y coordinate. >+ * >+ * @param verticalRulerInfo The vertical ruler in which annotions are searched for >+ * @param y_coordinate The coordinate in the ruler's SWT control >+ * >+ * @return <code>true</code> if an annotation exists, <code>false</code> otherwise >+ */ >+ private boolean hasAnnotation(IVerticalRulerInfo verticalRulerInfo, int y_coordinate) { >+ >+ if(verticalRulerInfo instanceof IOverviewRuler) { >+ IOverviewRuler overviewRuler = (IOverviewRuler)verticalRulerInfo; >+ int height= overviewRuler.getAnnotationHeight(); >+ for (int i= y_coordinate-height; i <y_coordinate+height; i++) { >+ if(overviewRuler.hasAnnotation(i)) >+ return true; >+ } >+ } >+ return false; > } > > /**
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 163769
:
72050
|
143870
|
144937
|
146934
|
150218
|
150219
|
150488
|
186620
|
186622
|
186755