Package org.eclipse.gef.ui.actions
Class CopyTemplateAction
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.eclipse.gef.ui.actions.CopyTemplateAction
- All Implemented Interfaces:
- Disposable,- UpdateAction,- IAction,- ISelectionChangedListener
Copies the currently selected template in the palatte to the system
 clipboard.
- 
Field SummaryFields inherited from interface org.eclipse.jface.action.IActionAS_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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanReturns whether the selected EditPart is a TemplateEditPart.voiddispose()Disposes the action when it is no longer needed.voidrun()Sets the defaultClipboard'scontents to be the currently selected template.voidSets the selected EditPart and refreshes the enabled state of this action.Methods inherited from class org.eclipse.gef.ui.actions.WorkbenchPartActionexecute, getCommandStack, getWorkbenchPart, init, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPart, updateMethods inherited from class org.eclipse.jface.action.ActionconvertAccelerator, 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, setToolTipTextMethods inherited from class org.eclipse.jface.action.AbstractActionaddPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListenerMethods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
- 
Constructor Details- 
CopyTemplateActionConstructs a new CopyTemplateAction. You must manually add this action to the palette viewer's list of selection listeners. Otherwise, this action's enabled state won't be updated properly.- Parameters:
- editor- the workbench part
- See Also:
 
 
- 
- 
Method Details- 
calculateEnabledprotected boolean calculateEnabled()Returns whether the selected EditPart is a TemplateEditPart.- Specified by:
- calculateEnabledin class- WorkbenchPartAction
- Returns:
- whether the selected EditPart is a TemplateEditPart
 
- 
disposepublic void dispose()Description copied from class:WorkbenchPartActionDisposes the action when it is no longer needed.- Specified by:
- disposein interface- Disposable
- Overrides:
- disposein class- WorkbenchPartAction
- See Also:
 
- 
runpublic void run()Sets the defaultClipboard'scontents to be the currently selected template.
- 
selectionChangedSets the selected EditPart and refreshes the enabled state of this action.- Specified by:
- selectionChangedin interface- ISelectionChangedListener
- See Also:
 
 
-