Annotations [message #334347] |
Wed, 04 February 2009 11:03 |
Eclipse User |
|
|
|
Originally posted by: franklin.in.tum.de
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--B_3316593816_101560
Content-type: multipart/alternative;
boundary="B_3316593816_69896"
--B_3316593816_69896
Content-type: text/plain;
charset="ISO-8859-1"
Content-transfer-encoding: 8bit
Hi,
I'm currently integrating a clone detection tool(
http://conqat.cs.tum.edu/index.php/ConQAT) into Eclipse. One of the features
I am working on, is to display a clone region in the Java Editor. For this
purpose I've started knocking around with Annotations. So far, I've managed
to create an Annotation and add it to the Annotation Model (see screenshot,
it's the blue and red bar).
My Annotation class extends Annotation and implements
IAnnotationPresentation. I then use the paint method, to paint the two
vertical bars. So far, so good. Now, I want the user to be able to click on
the Annotation and get a Context Menu (not a Context Menu for the vertical
ruler as a whole, but just for the seleted annotation). This where I got
stuck. I tried setting up a Vertical Ruler Listener, but that didn
|
|
|
Re: Annotations [message #334367 is a reply to message #334347] |
Thu, 05 February 2009 08:11 |
Dani Megert Messages: 3802 Registered: July 2009 |
Senior Member |
|
|
Jason Franklin wrote:
> Hi,
>
>
> I'm currently integrating a clone detection tool(
> http://conqat.cs.tum.edu/index.php/ConQAT)
> <http://conqat.cs.tum.edu/index.php/ConQAT%29> into Eclipse. One of
> the features I am working on, is to display a clone region in the Java
> Editor. For this purpose I've started knocking around with
> Annotations. So far, I've managed to create an Annotation and add it
> to the Annotation Model (see screenshot, it's the blue and red bar).
> My Annotation class extends Annotation and implements
> IAnnotationPresentation. I then use the paint method, to paint the two
> vertical bars. So far, so good. Now, I want the user to be able to
> click on the Annotation and get a Context Menu (not a Context Menu for
> the vertical ruler as a whole, but just for the seleted annotation).
> This where I got stuck.
Take a look at the org.eclipse.ui.editorActions extension point.
Dani
> I tried setting up a Vertical Ruler Listener, but that didn’t work:
>
> IVerticalRulerInfo service = (IVerticalRulerInfo)
> editor.getAdapter(IVerticalRulerInfo.class); if(service == null)
> System.out.println("Service is null"); if(service instanceof
> IVerticalRulerInfoExtension){ System.out.println("The service is
> active"); ((IVerticalRulerInfoExtension)
> service).addVerticalRulerListener(new RulerListener());
> I’ve been googeling the last two days and searching news groups, but I
> can’t seem to find anything I can use. If anybody can at least give me
> a hint in the right direction, I would be very thankful.
>
> Regards,
>
> Jason Franklin
|
|
|
Powered by
FUDForum. Page generated in 0.02812 seconds