Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## APStudio.actions
Class SampleAction

    java.lang.Object
      |
      +--APStudio.actions.SampleAction

All Implemented Interfaces:
  org.eclipse.ui.IActionDelegate, org.eclipse.ui.IWorkbenchWindowActionDelegate

public class SampleAction
extends java.lang.Object
implements org.eclipse.ui.IWorkbenchWindowActionDelegate

Our sample action implements workbench action delegate. The action proxy will be created by the workbench and shown in the UI. When the user tries to use the action, this delegate will be created and execution will be delegated to it.

See Also:
  `IWorkbenchWindowActionDelegate`

Constructor Summary
`SampleAction()` The constructor.

Method Summary
`void` | `dispose()` We can use this method to dispose of any system resources we previously allocated.
`void` | `init(org.eclipse.ui.IWorkbenchWindow window)` We will cache window object in order to be able to provide parent shell for the message dialog.
`void` | `run(org.eclipse.jface.action.IAction action)` The action has been activated.
`void` | `selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)` Selection in the workbench has been changed.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SampleAction

    public SampleAction()

  The constructor.

Method Detail

### run

    public void run(org.eclipse.jface.action.IAction action)

  The action has been activated. The argument of the method represents the 'real' action sitting in the workbench UI.

  Specified by:
    `run` in interface `org.eclipse.ui.IActionDelegate`
  See Also:
    `IActionDelegate.run(org.eclipse.jface.action.IAction)`

### selectionChanged

    public void selectionChanged(org.eclipse.jface.action.IAction action,
                                 org.eclipse.jface.viewers.ISelection selection)

  Selection in the workbench has been changed. We can change the state of the 'real' action here if we want, but this can only happen after the delegate has been created.

  Specified by:
    `selectionChanged` in interface `org.eclipse.ui.IActionDelegate`
  See Also:
    `IActionDelegate.selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)`

### dispose

    public void dispose()

  We can use this method to dispose of any system resources we previously allocated.

  Specified by:
    `dispose` in interface `org.eclipse.ui.IWorkbenchWindowActionDelegate`
  See Also:
    `IWorkbenchWindowActionDelegate.dispose()`

### init

    public void init(org.eclipse.ui.IWorkbenchWindow window)

  We will cache window object in order to be able to provide parent shell for the message dialog.

  Specified by:
    `init` in interface `org.eclipse.ui.IWorkbenchWindowActionDelegate`
  See Also:
    `IWorkbenchWindowActionDelegate.init(org.eclipse.ui.IWorkbenchWindow)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD