Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » showing feedback on connections adjacent to selected element
showing feedback on connections adjacent to selected element [message #190083] Tue, 02 August 2005 00:34 Go to next message
Eclipse UserFriend
Originally posted by: user.domain.invalid

Hi,
I would like to show connections whose source/dest is selected in a
different way. Given all the structure of parts/viewer/model, the best
way I can come up with is as follows:

- in the editor's selectionChanged() method I call my own version of
setSelected() on the selected node model.
- this setSelected() calls a srcDstSelected() method on all adjacent
connections
- srcDstSelected() notifies its part (that was registered with the model
through a custom event notification pattern)
- the part for the connection calls refreshVisual(), which shows some
custom feedback for these connections.

This is kind of cumbersome. Is there a better way to do this? Ideally
I'd like from selectionChanged() in the model to be able to retrieve the
part for a certain model. I would retrieve the parts for all the
connections adjacent to the selected element and call a method on them
to change the visual aspect (off course, I have to call the same method
on unselected elements to return the aspect to normal).

Any Idea?


Thanks,
Federica
Re: showing feedback on connections adjacent to selected element [message #190407 is a reply to message #190083] Wed, 03 August 2005 18:14 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

In your EditPart's setSelected() method, you can get the adjacent
connections and their editparts (using getViewer().getEditPartRegistry()).
Then just invoke (or queue the invocation of) viewer.appendSelection().

If your model stores selection state, then you can just select the
connections in the model. When connection editparts are notified of this
change, they append themselves to the selection.

<user@domain.invalid> wrote in message news:dcmf2a$69d$1@news.eclipse.org...
> Hi,
> I would like to show connections whose source/dest is selected in a
> different way. Given all the structure of parts/viewer/model, the best
> way I can come up with is as follows:
>
> - in the editor's selectionChanged() method I call my own version of
> setSelected() on the selected node model.
> - this setSelected() calls a srcDstSelected() method on all adjacent
> connections
> - srcDstSelected() notifies its part (that was registered with the model
> through a custom event notification pattern)
> - the part for the connection calls refreshVisual(), which shows some
> custom feedback for these connections.
>
> This is kind of cumbersome. Is there a better way to do this? Ideally
> I'd like from selectionChanged() in the model to be able to retrieve the
> part for a certain model. I would retrieve the parts for all the
> connections adjacent to the selected element and call a method on them
> to change the visual aspect (off course, I have to call the same method
> on unselected elements to return the aspect to normal).
>
> Any Idea?
>
>
> Thanks,
> Federica
Previous Topic:Closing and Opening an Editor
Next Topic:TreeViewer with lazy loading
Goto Forum:
  


Current Time: Mon Dec 02 20:22:31 GMT 2024

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

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

Back to the top