Eclipse GEF
2.1

org.eclipse.gef.ui.actions
Class AlignmentAction

java.lang.Object
  |
  +--org.eclipse.jface.action.Action
        |
        +--org.eclipse.gef.ui.actions.WorkbenchPartAction
              |
              +--org.eclipse.gef.ui.actions.EditorPartAction
                    |
                    +--org.eclipse.gef.ui.actions.SelectionAction
                          |
                          +--org.eclipse.gef.ui.actions.AlignmentAction
All Implemented Interfaces:
Disposable, IAction, UpdateAction

public final class AlignmentAction
extends SelectionAction

An action to align the selected parts.


Field Summary
static String ID_ALIGN_BOTTOM
          Indicates that the bottom edges should be aligned.
static String ID_ALIGN_CENTER
          Indicates that the horizontal centers should be aligned.
static String ID_ALIGN_LEFT
          Indicates that the left edges should be aligned.
static String ID_ALIGN_MIDDLE
          Indicates that the vertical midpoints should be aligned.
static String ID_ALIGN_RIGHT
          Indicates that the right edges should be aligned.
static String ID_ALIGN_TOP
          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, IMAGE, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
AlignmentAction(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
protected  Rectangle calculateAlignmentRectangle(Request request)
          Returns the alignment rectangle to which all selected parts should be aligned.
protected  boolean calculateEnabled()
          Calculates and returns the enabled state of this action.
 void dispose()
          Performs and necessary cleanup.
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.EditorPartAction
getEditorPart, setEditorPart
 
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
addPropertyChangeListener, convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, firePropertyChange, firePropertyChange, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, removeAcceleratorText, removePropertyChangeListener, 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
 

Field Detail

ID_ALIGN_BOTTOM

public static final String ID_ALIGN_BOTTOM
Indicates that the bottom edges should be aligned.

See Also:
Constant Field Values

ID_ALIGN_CENTER

public static final String ID_ALIGN_CENTER
Indicates that the horizontal centers should be aligned.

See Also:
Constant Field Values

ID_ALIGN_LEFT

public static final String ID_ALIGN_LEFT
Indicates that the left edges should be aligned.

See Also:
Constant Field Values

ID_ALIGN_MIDDLE

public static final String ID_ALIGN_MIDDLE
Indicates that the vertical midpoints should be aligned.

See Also:
Constant Field Values

ID_ALIGN_RIGHT

public static final String ID_ALIGN_RIGHT
Indicates that the right edges should be aligned.

See Also:
Constant Field Values

ID_ALIGN_TOP

public static final String ID_ALIGN_TOP
Indicates that the top edges should be aligned.

See Also:
Constant Field Values
Constructor Detail

AlignmentAction

public AlignmentAction(IEditorPart editor,
                       int align)
Deprecated. use AlignmentAction(IWorkbenchPart, int align)

Parameters:
editor - the editor
align - the alignment ID

AlignmentAction

public AlignmentAction(IWorkbenchPart part,
                       int align)
Constructs an AlignmentAction with the given part and alignment ID. The alignment ID must by one of:

Parameters:
part - the workbench part used to obtain context
align - the aligment ID.
Method Detail

calculateAlignmentRectangle

protected Rectangle calculateAlignmentRectangle(Request request)
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 class WorkbenchPartAction
Returns:
true if the action is enabled
See Also:
WorkbenchPartAction.calculateEnabled()

dispose

public void dispose()
Description copied from interface: Disposable
Performs and necessary cleanup.

Specified by:
dispose in interface Disposable
Overrides:
dispose in class SelectionAction
See Also:
Disposable.dispose()

getOperationSet

protected List getOperationSet(Request request)
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()
Specified by:
run in interface IAction
Overrides:
run in class Action
See Also:
IAction.run()

Eclipse GEF
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.