Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Create java project in code
Create java project in code [message #250078] Fri, 07 December 2007 10:04 Go to next message
Eclipse UserFriend
I'd like to be able to create a Java project in code, rather than having
my users do it. The scenario is that my application needs a java project
behind the scenes, but my users (in most cases) won't be writing Java
code. So, when they need to create a new project, I would just like to
ask them to specify the name of the project, and then handle the rest of
the settings myself.

Unfortunately, the JavaProjectWizard handles much of the creation and it
is internal. I'd really like a way to pass settings into the wizard and
run it without showing the UI. I've tried the following:

IProject project =
ResourcesPlugin.getWorkspace().getRoot().getProject("Test");
IJavaProject create = JavaCore.create(project);
BasicNewResourceWizard.selectAndReveal(project,
PlatformUI.getWorkbench().getActiveWorkbenchWindow());

But it doesn't work because the performFinish method in the
JavaProjectWizard does a whole lot more.

Any ideas? This seems like it should be pretty straightforward.
Re: Create java project in code [message #250082 is a reply to message #250078] Fri, 07 December 2007 10:15 Go to previous message
Eclipse UserFriend
Or, at the very least, when I tell the user they have to create a java
project before they can start creating files in the workspace, it would be
nice to be able to direct them to the JavaProjectWizard rather than
telling the "Hey, you have to create a Java project" and then two seconds
later asking them "Which type of project would you like to create?"
Previous Topic:Trying to compare two types for subtype compatibility
Next Topic:Programmatically importing a JAR file into an IProject
Goto Forum:
  


Current Time: Wed May 07 12:28:59 EDT 2025

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

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

Back to the top