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 7680601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:09:08+00:00 2026-05-31T18:09:08+00:00

I am creating an Eclipse RCP with a GEF editor and an EMF -based

  • 0

I am creating an Eclipse RCP with a GEF editor and an EMF-based model.

One thing that is mentioned about the model in the GEF Book is

The model should broadcast all state changes via listeners so that the
view can be updated without the model having any direct knowledge of
the controller or view.

In the book’s example, each model element class, e.g., Person, Marriage, etc. (the example is a genealogy editor), has methods to add and remove the respective listener, e.g., for Person the are:

public void addPersonListener(PersonListener l) {
    listeners.add(l);
}

public void removePersonListener(PersonListener l) {
    listeners.remove(l);
}

Unfortunately, the model I use doesn’t have these add/removeListener methods. Now I need a way to extend the model and implement the methods. I have no idea where to start really, as I don’t know much about EMF.

The model is graph-based, so it has nodes and edges (“relations”). Elements are added to the graph via calling, e.g., MyNode node = ExampleFactory.eINSTANCE.createMyNode() and adding the new node to the graph, e.g., graph.addMyNode(node).

What I don’t understand due to my lack of knowldege concerning EMF is where the “extension point” in the model would be.

The model structure is approximately as follows:

org.example.structure.MyGraph:

public interface MyGraph {
...
    MyRelation addMyNode(MyNode sourceMyNode, MyNode targetMyNode, 
        MYTYPE_NAME myRelationType);
...
}

Then there is als a class MyGraphImpl

org.example.structure.impl.MyGraphImpl:

public class MyGraphImpl extends Graph implements MyGraph {
...
protected MyGraphImpl() {
    super();
    this.init();
}
...
private void init()
{
    //creates indexes
}
...
@Override
public void addMyNode(MyNode myNode) 
{
    super.addNode(myNode);
}
...
}

Do I have to – to put it like that for want of knowledge – extend the single model classes with EMF (as described, e.g., on Lars Vogel’s website), or can I extend the model “per hand”?

And: Do I have to extend the **interface**s of the model (e.g., MyGraph), or their implementation classes (e.g., MyGraphImpl)?

I’ll be very thankful for any pointers in the right direction…

Thanks!

  • 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-05-31T18:09:10+00:00Added an answer on May 31, 2026 at 6:09 pm

    EMF has its own Notification mechanism, there is no need to add another listener-mechanism, a quick google-search gave me another tutorial of Lars with a nice example that demonstrates this mechanism

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

Sidebar

Related Questions

Can anyone suggest me some reading for creating Form based editor in Eclipse?
I am creating a plug-in for Eclipse that interacts with the Subclipse plug-in. One
I'm creating a project under eclipse that is to be shared by several developers.
While creating one folder in src directory in one project in eclipse, it makes
In Eclipse RCP, I am creating views for the Perspective using IPageLayout.addView(...) But this
I'm involved in a project that is attempting to use the Eclipse RCP splash
Background Our Eclipse RCP 3.6-based application lets people drag files in for storage/processing. This
In Eclipse, creating a GWT EntryPoint results in some generated code that looks like
I am creating an IClasspathContainer that access an installed OSGi Bundle (Eclipse Plugin) withing
Does anyone have a hello world sample or tutorial for creating an Eclipse plugin

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.