archimate.actions
Class ArchiMateAction

java.lang.Object
  extended by org.eclipse.ui.actions.ActionDelegate
      extended by archimate.actions.ArchiMateAction
All Implemented Interfaces:
org.eclipse.ui.IActionDelegate, org.eclipse.ui.IActionDelegate2, org.eclipse.ui.IEditorActionDelegate, org.eclipse.ui.IWorkbenchWindowActionDelegate
Direct Known Subclasses:
GenerateCode, UpdateModel, ValidateCode, ValidateModel

public abstract class ArchiMateAction
extends org.eclipse.ui.actions.ActionDelegate
implements org.eclipse.ui.IWorkbenchWindowActionDelegate, org.eclipse.ui.IEditorActionDelegate

This abstract class takes care of activating the action and setting the necessary variables

Author:
Samuel Esposito

Constructor Summary
ArchiMateAction()
           
 
Method Summary
 void dispose()
          We can use this method to dispose of any system resources we previously allocated.
static org.eclipse.ui.IWorkbenchWindow getWindow()
           
 void init(org.eclipse.jface.action.IAction action)
           
 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)
           
 void selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)
          Selection in the workbench has been changed.
 void setActiveEditor(org.eclipse.jface.action.IAction action, org.eclipse.ui.IEditorPart editorPart)
          For editor actions, the framework calls this when the active editor changes, so that we can connect with it.
 void setActiveWorkbenchPart(org.eclipse.ui.IWorkbenchPart workbenchPart)
          This records the specified workbench part, and if it is an editing domain provider, its editing domain.
 
Methods inherited from class org.eclipse.ui.actions.ActionDelegate
runWithEvent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiMateAction

public ArchiMateAction()
Method Detail

getWindow

public static org.eclipse.ui.IWorkbenchWindow getWindow()

run

public void run(org.eclipse.jface.action.IAction action)
Specified by:
run in interface org.eclipse.ui.IActionDelegate
Overrides:
run in class org.eclipse.ui.actions.ActionDelegate

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
Overrides:
selectionChanged in class org.eclipse.ui.actions.ActionDelegate
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.IActionDelegate2
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchWindowActionDelegate
Overrides:
dispose in class org.eclipse.ui.actions.ActionDelegate
See Also:
IWorkbenchWindowActionDelegate.dispose()

setActiveEditor

public void setActiveEditor(org.eclipse.jface.action.IAction action,
                            org.eclipse.ui.IEditorPart editorPart)
For editor actions, the framework calls this when the active editor changes, so that we can connect with it. We call setActiveWorkbenchPart(org.eclipse.ui.IWorkbenchPart) to record it and its editing domain, if it can provide one.

Specified by:
setActiveEditor in interface org.eclipse.ui.IEditorActionDelegate

setActiveWorkbenchPart

public void setActiveWorkbenchPart(org.eclipse.ui.IWorkbenchPart workbenchPart)
This records the specified workbench part, and if it is an editing domain provider, its editing domain.

Since:
2.1.0

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)

init

public void init(org.eclipse.jface.action.IAction action)
Specified by:
init in interface org.eclipse.ui.IActionDelegate2
Overrides:
init in class org.eclipse.ui.actions.ActionDelegate