public class MatchSizeAction extends SelectionAction
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 |
---|
MatchSizeAction(IWorkbenchPart part)
Constructs a
MatchSizeAction and associates it with the
given part. |
Modifier and Type | Method and Description |
---|---|
protected boolean |
calculateEnabled()
Calculates and returns the enabled state of this action.
|
protected double |
getPreciseHeightDelta(PrecisionRectangle precisePartBounds,
PrecisionRectangle precisePrimaryBounds)
Returns the height delta between the two bounds.
|
protected double |
getPreciseWidthDelta(PrecisionRectangle precisePartBounds,
PrecisionRectangle precisePrimaryBounds)
Returns the width delta between the two bounds.
|
void |
run()
Executes this action, cycling through the selected EditParts in the
Action's viewer, and matching the size of the selected EditPart's Figures
to that of the Primary Selection's Figure.
|
dispose, getSelectedObjects, getSelection, handleSelectionChanged, setSelection, setSelectionProvider, update
execute, getCommandStack, getWorkbenchPart, init, 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 MatchSizeAction(IWorkbenchPart part)
MatchSizeAction
and associates it with the
given part.part
- The workbench part associated with this MatchSizeActionprotected boolean calculateEnabled()
WorkbenchPartAction
calculateEnabled
in class WorkbenchPartAction
true
if the action is enabledWorkbenchPartAction.calculateEnabled()
protected double getPreciseHeightDelta(PrecisionRectangle precisePartBounds, PrecisionRectangle precisePrimaryBounds)
precisePartBounds
- the precise bounds of the EditPart's Figure to be matchedprecisePrimaryBounds
- the precise bounds of the Primary Selection EditPart's Figureprotected double getPreciseWidthDelta(PrecisionRectangle precisePartBounds, PrecisionRectangle precisePrimaryBounds)
precisePartBounds
- the precise bounds of the EditPart's Figure to be matchedprecisePrimaryBounds
- the precise bounds of the Primary Selection EditPart's FigureCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.