Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Model Change Notification, Adapters, GEF, ArrayStoreException
Model Change Notification, Adapters, GEF, ArrayStoreException [message #388690] Tue, 19 October 2004 12:58 Go to next message
Eclipse UserFriend
Originally posted by: fleque.users.NoSpam.sourceforge.net

Hello,

I'm developing an GEF (3.0.1) editor for my EMF (2.0.1) model.

In order to reflect changes to the model (done by GEF-Commands) I tried
to use code found in a IBM Redbook
"Eclipse Development, using the Graphical Editing Framework and the
Eclipse Modeling Framework"
(http://www.redbooks.ibm.com/redbooks/pdfs/sg246302.pdf).

As written there on page 175 I could add the instance of my EditPart
(subclass of org.eclipse.gef.editparts.AbstractGraphicalEditPart) to the
list of adapters of my model by doing something like this:


public void activate(){
if (isActive())
return;
((Notifier)getModel()).eAdapters.add(this);
super.activate();
}

Now by implementing/overriding notifyChanged I could react on model changes.
But everytime I call eAdapters.add() I get the following Exception:

java.lang.ArrayStoreException
at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.jav a:187)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:618)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:5 99)
at
org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapte rList.add(BasicNotifierImpl.java:115)

Any Ideas ??

Thanks

Alex
Re: Model Change Notification, Adapters, GEF, ArrayStoreException [message #388693 is a reply to message #388690] Tue, 19 October 2004 13:50 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Alex,

Your "this" needs to implement the org.eclipse.emf.common.notify.Adapter
interface.


Alex Bieber wrote:

> Hello,
>
> I'm developing an GEF (3.0.1) editor for my EMF (2.0.1) model.
>
> In order to reflect changes to the model (done by GEF-Commands) I
> tried to use code found in a IBM Redbook
> "Eclipse Development, using the Graphical Editing Framework and the
> Eclipse Modeling Framework"
> (http://www.redbooks.ibm.com/redbooks/pdfs/sg246302.pdf).
>
> As written there on page 175 I could add the instance of my EditPart
> (subclass of org.eclipse.gef.editparts.AbstractGraphicalEditPart) to
> the list of adapters of my model by doing something like this:
>
>
> public void activate(){
> if (isActive())
> return;
> ((Notifier)getModel()).eAdapters.add(this);
> super.activate();
> }
>
> Now by implementing/overriding notifyChanged I could react on model
> changes.
> But everytime I call eAdapters.add() I get the following Exception:
>
> java.lang.ArrayStoreException
> at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.jav a:187)
> at
> org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList. java:618)
> at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:5 99)
> at
> org.eclipse.emf.common.notify.impl.BasicNotifierImpl$EAdapte rList.add(BasicNotifierImpl.java:115)
>
>
> Any Ideas ??
>
> Thanks
>
> Alex


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Model Change Notification, Adapters, GEF, ArrayStoreException [message #388699 is a reply to message #388693] Tue, 19 October 2004 14:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fleque.users.NoSpam.sourceforge.net

Thanks,

works fine now ...

Alex


Ed Merks wrote:
> Alex,
>
> Your "this" needs to implement the org.eclipse.emf.common.notify.Adapter
> interface.
Re: Model Change Notification, Adapters, GEF, ArrayStoreException [message #893702 is a reply to message #388690] Thu, 05 July 2012 10:15 Go to previous messageGo to next message
Karthikeyan Missing name is currently offline Karthikeyan Missing nameFriend
Messages: 47
Registered: July 2011
Member
Hi,

I have created EditPart and added adapter for that edit part and added create command, if my create command model added in editor, but it does not reflect in the editor, ie notifychanged of editpart is not being called, what may be the issue?
Re: Model Change Notification, Adapters, GEF, ArrayStoreException [message #893706 is a reply to message #893702] Thu, 05 July 2012 10:24 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Did you add an adapter to the model?

On 05/07/2012 12:15 PM, Karthikeyan Mising name wrote:
> Hi,
> I have created EditPart and added adapter for that edit part and
> added create command, if my create command model added in editor, but
> it does not reflect in the editor, ie notifychanged of editpart is not
> being called, what may be the issue?


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[CDO] Migration
Next Topic:[CDO] Encounter java.lang.OutOfMemoryError: GC overhead limit exceeded when commit from 4 clients
Goto Forum:
  


Current Time: Thu Apr 25 20:58:07 GMT 2024

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

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

Back to the top