Model Change Notification, Adapters, GEF, ArrayStoreException [message #388690] |
Tue, 19 October 2004 12:58 |
Eclipse User |
|
|
|
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 #893706 is a reply to message #893702] |
Thu, 05 July 2012 10:24 |
Ed Merks Messages: 33217 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/
|
|
|
Powered by
FUDForum. Page generated in 0.04478 seconds