Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to get ItemProvider/ItemProviderAdapterFactory for an Object
How to get ItemProvider/ItemProviderAdapterFactory for an Object [message #1705708] Tue, 18 August 2015 13:09 Go to next message
Simon Eismann is currently offline Simon EismannFriend
Messages: 5
Registered: August 2015
Junior Member
Hello Guys,

I am currently trying to write some cutom listeners and to do so i need to be able to get the ItemProvider for an EObject. I am currently using:

private IChangeNotifier getItemProvider(Object listenee) {
return (IChangeNotifier) new XYZItemProviderAdapterFactory().adapt(
(EObject)listenee, listenee.getClass());
}

This works fine, the architecture i am working with uses multiple packages, so the above function only works for Objects from the package XYZ. Is there a more convieneint way to do this?

Greetings,
Simon
Re: How to get ItemProvider/ItemProviderAdapterFactory for an Object [message #1705745 is a reply to message #1705708] Tue, 18 August 2015 17:58 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30352
Registered: July 2009
Senior Member
Simon,

You can directly listen to any EObject by adding an adapter to the
EObject.eAdapters() list.


On 18/08/2015 7:34 PM, Simon Eismann wrote:
> Hello Guys,
>
> I am currently trying to write some cutom listeners and to do so i
> need to be able to get the ItemProvider for an EObject. I am currently
> using:
>
> private IChangeNotifier getItemProvider(Object listenee) {
> return (IChangeNotifier) new
> XYZItemProviderAdapterFactory().adapt(
> (EObject)listenee, listenee.getClass());
> }
>
> This works fine, the architecture i am working with uses multiple
> packages, so the above function only works for Objects from the
> package XYZ. Is there a more convieneint way to do this?
>
> Greetings,
> Simon
Previous Topic:Creating EClass by EClass
Next Topic:EditUtil.getURI signature change in Mars?
Goto Forum:
  


Current Time: Mon Aug 19 05:29:54 GMT 2019

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

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

Back to the top