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

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

public class ActionAddCustomNature
extends ActionResourceAction

Implements an action to add the CustomNature directly to an existing project.

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
ActionAddCustomNature()
          ActionAddBuilderToProject default constructor.
 
Method Summary
 void addCustomNature(org.eclipse.core.resources.IProject project)
          Add the nature to the project if it does not yet have the nature.
 void run(org.eclipse.jface.action.IAction action)
          Uses saved reference to selected project to call custom logic that adds the builder to 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

ActionAddCustomNature

public ActionAddCustomNature()
ActionAddBuilderToProject default constructor.
Method Detail

addCustomNature

public void addCustomNature(org.eclipse.core.resources.IProject project)
                     throws org.eclipse.core.runtime.CoreException
Add the nature to the project if it does not yet have the nature. The process requires that you get the project description, get the current nature set, and then add the new nature to the set. The first nature can control the nature image, so good form is to add a new nature to the end of the current list.

run

public void run(org.eclipse.jface.action.IAction action)
Uses saved reference to selected project to call custom logic that adds the builder to the current project.
Parameters:
action - action proxy that handles the presentation portion of the plugin action
See Also:
IActionDelegate.run(IAction)