I see no EMF objects. What am I doing wrong

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

I see no EMF objects. What am I doing wrong

Postby richardcatlin » Thu Jul 02, 2009 8:42 am

I see no EMF objects. What am I doing wrong

I created an EMF project from an annotated Java interface called Contacts. Contacts hold a list of Contact objects.
Using the EMF genmodel, the "model" classes are created.
Additionally, the EMF "Edit" project and classes are created, which have a ContactItemProvider (implements ContentProvider and LabelProvider).
An "Editor" project is created which binds a TreeViewer to the Edit classes.
The Editor project works.

I create a new WindowBuilder/RCP/ViewPart in the "Editor" project, drop a TableViewer onto the ViewPart, switch to the DataBinding, then I click on the EMF icon next to the beans icon, but no EMF object appear. What am I doing wrong?

Thanks for any help.
Richard Catlin
richardcatlin
 
Posts: 3
Joined: Wed Jun 17, 2009 11:00 am

Re: I see no EMF objects. What am I doing wrong

Postby Eric Clayberg » Thu Jul 02, 2009 10:03 am

richardcatlin wrote:I create a new WindowBuilder/RCP/ViewPart in the "Editor" project, drop a TableViewer onto the ViewPart, switch to the DataBinding, then I click on the EMF icon next to the beans icon, but no EMF object appear. What am I doing wrong?

Do you have any EMF objects created in your class?

You can only bind to objects that are instantiated within your class.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: I see no EMF objects. What am I doing wrong

Postby anderswt » Wed Dec 30, 2009 5:43 am

Hi I got the similar problems with EMF for Mac Snow lepard 64bit and SWT Designer 7.2., Eclipse 3.5

I can see the EMF class in SWT Designer but not ALL its properties. Its seems as if properties from some superclasses are not recognized in SWT Designer if the are located in another package than the the used class (referenced from the UI class). Ive tried to instantiate thossuperclasses bt no luck.

What to do?

/anders
anderswt
 
Posts: 3
Joined: Wed Dec 30, 2009 4:20 am

Re: I see no EMF objects. What am I doing wrong

Postby Eric Clayberg » Sat Jan 02, 2010 2:15 pm

Please post a small test case of what you are trying to do.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: I see no EMF objects. What am I doing wrong

Postby anderswt » Mon Jan 04, 2010 5:19 am

Hi here is a small case where the superattributes from NamedElement no IdentifiableElement (abstract) cannot be seen in the EMF bindings editor.
thanks for any assisatance.
/anders
Attachments
Archive.zip
(3.97 KiB) Downloaded 50 times
TestComp.java
(978 Bytes) Downloaded 49 times
anderswt
 
Posts: 3
Joined: Wed Dec 30, 2009 4:20 am

Re: I see no EMF objects. What am I doing wrong

Postby Eric Clayberg » Mon Jan 04, 2010 12:52 pm

Thanks for the example. Please give this a try using the latest SWT Designer v7.2 build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: I see no EMF objects. What am I doing wrong

Postby anderswt » Mon Jan 04, 2010 2:00 pm

Thanks guys, it seems to work now. Must be the quickest bugfix ever for me :)

/anders
anderswt
 
Posts: 3
Joined: Wed Dec 30, 2009 4:20 am

Re: I see no EMF objects. What am I doing wrong

Postby Eric Clayberg » Mon Jan 04, 2010 2:55 pm

Glad that worked for you.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: I see no EMF objects. What am I doing wrong

Postby Joel.Rosi-Schwartz » Sun Jan 24, 2010 10:35 am

Hi,

I am also have having problems with getting EMF data binding working. I am on OS X 10.6 and SWT Designer 7.2 latest build. Here is a screen shot that shows how I am wiring this and the (non) results I am getting. Btw, if you have an example of a working example project with EMF data binding it would be great to take a look at how it goes together.

Thanks,
Joel

Image
Joel.Rosi-Schwartz
 
Posts: 7
Joined: Sat Jan 23, 2010 6:07 am

Re: I see no EMF objects. What am I doing wrong

Postby Eric Clayberg » Sun Jan 24, 2010 12:20 pm

Joel.Rosi-Schwartz wrote:Here is a screen shot that shows how I am wiring this and the (non) results I am getting

Please post the source for the entire class.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: I see no EMF objects. What am I doing wrong

