com.ibm.lab.soln.resources.nature_builder
Class ActionRemoveCustomNature

java.lang.Object
  |
  +--com.ibm.lab.soln.resources.ActionResourceAction
        |
        +--com.ibm.lab.soln.resources.nature_builder.ActionRemoveCustomNature
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IObjectActionDelegate

public class ActionRemoveCustomNature
extends ActionResourceAction

The ActionRemoveCustomNature implements an action to remove the nature implemented using CustomNature directly from an existing project.

The NewProjectWizard creates a project with the CustomNature, this action removes it. If the nature was defined with a builder reference, the removal of the nature would also automatically remove the builder.

This demonstrates the API for the project and project description workspace resources and how you might implement this logic in your tool.

See Also:
IProject, IProjectDescription, ICommand

Fields inherited from class com.ibm.lab.soln.resources.ActionResourceAction
selection
 
Constructor Summary
ActionRemoveCustomNature()
          ActionRemoveCustomNature default constructor.
 
Method Summary
 void removeNatureSpec(org.eclipse.core.resources.IProject project)
          Removes a nature from the project description if it already exists.
 void run(org.eclipse.jface.action.IAction action)
          Uses saved reference to selected project to call custom logic that removes the nature from the current project.
 
Methods inherited from class com.ibm.lab.soln.resources.ActionResourceAction
resultError, resultInformation, resultQuestion, selectionChanged, setActivePart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionRemoveCustomNature

public ActionRemoveCustomNature()
ActionRemoveCustomNature default constructor.
Method Detail

removeNatureSpec

public void removeNatureSpec(org.eclipse.core.resources.IProject project)
                      throws org.eclipse.core.runtime.CoreException
Removes a nature from the project description if it already exists. Requires that the nature be the first in the list.
Parameters:
project - selected project resource is input for processing

run

public void run(org.eclipse.jface.action.IAction action)
Uses saved reference to selected project to call custom logic that removes the nature from the current project. This logic depends on the nature being positioned as the first nature in the set known to the project description.
Parameters:
action - action proxy that handles the presentation portion of the plugin action
See Also:
IActionDelegate.run(IAction)