how to inform item providers of global selection events ? [message #414511] |
Fri, 09 November 2007 18:51 |
Eclipse User |
|
|
|
Originally posted by: tschappi.web.de
Hi,
i want to react on selection events in my view. I use an ItemProvider
that adapts a so called "FragmentResourceSet".
This FragmentResourceSet has several fragment stores("FragmentStore"),
that are displayed in my view. But now i want to display only these
fragment stores that match
the selected project in the package explorer.
I have already implemented a SelectionListener for the view to get
informed about selection events.
My question is, how to tell the ItemProvider about a selection change
event ?
As i understood, the ItemProvider is imformed if the adapted object
changes only. But selecting a project surely does not change the
FragmentResourceSet.
I only have to know in the getChildren method of the ItemProvider which
project actually is selected to show only the important FragmentStores
and with
every selection change event, i would call a refresh on the viewer, to
call the getChildern again. But unfotunately i'm at a loss what to do.
I don't want to react to the selection that takes place on my view, but
on selection that takes place at the package explorer or navigator.
Best regards,
- Silvio
|
|
|
Re: how to inform item providers of global selection events ? [message #414514 is a reply to message #414511] |
Fri, 09 November 2007 22:50 |
Ed Merks Messages: 33143 Registered: July 2009 |
Senior Member |
|
|
Silvio,
Maybe using a ViewerFilter would be easier. Our ViewerFilterAction
shows how that works; it is used to implement the Show Generics menubar
action in the Sample Ecore Editor (in the EcoreActionBarContributor).
Silvio wrote:
> Hi,
>
> i want to react on selection events in my view. I use an ItemProvider
> that adapts a so called "FragmentResourceSet".
> This FragmentResourceSet has several fragment stores("FragmentStore"),
> that are displayed in my view. But now i want to display only these
> fragment stores that match
> the selected project in the package explorer.
> I have already implemented a SelectionListener for the view to get
> informed about selection events.
> My question is, how to tell the ItemProvider about a selection change
> event ?
>
> As i understood, the ItemProvider is imformed if the adapted object
> changes only. But selecting a project surely does not change the
> FragmentResourceSet.
> I only have to know in the getChildren method of the ItemProvider
> which project actually is selected to show only the important
> FragmentStores and with
> every selection change event, i would call a refresh on the viewer, to
> call the getChildern again. But unfotunately i'm at a loss what to do.
>
> I don't want to react to the selection that takes place on my view,
> but on selection that takes place at the package explorer or navigator.
>
>
> Best regards,
>
> - Silvio
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03558 seconds