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
Member
Hi,
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)
{
createDieKlasse();
}
}

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


Any suggestion?
  • Attachment: NewClass.png
    (Size: 10.83KB, Downloaded 111 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: 33142
Registered: July 2009
Senior Member
Sorry, I was missing posts because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=525901

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: https://www.macromodeling.com/
Previous Topic:EMF project generating RCP plugin stuff
Next Topic:Application Model Editor - Handled Menu Item Icons
Goto Forum:
  


Current Time: Fri Apr 26 21:04:46 GMT 2024

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

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

Back to the top