IProjectNature.configure never called when project is created with nature [message #328950] |
Sat, 07 June 2008 16:25 |
Eclipse User |
|
|
|
Originally posted by: jbarzilai.nuparadigm.com
Hi all,
I've been playing with this for a while now and now I'm turning to the
newsgroups.
I have my own IProjectNature implementation and I'd like it to do
certain operations in the configure method. However, the configure
method isn't being called when I expect it to. When I have an already
created Project and I add the nature to it, then the configure method is
called, however if I add the nature to the ProjectDescription as part of
the creation process (for instance as part of a Project Wizard) then the
configure method is never called. See the examples below.
This bit of code fails to call configure:
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject project = workspace.getRoot().getProject(PROJECT_NAME);
IProjectDescription description =
workspace.newProjectDescription(project.getName());
description.setNatureIds(new String[] { MyProjectNature.NATURE_ID });
project.create(description, null);
project.open(null);
This bit of code correctly calls configure:
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject project = workspace.getRoot().getProject(PROJECT_NAME);
IProjectDescription description =
workspace.newProjectDescription(project.getName());
project.create(description, null);
project.open(null);
description.setNatureIds(new String[] { MyProjectNature.NATURE_ID });
project.setDescription(description, null);
Am I doing something wrong or is this correct behavior?
Thanks,
Joe
|
|
|
Powered by
FUDForum. Page generated in 0.02581 seconds