API for creating a simple PlugIn-Project without using the New-Wizard [message #54483] |
Tue, 19 April 2005 08:54  |
Eclipse User |
|
|
|
Originally posted by: Manuel.Moser.gmx.de
Hi,
I´ve got a problem.
A program should create one or more PlugIn-Projects underneeth.
So I want to create a PlugIn-Project without using the wizard.
The only parameters I want to set, are the project name and the
targetDirectory.
The project should only contains the src/bin folders, the plugin.xml and
the buildProperties..
If u have done this before, please let me know..
best regarts
Manuel M.
|
|
|
Re: API for creating a simple PlugIn-Project without using the New-Wizard [message #55038 is a reply to message #54483] |
Tue, 19 April 2005 17:30  |
Eclipse User |
|
|
|
Manuel Moser wrote:
> Hi,
>
> I´ve got a problem.
> A program should create one or more PlugIn-Projects underneeth.
>
> So I want to create a PlugIn-Project without using the wizard.
> The only parameters I want to set, are the project name and the
> targetDirectory.
>
> The project should only contains the src/bin folders, the plugin.xml and
> the buildProperties..
>
> If u have done this before, please let me know..
>
> best regarts
> Manuel M.
The following will create and open a project for you. Creating the
folders and files inside is left as an exercise only because this
example doesn't do that.
// open default project
String defaultProject=Messages.getString("_defaultProjectName");
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
IProject project= root.getProject(defaultProject);
if (!project.exists() )
try {
project.create(null);
} catch (CoreException e1) {
e1.printStackTrace();
}
if (!project.isOpen())
try {
project.open(null);
} catch (CoreException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}
The 'Contrbituing to Eclipse' book has a fairly complete example of
creating Java projects programatically that include the nature and
builder pieces.
-
Steve
|
|
|
Powered by
FUDForum. Page generated in 0.05536 seconds