Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Problems Setting the ProjectDescription
Problems Setting the ProjectDescription [message #248459] Wed, 02 June 2004 14:26 Go to next message
Eclipse UserFriend
Originally posted by: bodin.cs.umn.edu

Hi, I am trying to set the Description of a project but I always get the
error "Problems encountered while setting project description." The
error comes from the line:
String message = Policy.bind("resources.projectDesc");
In class Project.

Here is the code I am trying to execute.

IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = root.getProject(projectName);

IProjectDescription newDesc =
root.getWorkspace().newProjectDescription(projectName);
newDesc.setNatureIds(new String[]{"newNature"});
newDesc.setLocation(project.getDescription().getLocation());
project.setDescription(newDesc, monitor);

Does anybody know what is going wrong?

Thanks,
Derek
Re: Problems Setting the ProjectDescription [message #248556 is a reply to message #248459] Wed, 02 June 2004 17:35 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

This is what you should use for setting a description into an existing
project. Using newProjectDescription will wipe out the existing settings.

Use this instead:

IProjectDescription description = proj.getDescription();
String[] prevNatures = description.getNatureIds();
String[] newNatures = new String[prevNatures.length + 1];
System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length);
newNatures[prevNatures.length] = natureId;
description.setNatureIds(newNatures);
proj.setDescription(description, null);

--
Thanks, Rich Kulp

Previous Topic:Default Keyring
Next Topic:Enabling PVCS Integration in 3.0M9+
Goto Forum:
  


Current Time: Tue Jun 03 06:37:06 EDT 2025

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

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

Back to the top