Runtime

## org.eclipse.gmf.runtime.diagram.ui.actions
Class AddNoteAction

    java.lang.Object
      org.eclipse.core.commands.common.EventManager
          org.eclipse.jface.action.AbstractAction
              org.eclipse.jface.action.Action
                  org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler
                      org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction
                          org.eclipse.gmf.runtime.diagram.ui.actions.AttachShapeAction
                              org.eclipse.gmf.runtime.diagram.ui.actions.AddNoteAction

All Implemented Interfaces:
  Disposable, IAction, IActionWithProgress, IDisposableAction, IOperationHistoryListener, IPropertyListener, ISelectionChangedListener

public class AddNoteAction
extends AttachShapeAction

Concrete implemention of AttachShapeAction which attaches a new Notational Note to the targeted shapes.

Nested Class Summary

Nested classes inherited from class org.eclipse.gmf.runtime.common.ui.action.IActionWithProgress
`IActionWithProgress.WorkIndicatorType`

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
`AddNoteAction(IWorkbenchPage page)` Constructor

Method Summary
`protected boolean` `calculateEnabled()` Calculates the enblement state of the action
`protected void` `doRun(IProgressMonitor progressMonitor)` Performs the actual work when this action handler is run.
`void` `init()` The basic implementation sets the workbenchpart if not already set and refreshes the action if the current part is not null.

Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.actions.AttachShapeAction
`createTargetRequest, getContainer, getLocation, isSelectionListener, selectAddedObject`

Methods inherited from class org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction
`clearTargetRequest, createOperationSet, dispose, execute, filterEditPartsMatching, getCommand, getCommand, getCommandLabel, getDiagramCommandStack, getDiagramEditDomain, getDiagramEditPart, getDiagramGraphicalViewer, getDiagramWorkbenchPart, getOperationSet, getPreferencesHint, getSelectedObjects, getTargetEditParts, getTargetRequest, refresh, setTargetRequest, updateTargetRequest`

Methods inherited from class org.eclipse.gmf.runtime.common.ui.action.AbstractActionHandler

`contributedToPart, getActionManager, getLabel, getOperationHistory, getPartListener, getSelection, getStructuredSelection, getUndoContext, getWorkbenchPage, getWorkbenchPart, getWorkIndicatorType, handle, historyNotification, isDisposed, isOperationHistoryListener, isPropertyListener, isRunnable, isSetup, needsSetup, openErrorDialog, propertyChanged, run, run, runWithEvent, selectionChanged, setDisposed, setPartSelector, setSetup, setup, setWorkbenchPart`

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, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText`

Methods inherited from class org.eclipse.jface.action.AbstractAction
`addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener`

Methods inherited from class org.eclipse.core.commands.common.EventManager
`addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject`

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

Methods inherited from interface org.eclipse.jface.action.IAction

`addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText`

Constructor Detail

### AddNoteAction

    public AddNoteAction(IWorkbenchPage page)

  Constructor

Parameters:
  `page` - the active workbenchPage.

Method Detail

### init

    public void init()

  Description copied from class: `AbstractActionHandler`
  The basic implementation sets the workbenchpart if not already set and refreshes the action if the current part is not null.

  Any subclass that overrided this method should ensure that the disposed state of this action is maintained by calling `setDisposed(false)` or calling `super.init()`.

  Specified by:
    `init` in interface `IDisposableAction`
  Overrides:
    `init` in class `AbstractActionHandler`

### calculateEnabled

    protected boolean calculateEnabled()

  Description copied from class: `DiagramAction`
  Calculates the enblement state of the action

  Overrides:
    `calculateEnabled` in class `DiagramAction`
  Returns:
    `true` if action should be enabled, `false` otherwise

### doRun

    protected void doRun(IProgressMonitor progressMonitor)

  Description copied from class: `AbstractActionHandler`
  Performs the actual work when this action handler is run. Subclasses must override this method to do some work.

  Overrides:
    `doRun` in class `DiagramAction`

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.