Postby Joel.Rosi-Schwartz » Mon Jan 25, 2010 5:40 am

Eric Clayberg wrote:
Joel.Rosi-Schwartz wrote:Here is a screen shot that shows how I am wiring this and the (non) results I am getting

Please post the source for the entire class.


I've worked this out, seems as if my model was corrupt. When I straightened that out things fell into place.

I still think that supplying the source for "EMF Data Bindings" project in the docs (which appears to be based on the EMf Library example) would be very useful as a learning exercise.

Thank for the prompt response.

Cheers,
Joel
Joel.Rosi-Schwartz
 
Posts: 7
Joined: Sat Jan 23, 2010 6:07 am

Re: I see no EMF objects. What am I doing wrong

Postby Eric Clayberg » Mon Jan 25, 2010 10:12 am

Joel.Rosi-Schwartz wrote:I still think that supplying the source for "EMF Data Bindings" project in the docs (which appears to be based on the EMf Library example) would be very useful as a learning exercise.

The code for the screen shots in the docs is attached, but it is not a working example.
Attachments
TestEMF.zip
(72.59 KiB) Downloaded 51 times
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: I see no EMF objects. What am I doing wrong

Postby Joel.Rosi-Schwartz » Mon Jan 25, 2010 10:20 am

Eric Clayberg wrote:
Joel.Rosi-Schwartz wrote:I still think that supplying the source for "EMF Data Bindings" project in the docs (which appears to be based on the EMf Library example) would be very useful as a learning exercise.

The code for the screen shots in the docs is attached, but it is not a working example.


Many thanks :-)
Joel.Rosi-Schwartz
 
Posts: 7
Joined: Sat Jan 23, 2010 6:07 am

Re: I see no EMF objects. What am I doing wrong

Postby Eric Clayberg » Tue Jan 26, 2010 6:51 am

Hope it helps.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: I see no EMF objects. What am I doing wrong

Postby Mauro » Mon Feb 08, 2010 6:21 pm

Hi,
I just downloaded today the trial version of SWT Builder, so most likely I'm missing some very basic understanding.

I am trying to use WB to build an editor for a model I have in EMF.

I have several problems:
First (solved) was I had no entry in the "Model (Eclipse Modeling Framework)" pane. I now understand I need an instance variable that points to my model.
Second problem is this doesn't seem enough: apparently WB is unable to follow the links. This shows in two distinct ways:

my (simplified) model (I can send the complete model, if useful) is like this:

Code: Select all
/**
* @model
*/
public interface IBase extends EObject {
    /**
     * @model
     */
    public String getTitle();

    /**
     * @model default="false" changeable="true" unsettable="true"
     */
    public boolean isUnused();

    ...
}

/**
* @model
*/
public interface World extends IBase {
    /**
     * @model
     */
    public String getAuthor();

    /**
     * @model opposite="world" containment="true"
     */
    public EList<Book> getBook();

   ...         
}

/**
* @model
*/
public interface Book extends IBase {
   /**
     * @model opposite="book"
     */
    World getWorld();

    /**
     * @model
     */
    Project getProject();

   ...
}


In my test page I have:
Code: Select all
public class WorldOverview extends FormPage {
    private DataBindingContext m_bindingContext;
    private World world;
   ...


Here I have, as said, two distinct problems:

I see in the Binding pane ONLY the properties declared in World: in order to see the properties of the IBase ancestor I need to do something like:
Code: Select all
private IBase iWorld = world;

and then I can see in iWorld the properties defined in IBASE (but not those defined in World).

Other problem is I seem unable to navigate to the Book child.
How should I declare it? I tried adding yet another member variable:
Code: Select all
EList<Book> books;

and initializing it as:
Code: Select all
books = world.getBook();
but it simply doesn't work

Is this so?
What is the best course of action to implement such a thing?
I cannot lose to much time searching dead alleys if I want to evaluate WB in the short time allowed :)

My first goal is to display some (editable) fields taken directly from World (and IBAse) and to display a table with info taken from Book (one book per line).
Then I need to use the (single) selection in the table to select further info in Books and in classes contained in it.

Can this be done or I have to forget about it and code manualy?

Thanks in Advance
Mauro
Mauro
 
Posts: 7
Joined: Mon Feb 08, 2010 5:39 pm

Next

Return to SWT Designer

Who is online

Users browsing this forum: Google [Bot] and 2 guests