Class PasteWidgetsAction

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.gef.ui.actions.WorkbenchPartAction
org.csstudio.opibuilder.actions.PasteWidgetsAction
All Implemented Interfaces:
org.eclipse.gef.Disposable, org.eclipse.gef.ui.actions.UpdateAction, IAction

public final class PasteWidgetsAction extends org.eclipse.gef.ui.actions.WorkbenchPartAction
Action class that copies all widgets that are currently stored on the Clipboard to the current Editor's display model.
  • Constructor Details

    • PasteWidgetsAction

      public PasteWidgetsAction(OPIEditor workbenchPart)
      Constructor.
      Parameters:
      workbenchPart - a workbench part
  • Method Details

    • calculateEnabled

      protected boolean calculateEnabled()
      Specified by:
      calculateEnabled in class org.eclipse.gef.ui.actions.WorkbenchPartAction
    • createPasteCommand

      public org.eclipse.gef.commands.Command createPasteCommand()
      Creates the paste command.
      Returns:
      Command The paste command
    • fetchCurrentCursorLocation

      public void fetchCurrentCursorLocation()
      Determines and stores the current mouse pointer location. The widgets from the clipboard will be pasted at the mouse pointer location, if the mouse pointer is within the editor. If this action is added to a context menu, this method should be called when the menu displays, so that the paste location is the location at which the user opened the context menu.
    • run

      public void run()
      Performs the delete action on the selected objects.
      Specified by:
      run in interface IAction
      Overrides:
      run in class Action
    • getTargetContainerModel

      public AbstractContainerModel getTargetContainerModel()
    • refreshEnable

      public void refreshEnable()
      Refresh the action's enable state hence the action bars.