public class PasteTemplateAction extends SelectionAction
CopyTemplateActionAS_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 and Description |
|---|
PasteTemplateAction(IWorkbenchPart editor)
Constructor for PasteTemplateAction.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
calculateEnabled()
Calculates and returns the enabled state of this action.
|
protected Command |
createPasteCommand()
Creates and returns a command (which may be
null) to create
a new EditPart based on the template on the clipboard. |
protected java.lang.Object |
getClipboardContents()
Returns the template on the clipboard, if there is one.
|
protected CreationFactory |
getFactory(java.lang.Object template)
Returns the appropriate Factory object to be used for the specified
template.
|
protected Point |
getPasteLocation(GraphicalEditPart container) |
protected void |
init()
Initializes this action.
|
void |
run()
Executes the command returned by
createPasteCommand(). |
dispose, getSelectedObjects, getSelection, handleSelectionChanged, setSelection, setSelectionProvider, updateexecute, getCommandStack, getWorkbenchPart, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPartconvertAccelerator, 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, setToolTipTextaddPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListeneraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectpublic PasteTemplateAction(IWorkbenchPart editor)
editor - protected boolean calculateEnabled()
WorkbenchPartActioncalculateEnabled in class WorkbenchPartActiontrue if createPasteCommand() returns an
executable commandWorkbenchPartAction.calculateEnabled()protected Command createPasteCommand()
null) to create
a new EditPart based on the template on the clipboard.protected java.lang.Object getClipboardContents()
protected CreationFactory getFactory(java.lang.Object template)
null.template - the template Object; it will never be nullprotected Point getPasteLocation(GraphicalEditPart container)
container - the parent of the new part that is being pastedprotected void init()
WorkbenchPartActioninit in class WorkbenchPartActionWorkbenchPartAction.init()public void run()
createPasteCommand().Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.