How to create a new project programatically? [message #1219489] |
Wed, 04 December 2013 08:35 |
Epi Liptik Messages: 8 Registered: November 2013 |
Junior Member |
|
|
Hello,
If I start my gmf application into a new workspace I have to create a new project and a new diagram (with the associated model).
I would like to do this programatically to avoid this step, how can I do that?
I tried to create a project with something like that:
IWorkspaceRoot rootWorkspace = ResourcesPlugin.getWorkspace().getRoot();
IProject project = rootWorkspace.getProject("Project");
try {
if (project.exists()) {
if (!project.isAccessible()) {
project.open(null);
}
} else {
project.create(null);
project.open(null);
}
} catch (CoreException e) {
e.printStackTrace();
}
It seems to work but then I don't know how to create a new diagram, I tried something like the function performFinish() in the class CreationWizard but it didn't work.
[Updated on: Wed, 04 December 2013 08:36] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02609 seconds