|Re: Create papyrus model programmatically [message #1165558 is a reply to message #1162859]
||Fri, 01 November 2013 11:19
| Kostas Triantafyllidis
Registered: November 2012
Thanks for your reply. It seems that it works fine, since that I have downloaded a fresh copy of eclipse Juno. Actually this is the first plugin that I am programming and as a result I am not familiar with the IFiles, IProjects etc and I am facing some basic problems.|
My problem is the following: I have a project into the workspace called UML_model. I want to create a papyrus model based on this model. So, I think that the appropriate class to use is the "InitModelWizard" and using init method I expect to receive the associated papyrus model. Am I right? If I am wrong please correct me.
So, the arguments that the "init" methods takes are of the types "workbench" and the "IStructuredSelection". In the place of the IStructuredSelection I would like to use a static path (workspace/UML_model/model.uml), but I do not how. The code I am using is :
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("UML_model");
IFile file = project.getFile("/model.uml");
InitModelWizard new_papy = new InitModelWizard();
IStructuredSelection kos = (IStructuredSelection) file;
I receive an exception that the casting of the IFile to the IStructuredSelection is not possible.
Do you know any way to cast a model path, file to an IStructuredSelection path?
[Updated on: Fri, 01 November 2013 12:51]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.10604 seconds