public class PasteTemplateAction extends SelectionAction
CopyTemplateAction
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 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, update
execute, getCommandStack, getWorkbenchPart, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPart
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
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
public PasteTemplateAction(IWorkbenchPart editor)
editor
- protected boolean calculateEnabled()
WorkbenchPartAction
calculateEnabled
in class WorkbenchPartAction
true
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 null
protected Point getPasteLocation(GraphicalEditPart container)
container
- the parent of the new part that is being pastedprotected void init()
WorkbenchPartAction
init
in class WorkbenchPartAction
WorkbenchPartAction.init()
public void run()
createPasteCommand()
.Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.