Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » marker link to EditPart
marker link to EditPart [message #119514] Wed, 25 February 2004 20:36 Go to next message
Eclipse User
Originally posted by: david_michonneau.hotmail.com

I would like to create a new type of marker that will allow me to point to
an EditPart from the Tasks view, like the java errors that select the
current line and word that correspond to the marker.

For example, I will have a builder that will check my file for errors. It
will find a problem in one place, that corresponds to a model object, and
create the marker, that reference this model object by name or id. This
marker will appear in the tasks view, when the user clicks on it, I want the
GEF editor to open the file, and select automatically the EditPart that
correspond to the model object referenced by my marker.

I have two questions:

1- how can I find an EditPart from a model object? I know how to get the
model from the EditPart, but it seems difficult the other way round, I can't
really afford to query all my editparts for that.

2-Let's say I found the EditPart, how can I select it or change its color
when I click on the marker in the tasks view given that I need to
a- open the file in the editor (this seems to be the default behaviour
in the tasks view)
b-wait until it's loaded and EditParts are created, then select the
EditPart (where should I hook this code, and how to select an EditPart
programmatically?)

Thanks,

David
Re: marker link to EditPart [message #119528 is a reply to message #119514] Wed, 25 February 2004 22:30 Go to previous messageGo to next message
Eclipse User
Originally posted by: none.us.ibm.com

Wow, this one's easy :-0...

> I would like to create a new type of marker that will allow me to point to
> an EditPart from the Tasks view, like the java errors that select the
> current line and word that correspond to the marker.
>
> For example, I will have a builder that will check my file for errors. It
> will find a problem in one place, that corresponds to a model object, and
> create the marker, that reference this model object by name or id. This
> marker will appear in the tasks view, when the user clicks on it, I want
the
> GEF editor to open the file, and select automatically the EditPart that
> correspond to the model object referenced by my marker.
>
> I have two questions:
>
> 1- how can I find an EditPart from a model object? I know how to get the
> model from the EditPart, but it seems difficult the other way round, I
can't
> really afford to query all my editparts for that.

EditPart part = (cast)editpartViewer.getEditPartRegistry().get(theModel);

> 2-Let's say I found the EditPart, how can I select it or change its color
> when I click on the marker in the tasks view given that I need to
> a- open the file in the editor (this seems to be the default behaviour
> in the tasks view)
> b-wait until it's loaded and EditParts are created, then select the
> EditPart (where should I hook this code, and how to select an EditPart
> programmatically?)

editpartViewer.select(editpart);
//make sure it's visible on the screen (scrolling)
editpartViewer.reveal(editpart);
Re: marker link to EditPart [message #724031 is a reply to message #119528] Sat, 10 September 2011 08:11 Go to previous messageGo to next message
karthick9686@gmail.com Missing name
Messages: 41
Registered: July 2011
Member
my gotomarker methd is not called . how to get call to that method when the error is clicked in problems view
Re: marker link to EditPart [message #727956 is a reply to message #724031] Thu, 22 September 2011 05:37 Go to previous message
Marko Martin is currently offline Marko Martin
Messages: 1
Registered: September 2011
Junior Member
*PUSH*
I would be interested in that point, too - how to register a listener that is called when an item in the problems view is selected?
Thanks for hints.
Previous Topic:[Zest] setBackgroundImage() for Graph doesn't work
Next Topic:[ZEST] Define node positions
Goto Forum:
  


Current Time: Mon Jul 28 06:29:43 EDT 2014

Powered by FUDForum. Page generated in 0.01688 seconds