Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » New Modeling Project Creation Wizard (Need Help regarding new modeling Project Creation Wizard )
New Modeling Project Creation Wizard [message #1791361] Thu, 28 June 2018 11:51 Go to next message
AbuBakar Saadat is currently offline AbuBakar SaadatFriend
Messages: 2
Registered: June 2018
Junior Member
Hello Friends,
Hope you all will be in best health.

Actually my aim is to make a modeling project creation wizard, that only takes the name and location of the project from the user and on clicking finish, it should create a modeling project with a root object named "Model" being instantiated from another modeling project into it.
So far i am able to create a project wizard, that opens a new modeling project , but i don't know how to create the representation.aird file for this project and how to add an external model programmically into it, need guidance and right direction from you guys, here is the code for the project creation:

package customplugin.projects;
import javax.swing.text.html.Option;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import customplugin.natures.ProjectNature;
public class CustomProjectSupport {
public static IProject createProject(String projectName, URI location) {
Assert.isTrue(projectName.trim().length() > 0);

IProject project = createBaseProject(projectName, location);
try {

} catch (CoreException e) {
project = null;

return project;

* Just do the basics: create a basic project.
* @param location
* @param projectName
private static IProject createBaseProject(String projectName, URI location) {
// it is acceptable to use the ResourcesPlugin class
IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);

if (!newProject.exists()) {
URI projectLocation = location;
IProjectDescription desc = newProject.getWorkspace().newProjectDescription(newProject.getName());
if (location != null ) ;
projectLocation = null;

try {
newProject.create(desc, null);
if (!newProject.isOpen()) {;
} catch (CoreException e) {

return newProject;

private static void addNature(IProject project) throws CoreException {
if (!project.hasNature(ProjectNature.NATURE_ID)) {
IProjectDescription description = project.getDescription();
String[] prevNatures = description.getNatureIds();
String[] newNatures = new String[prevNatures.length + 1];
System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
newNatures[prevNatures.length] = ProjectNature.NATURE_ID;

IProgressMonitor monitor = null;
project.setDescription(description, monitor);


>>>>how to create the representation.aird for this project and how to add an external model with its root object into this model programmically
Re: New Modeling Project Creation Wizard [message #1791471 is a reply to message #1791361] Sat, 30 June 2018 06:25 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 32390
Registered: July 2009
Senior Member
It's probably better to ask on the Sirius forum.

I assume you've already looked at that project's getting started information:

In general it's typically useful to look at how existing code accomplishes a similar task. For this purpose, the plug-in spy is useful. I.e., Alt-Shift-F1 will show you information about the current active control in the workbench window; you can use it to find out what class implements that control so you can look at its source code. And Alt-Shift-F2 lets you determine how menu items are implemented.

Ed Merks
Professional Support:
Re: New Modeling Project Creation Wizard [message #1792025 is a reply to message #1791471] Tue, 10 July 2018 08:32 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 625
Registered: July 2009
Senior Member

The API you're looking for is probably, boolean, IProgressMonitor) to create the project, and then to manage it using its specific APIs.

As mentioned by Ed, this is a Sirius-specific subject, so if you have more questions see you in the Sirius forum at

Pierre-Charles David - Obeo

Need training or professional services for Sirius?
Re: New Modeling Project Creation Wizard [message #1797151 is a reply to message #1791361] Fri, 26 October 2018 10:56 Go to previous message
Michael  Plant is currently offline Michael PlantFriend
Messages: 1
Registered: October 2018
Junior Member
Hi, I want to know on what model or layout is Musconv
Previous Topic:RDF Turtle code generation template
Next Topic:Issues with Eclipse Modeling [Mars] - regarding marketplace and installation details
Goto Forum:

Current Time: Sun Jun 26 00:47:58 GMT 2022

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

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

Back to the top