Package org.eclipse.gef.ui.actions
Class AlignmentAction
- All Implemented Interfaces:
Disposable
,UpdateAction
,IAction
An action to align the selected parts.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Indicates that the bottom edges should be aligned.static final String
Indicates that the horizontal centers should be aligned.static final String
Indicates that the left edges should be aligned.static final String
Indicates that the vertical midpoints should be aligned.static final String
Indicates that the right edges should be aligned.static final String
Indicates that the top edges should be aligned.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
ConstructorsConstructorDescriptionAlignmentAction
(IEditorPart editor, int align) Deprecated.use AlignmentAction(IWorkbenchPart, int align)AlignmentAction
(IWorkbenchPart part, int align) Constructs an AlignmentAction with the given part and alignment ID. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.draw2d.geometry.Rectangle
calculateAlignmentRectangle
(Request request) Returns the alignment rectangle to which all selected parts should be aligned.protected boolean
Calculates and returns the enabled state of this action.void
dispose()
Disposes the action when it is no longer needed.protected List
getOperationSet
(Request request) Returns the list of editparts which will participate in alignment.protected void
initUI()
Initializes the actions UI presentation.void
run()
Methods inherited from class org.eclipse.gef.ui.actions.SelectionAction
getSelectedObjects, getSelection, handleSelectionChanged, setSelection, setSelectionProvider, update
Methods inherited from class org.eclipse.gef.ui.actions.WorkbenchPartAction
execute, getCommandStack, getWorkbenchPart, init, isEnabled, refresh, setLazyEnablementCalculation, setWorkbenchPart
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
-
Field Details
-
ID_ALIGN_BOTTOM
Indicates that the bottom edges should be aligned.- See Also:
-
ID_ALIGN_CENTER
Indicates that the horizontal centers should be aligned.- See Also:
-
ID_ALIGN_LEFT
Indicates that the left edges should be aligned.- See Also:
-
ID_ALIGN_MIDDLE
Indicates that the vertical midpoints should be aligned.- See Also:
-
ID_ALIGN_RIGHT
Indicates that the right edges should be aligned.- See Also:
-
ID_ALIGN_TOP
Indicates that the top edges should be aligned.- See Also:
-
-
Constructor Details
-
AlignmentAction
Deprecated.use AlignmentAction(IWorkbenchPart, int align)- Parameters:
editor
- the editoralign
- the alignment ID
-
AlignmentAction
Constructs an AlignmentAction with the given part and alignment ID. The alignment ID must by one of:- GEFActionConstants.ALIGN_LEFT
- GEFActionConstants.ALIGN_RIGHT
- GEFActionConstants.ALIGN_CENTER
- GEFActionConstants.ALIGN_TOP
- GEFActionConstants.ALIGN_BOTTOM
- GEFActionConstants.ALIGN_MIDDLE
- Parameters:
part
- the workbench part used to obtain contextalign
- the aligment ID.
-
-
Method Details
-
calculateAlignmentRectangle
Returns the alignment rectangle to which all selected parts should be aligned.- Parameters:
request
- the alignment Request- Returns:
- the alignment rectangle
-
calculateEnabled
protected boolean calculateEnabled()Description copied from class:WorkbenchPartAction
Calculates and returns the enabled state of this action.- Specified by:
calculateEnabled
in classWorkbenchPartAction
- Returns:
true
if the action is enabled- See Also:
-
dispose
public void dispose()Description copied from class:WorkbenchPartAction
Disposes the action when it is no longer needed.- Specified by:
dispose
in interfaceDisposable
- Overrides:
dispose
in classSelectionAction
- See Also:
-
getOperationSet
Returns the list of editparts which will participate in alignment.- Parameters:
request
- the alignment request- Returns:
- the list of parts which will be aligned
-
initUI
protected void initUI()Initializes the actions UI presentation. -
run
public void run()
-