Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » add a new instance Programatically in the editor view
add a new instance Programatically in the editor view [message #172011] Sun, 10 February 2008 18:54 Go to next message
wong is currently offline wongFriend
Messages: 54
Registered: July 2009
Member
Hello,

I want to add a new instance Programatically in the editor view.

I tried following, but it seems not work.
SkosFactory skosFactory = SkosFactoryImpl.eINSTANCE;
skos.Classification c =skosFactory.createClassification();
c.setName("new element");


Thank you.
Wong.
Re: add a new instance Programatically in the editor view [message #172104 is a reply to message #172011] Mon, 11 February 2008 13:37 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello wong,

You have to put newly created element somewhere into your model for example:

myClassificationContainer.getClassifications().add(c);

-----------------
Alex Shatalin
Re: add a new instance Programatically in the editor view [message #172207 is a reply to message #172104] Mon, 11 February 2008 17:13 Go to previous messageGo to next message
wong is currently offline wongFriend
Messages: 54
Registered: July 2009
Member
Hello,

Could you give me some more details or links, please. I could not find it
anywhere.

Thank you very much.
Wong.
Re: add a new instance Programatically in the editor view [message #172213 is a reply to message #172207] Mon, 11 February 2008 18:00 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello wong,

This is a generic EMF question. I sugegst you to read EMF documentation (e.g.
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.html,
containment reference).

-----------------
Alex Shatalin
Previous Topic:Error : "Figure must be a child" in refreshBounds() of XXXLabelEditPart
Next Topic:Diagram background, can't add elements?
Goto Forum:
  


Current Time: Fri Apr 26 13:50:14 GMT 2024

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

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

Back to the top