Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to create a new project programatically?
How to create a new project programatically? [message #1219489] Wed, 04 December 2013 08:35 Go to next message
Epi Liptik is currently offline Epi LiptikFriend
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

Re: How to create a new project programatically? [message #1220385 is a reply to message #1219489] Wed, 11 December 2013 12:13 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

you should have a class generated that is called xxxCreationWizard in a package called xxx.part. This should give you all the source code that you need.

Ralph
Previous Topic:Connection creation throws exception
Next Topic:Drag & Drop from TreeView to GMF Editor
Goto Forum:
  


Current Time: Fri Apr 19 01:56:15 GMT 2024

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

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

Back to the top