Package org.csstudio.opibuilder.actions
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.
-
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
org.eclipse.gef.commands.Command
Creates the paste command.void
Determines and stores the current mouse pointer location.void
Refresh the action's enable state hence the action bars.void
run()
Performs the delete action on the selected objects.Methods inherited from class org.eclipse.gef.ui.actions.WorkbenchPartAction
dispose, execute, getCommandStack, getWorkbenchPart, init, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPart, update
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, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, 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
-
Constructor Details
-
PasteWidgetsAction
Constructor.- Parameters:
workbenchPart
- a workbench part
-
-
Method Details
-
calculateEnabled
protected boolean calculateEnabled()- Specified by:
calculateEnabled
in classorg.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. -
getTargetContainerModel
-
refreshEnable
public void refreshEnable()Refresh the action's enable state hence the action bars.
-