Code generation not enabled [message #1796338] |
Thu, 11 October 2018 04:08  |
Eclipse User |
|
|
|
Hi,
I cannot generate java code from UML class diagram even after installation of java code generation component .
I am having Eclipse Committers-photon on window 10 pro. I installed Papyrus Photon(4.0.0): http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/photon. I also installed java feature: http://download.eclipse.org/modeling/mdt/papyrus/components/designer/ from https://wiki.eclipse.org/Java_Code_Generation
and was also able to import profile and primitives and followed all steps on that page. But after right clicking the diagram and selecting ( designer-> generate code ) it showed that
"This operation is not enabled"
And just after doing this when i am again right clicking the diagram and searching the option ( designer-> generate code ) so it is not there in drop-down.
Also when i was adding stereotypes on class name, its property, and its operation, it was showing multiple stereotypes for each of them.
I created a UML class diagram on eclipse-luna installed on my university's pc and its code generated perfectly but when i opened that file on committers-photon on my laptop it showed window named Repair Stereotypes*. On that window it was written "For each missing profile definition, select an action to correct the problem". It showed problems in 2 resources:
- first resource was having issue with profile:
"(java) - unknown schema"
- second resource was having issue with Count:
"2 dangling stereotypes"
After applying recommended actions it showed "Problem in Repairing stereotypes". It was written that "actions could not be completed". Details were:
Definition for class '{EPackage}::JavaClass' not found
Definition for class '{EPackage}::JavaProperty' not found
Definition for class '{EPackage}::javaMethod' not found
I have attached the zip folder containing screenshots of the windows.
Any advice would be very helpful.
Thanks,
Aleena
|
|
|
Re: Code generation not enabled [message #1796530 is a reply to message #1796338] |
Mon, 15 October 2018 15:12  |
Eclipse User |
|
|
|
Hi,
the first issue (command not enabled) is caused by the lazy class loading of the Eclipse environment. The "generate code" menu entry depends on a condition defined in a Java class, but as long as the class in not loaded, the menu entry is always visible. But it might fail with the mentioned error message, if you click on it. In this concrete case, the condition is that either a package or a classifier is selected (i.e. not the diagram itself, but one of the two elements either in the diagram or model explorer).
Concerning the 2nd issue: the luna version is very old and the Java profile is quite different today. In particular, the stereotypes JavaClass, JavaProperty and JavaMethod do not exist any more (as they are not required).
|
|
|
Powered by
FUDForum. Page generated in 0.03364 seconds