Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Opening Java Editor from Double Click
Opening Java Editor from Double Click [message #53556] Thu, 29 May 2003 10:47 Go to next message
Matt Hawkins is currently offline Matt HawkinsFriend
Messages: 7
Registered: July 2009
Junior Member
Hi, I have created a new view with a list of java classes that have errors
specific
to my plugin (not the Task View!) - I want to be able to double click on an
item
in my table list and it will open the relevant class in a Java editor. At
the moment
I double click and it brings up the Sample view of saying "double click
detected",
but thats about it!

Also on an aside - how can I underline text like the java editor does with
a red or green line underneath specific text?

Regards,

Matt Hawkins
Re: Opening Java Editor from Double Click [message #53979 is a reply to message #53556] Thu, 29 May 2003 15:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

"Matthew P Hawkins" <hawkini_uk@uk.ibm.com> wrote in message news:bb4ofo$ojn$1@rogue.oti.com...
> Hi, I have created a new view with a list of java classes that have errors
> specific
> to my plugin (not the Task View!) - I want to be able to double click on an
> item
> in my table list and it will open the relevant class in a Java editor. At

See the org.eclipse.ui.actions.OpenFileAction and ResourceNavigator.handleOpen for an example of how to use it.

> Also on an aside - how can I underline text like the java editor does with
> a red or green line underneath specific text?

The Java editor draws the squiggly lines on top of the text widget. It uses the AnnotationPainter to render annotations (search
results, errors). See also PaintManager and IPainter. You should be able to use an annotation painter.
Perhaps someone else can give a brief overview of how annotations work?

Knut
Re: Opening Java Editor from Double Click [message #58750 is a reply to message #53979] Mon, 02 June 2003 10:11 Go to previous messageGo to next message
Matt Hawkins is currently offline Matt HawkinsFriend
Messages: 7
Registered: July 2009
Junior Member
I've looked but I still do not understand what ResourceNavigator.handleOpen
does - it basically gets an ActionGroup (ResourceNavigator) and then
runs the defaultAction - which in ResourceNavigatorActionGroup is absolutely
nothing - and as for OpenFileAction that is completely wierd!

If anyone has some example code that they have specifically written for
their own view can they please give me a shout? Or alternatively if this
has been documented somewhere I would greatly appreciate a link :-)

Matt


"Knut Radloff" <knut_radloff@oti.com> wrote in message
news:bb587a$4hs$1@rogue.oti.com...
> "Matthew P Hawkins" <hawkini_uk@uk.ibm.com> wrote in message
news:bb4ofo$ojn$1@rogue.oti.com...
> > Hi, I have created a new view with a list of java classes that have
errors
> > specific
> > to my plugin (not the Task View!) - I want to be able to double click on
an
> > item
> > in my table list and it will open the relevant class in a Java editor.
At
>
> See the org.eclipse.ui.actions.OpenFileAction and
ResourceNavigator.handleOpen for an example of how to use it.
>
> > Also on an aside - how can I underline text like the java editor does
with
> > a red or green line underneath specific text?
>
> The Java editor draws the squiggly lines on top of the text widget. It
uses the AnnotationPainter to render annotations (search
> results, errors). See also PaintManager and IPainter. You should be able
to use an annotation painter.
> Perhaps someone else can give a brief overview of how annotations work?
>
> Knut
>
>
Re: Opening Java Editor from Double Click [message #66051 is a reply to message #58750] Fri, 06 June 2003 23:09 Go to previous message
Eclipse UserFriend
Originally posted by: knut_radloff.oti.com

"Matthew P Hawkins" <hawkini_uk@uk.ibm.com> wrote in message news:bbf7th$a5i$1@rogue.oti.com...
> I've looked but I still do not understand what ResourceNavigator.handleOpen
> does - it basically gets an ActionGroup (ResourceNavigator) and then
> runs the defaultAction - which in ResourceNavigatorActionGroup is absolutely
> nothing - and as for OpenFileAction that is completely wierd!

defaultAction is first invoked on MainActionGroup from ResourceNavigator.handleOpen.
It ends up in OpenActionGroup.runDefaultAction which passes the current selection (your IFile that has errors) to the
OpenFileAction.
Look at the super and subclasses.

Knut
Previous Topic:Replacing options in 'File->New'
Next Topic:Working example of revealing a tree node
Goto Forum:
  


Current Time: Fri Dec 27 01:33:23 GMT 2024

Powered by FUDForum. Page generated in 0.25900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top