org.eclipse.core.internal.resources
Class NatureManager

java.lang.Object
  extended by org.eclipse.core.internal.resources.NatureManager
All Implemented Interfaces:
ILifecycleListener, IManager

public class NatureManager
extends java.lang.Object
implements ILifecycleListener, IManager

Maintains collection of known nature descriptors, and implements nature-related algorithms provided by the workspace.


Method Summary
 void configureNatures(Project project, ProjectDescription oldDescription, ProjectDescription newDescription, org.eclipse.core.runtime.MultiStatus status)
          Configures the natures for the given project.
 java.lang.String findNatureForBuilder(java.lang.String builderID)
          Returns the ID of the project nature that claims ownership of the builder with the given ID.
 IProjectNatureDescriptor getNatureDescriptor(java.lang.String natureId)
           
 IProjectNatureDescriptor[] getNatureDescriptors()
           
 void handleEvent(LifecycleEvent event)
           
 boolean isNatureEnabled(Project project, java.lang.String id)
           
 void shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 java.lang.String[] sortNatureSet(java.lang.String[] natureIds)
           
 void startup(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 org.eclipse.core.runtime.IStatus validateLinkCreation(java.lang.String[] natureIds)
          Validates whether a project with the given set of natures should allow linked resources.
 org.eclipse.core.runtime.IStatus validateNatureSet(java.lang.String[] natureIds)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNatureDescriptor

public IProjectNatureDescriptor getNatureDescriptor(java.lang.String natureId)

getNatureDescriptors

public IProjectNatureDescriptor[] getNatureDescriptors()

handleEvent

public void handleEvent(LifecycleEvent event)
Specified by:
handleEvent in interface ILifecycleListener

configureNatures

public void configureNatures(Project project,
                             ProjectDescription oldDescription,
                             ProjectDescription newDescription,
                             org.eclipse.core.runtime.MultiStatus status)
Configures the natures for the given project. Natures found in the new description that weren't present in the old description are added, and natures missing from the new description are removed. Updates the old description so that it reflects the new set of the natures. Errors are added to the given multi-status.


findNatureForBuilder

public java.lang.String findNatureForBuilder(java.lang.String builderID)
Returns the ID of the project nature that claims ownership of the builder with the given ID. Returns null if no nature owns that builder.


isNatureEnabled

public boolean isNatureEnabled(Project project,
                               java.lang.String id)

shutdown

public void shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
shutdown in interface IManager

sortNatureSet

public java.lang.String[] sortNatureSet(java.lang.String[] natureIds)

startup

public void startup(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
startup in interface IManager

validateLinkCreation

public org.eclipse.core.runtime.IStatus validateLinkCreation(java.lang.String[] natureIds)
Validates whether a project with the given set of natures should allow linked resources. Returns an OK status if linking is allowed, otherwise a non-OK status indicating why linking is not allowed. Linking is allowed if there is no project nature that explicitly disallows it. No validation is done on the nature ids themselves (ids that don't have a corresponding nature definition will be ignored).


validateNatureSet

public org.eclipse.core.runtime.IStatus validateNatureSet(java.lang.String[] natureIds)