org.eclipse.xtext.builder.nature
Class ToggleXtextNatureAction

java.lang.Object
  extended by org.eclipse.xtext.builder.nature.ToggleXtextNatureAction
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IObjectActionDelegate

public class ToggleXtextNatureAction
extends java.lang.Object
implements org.eclipse.ui.IObjectActionDelegate

Author:
Sven Efftinge - Initial contribution and API

Constructor Summary
ToggleXtextNatureAction()
           
 
Method Summary
 boolean hasNature(org.eclipse.core.resources.IProject project)
           
 void run(org.eclipse.jface.action.IAction action)
          Performs this action.
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
          Notifies this action delegate that the selection in the workbench has changed.
 void setActivePart(org.eclipse.jface.action.IAction action, org.eclipse.ui.IWorkbenchPart targetPart)
          Sets the active part for the delegate.
 void toggleNature(org.eclipse.core.resources.IProject project)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToggleXtextNatureAction

public ToggleXtextNatureAction()
Method Detail

run

public void run(org.eclipse.jface.action.IAction action)
Description copied from interface: org.eclipse.ui.IActionDelegate
Performs this action.

This method is called by the proxy action when the action has been triggered. Implement this method to do the actual work.

Note: If the action delegate also implements IActionDelegate2, then this method is not invoked but instead the runWithEvent(IAction, Event) method is called.

Specified by:
run in interface org.eclipse.ui.IActionDelegate
Parameters:
action - the action proxy that handles the presentation portion of the action

selectionChanged

public void selectionChanged(org.eclipse.jface.action.IAction action,
                             org.eclipse.jface.viewers.ISelection selection)
Description copied from interface: org.eclipse.ui.IActionDelegate
Notifies this action delegate that the selection in the workbench has changed.

Implementers can use this opportunity to change the availability of the action or to modify other presentation properties.

When the selection changes, the action enablement state is updated based on the criteria specified in the plugin.xml file. Then the delegate is notified of the selection change regardless of whether the enablement criteria in the plugin.xml file is met.

Specified by:
selectionChanged in interface org.eclipse.ui.IActionDelegate
Parameters:
action - the action proxy that handles presentation portion of the action
selection - the current selection, or null if there is no selection.

setActivePart

public void setActivePart(org.eclipse.jface.action.IAction action,
                          org.eclipse.ui.IWorkbenchPart targetPart)
Description copied from interface: org.eclipse.ui.IObjectActionDelegate
Sets the active part for the delegate. The active part is commonly used to get a working context for the action, such as the shell for any dialog which is needed.

This method will be called every time the action appears in a popup menu. The targetPart may change with each invocation.

Specified by:
setActivePart in interface org.eclipse.ui.IObjectActionDelegate
Parameters:
action - the action proxy that handles presentation portion of the action; must not be null.
targetPart - the new part target; must not be null.

toggleNature

public void toggleNature(org.eclipse.core.resources.IProject project)

hasNature

public boolean hasNature(org.eclipse.core.resources.IProject project)