Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » how to inform item providers of global selection events ?
how to inform item providers of global selection events ? [message #414511] Fri, 09 November 2007 18:51 Go to next message
Eclipse UserFriend
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
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/
Previous Topic:validating without any editor context
Next Topic:Problem with EMap using EStore
Goto Forum:
  


Current Time: Fri Apr 19 20:04:51 GMT 2024

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

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

Back to the top