[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: property change notification

"Sidney Lee" <sidus68@xxxxxxxxx> wrote in message
news:f8d95960e372e0c45508d1c27cfa388b$1@xxxxxxxxxxxxxxxxxx
> Hi!
>
> Having problems with property change notification. I have the editor, a
> property view, as well as an outline view. Model objects extend
> org.eclipse.jface.util.ListenerList. The edit parts for both editor and
> outline views implement IPropertyChangeListener. When I update an
> attribute in the property view, the corresponding edit parts for both
> editor and outline views are notified, as expected.
>
> The outline view will always display a complete edit part hierarchy but
> the editor might only show a subset (one, several or all panels).
> Selection in the outline view determines what to show in the editor, so
> the tree edit parts in the outline view implement
> org.eclipse.jface.viewers.ISelectionChangedListener. When a panel is
> selected the model is updated (visible=true/false, for example) and this
> in turn fires a propertyChange. However, on this ocassion, only the edit
> parts for the outline view are notified but I need the editor to be
> notified so I can show/hide the appropriate model objects. The edit parts
> in the editor do not implement ISelectionChangedListener as selected
> objects may not be visible.

They need to.  Listening for the visibility property is not the same as
setting the value of that property when the selection changes.  What you
should do is have the visibility notification happen in the same way as the
rest of the notification (i.e., no need for ISelectionChangedListener).
Then your editor will get notified of visibility changes and can update
appropriately.  However, only your OutlineViewer should change that property
(when an EditPart is selected).

>
> Any suggestions?
>
> Many Thanks!
>