Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8513075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:27:19+00:00 2026-06-11T04:27:19+00:00

I’m having trouble synchronising my GEF editor with the EMF-based model. I think this

  • 0

I’m having trouble synchronising my GEF editor with the EMF-based model. I think this is due to the fact that the model-internal EMF Adapter, or rather the methods it calls, aren’t finished before the editor’s Adapter’s notifyChanged() is called and updates the model children. This leads to the editor view being out-of-sync with the model itself, or rather, the changes to the model not being represented in the view when they should be.

Consider this set up. A Command “CreateNodeCommand” adds a node to the underlying model:

@Override
public void execute() {
...
getNewNode().setGraph(getGraph());
...
}

The GraphEditPart has an internal class extending org.eclipse.emf.common.notify.Adapter. It’s notifyChanged() method is indeed notified, as tested similar to below (incomplete code):

@Override
public void notifyChanged(Notification notification) {
  switch (notification.getEventType()) {
case Notification.ADD:
      System.err.println("ADD occurred!");
  refreshChildren();
}

The problem is, that the (third-party) model itself also implements an Adapter, which in turn runs a number of methods on the new model element, such as adding an ID, etc.

It seems to me that the fact that the new element’s figure doesn’t show up in the editor directly after it’s been created – but only after the next editing step, the figure for which then doesn’t appear – suggests that the model adapter is still busy setting up the new element while refreshChildren() is already being called by the editor adapter.

This seems to call for synchronisation, but I’m unsure whether this can be achieved with built-in Java functionality for multithreading, or calls for an EMF-based approach.

Please share your knowledge about synchronising in EMF.

Many thanks in advance!

EDIT

On request, here is the source code for the getModelChildren() method:

@Override 
protected List<EObject> getModelChildren() {
  List<EObject> allModelObjects = new ArrayList<EObject>();
  allModelObjects.addAll(((MyGraph) getModel()).getTokens());
  allModelObjects.addAll(((MyGraph) getModel()).getNodes());
  return allModelObjects;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:27:21+00:00Added an answer on June 11, 2026 at 4:27 am

    Debugging the (3rd party) model, I found out that the Graph‘s enotify() fired the notification before the actual adding took place, hence my Adapterreceived the notification too early, i.e., before the node had been added.

    The notification is now called after the add and everything works fine.

    Thanks for all of your help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I know there's a lot of other questions out there that deal with this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.