org.eclipse.datatools.sqltools.sqlscrapbook.actions
Class OpenScrapbookAction

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.jface.action.AbstractAction
          extended by org.eclipse.jface.action.Action
              extended by org.eclipse.datatools.sqltools.sqlscrapbook.actions.OpenScrapbookAction
All Implemented Interfaces:
org.eclipse.core.commands.IHandler, org.eclipse.jface.action.IAction, org.eclipse.ui.IActionDelegate, org.eclipse.ui.IWorkbenchWindowActionDelegate

public class OpenScrapbookAction
extends org.eclipse.jface.action.Action
implements org.eclipse.core.commands.IHandler, 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

Field Summary
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
OpenScrapbookAction()
          The constructor.
 
Method Summary
 void addHandlerListener(org.eclipse.core.commands.IHandlerListener handlerListener)
           
 void dispose()
          We can use this method to dispose of any system resources we previously allocated.
 java.lang.Object execute(org.eclipse.core.commands.ExecutionEvent event)
           
 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 removeHandlerListener(org.eclipse.core.commands.IHandlerListener handlerListener)
           
 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 org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.commands.IHandler
isEnabled, isHandled
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

OpenScrapbookAction

public OpenScrapbookAction()
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.core.commands.IHandler
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)

addHandlerListener

public void addHandlerListener(org.eclipse.core.commands.IHandlerListener handlerListener)
Specified by:
addHandlerListener in interface org.eclipse.core.commands.IHandler

execute

public java.lang.Object execute(org.eclipse.core.commands.ExecutionEvent event)
                         throws org.eclipse.core.commands.ExecutionException
Specified by:
execute in interface org.eclipse.core.commands.IHandler
Throws:
org.eclipse.core.commands.ExecutionException

removeHandlerListener

public void removeHandlerListener(org.eclipse.core.commands.IHandlerListener handlerListener)
Specified by:
removeHandlerListener in interface org.eclipse.core.commands.IHandler