sk.uniba.euromath.editor.xmlEditor.actions
Class ElementManipulateAction
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
sk.uniba.euromath.editor.xmlEditor.actions.XMLAccessModifyAction
sk.uniba.euromath.editor.xmlEditor.actions.ElementManipulateAction
- All Implemented Interfaces:
- IAdaptable, Disposable, UpdateAction, IAction, IMultiViewAction
- Direct Known Subclasses:
- AddAttributeWizardAction, DecloseElementAction, EncloseElementAction, InsertElementAction, InsertElementWizardAction, InsertTextNodeAction, SelectParentAction
public abstract class ElementManipulateAction
- extends XMLAccessModifyAction
Common action for manipulating single element, which operates with one
selected element or with element set in constructor.
Field Summary |
protected boolean |
staticElement
True, if element for handling was specified in constructor. |
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 |
Method Summary |
protected boolean |
calculateEnabled()
Is enabled if and only if element is not null. |
protected void |
clear()
Clears the selection. |
Element |
getElement()
Returns element to manipulate which is element specified in constructor
or selected element. |
protected boolean |
isStaticElement()
|
protected void |
processSelection()
Processes selection, if should manipulate with element from
selection. |
protected void |
setStaticElement(boolean staticElement)
|
Methods inherited from class sk.uniba.euromath.editor.xmlEditor.actions.XMLAccessModifyAction |
getAdaptableProvider, getAdapter, getIdManager, getModifyHelper, getSelection, getSelectionProvider, getShell, getXMLAccess, handleDocumentException, handleExportException, logError, logError, refresh, setAdaptableProvider, setWorkbenchPart, setXMLAccess, 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, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.jface.action.IAction |
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText |
staticElement
protected boolean staticElement
- True, if element for handling was specified in constructor.
ElementManipulateAction
public ElementManipulateAction(IWorkbenchPart part)
- Constructor. Creates action manipulating with element from selection.
- Parameters:
part
- associated workbench part
ElementManipulateAction
public ElementManipulateAction(Element element,
IWorkbenchPart part)
- Constructor. Creates action manipulating with element element.
- Parameters:
element
- element to manipulate, must not be nullpart
- associated workbench part
calculateEnabled
protected boolean calculateEnabled()
- Is enabled if and only if element is not null.
- Overrides:
calculateEnabled
in class XMLAccessModifyAction
clear
protected void clear()
- Description copied from class:
XMLAccessModifyAction
- Clears the selection.
- Overrides:
clear
in class XMLAccessModifyAction
getElement
public Element getElement()
- Returns element to manipulate which is element specified in constructor
or selected element.
- Returns:
- element to manipulate
processSelection
protected void processSelection()
- Processes selection, if should manipulate with element from
selection. Assigns selected element(if is selected) to local variable
element. If element is static, nothing is done.
- Overrides:
processSelection
in class XMLAccessModifyAction
isStaticElement
protected boolean isStaticElement()
- Returns:
- Returns the staticElement.
setStaticElement
protected void setStaticElement(boolean staticElement)
- Parameters:
staticElement
- The static element to set.
Copyright 2003-2003-2006 null. All Rights Reserved.