Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Get Method from different Package(I want to create a new child/class not by (right mouse click -> new child))
Get Method from different Package [message #1773237] Mon, 25 September 2017 08:39 Go to next message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 47
Registered: August 2017
I have a very simple model to begin with.

I have a class "DieKlasse", that contains itself (Containment = true)
and an Attribute "YouWantNewClass".

So when I switch the attribute to true in the runtime, i want a new class to be created directly. So I dont have to right mouse click -> new child.

My Problem is, I dont know, what is necessary to do that, because createclass() is in an differant package.

I would code:

public void setYouWantNewClass(boolean newYouWantNewClass) {
boolean oldYouWantNewClass = youWantNewClass;
youWantNewClass = newYouWantNewClass;

if (youWantNewClass)

But that looks to easy... and does not work at all

Any suggestion?
  • Attachment: NewClass.png
    (Size: 10.83KB, Downloaded 85 times)
Re: Get Method from different Package [message #1774295 is a reply to message #1773237] Thu, 12 October 2017 13:55 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31780
Registered: July 2009
Senior Member
Sorry, I was missing posts because of

You really out not to do this in your generated model. You should specialize the generated item providers. So in generated item provider where the addYouWantNewClassPropertyDescriptor you could specialize that. Perhaps org.eclipse.emf.ecore.provider.EGenericTypeItemProvider.addETypeParameterPropertyDescriptor(Object) will give you an idea how to do that.

Ed Merks
Professional Support:
Previous Topic:EMF project generating RCP plugin stuff
Next Topic:Application Model Editor - Handled Menu Item Icons
Goto Forum:

Current Time: Sun Mar 07 21:52:28 GMT 2021

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

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

Back to the top