public class ResizeOperation extends org.eclipse.core.commands.operations.AbstractOperation implements ITransactionalOperation
ResizeOperation
can be used to alter the size of a visual
.Constructor and Description |
---|
ResizeOperation(IResizableContentPart<? extends javafx.scene.Node> resizablePart)
Constructs a new
ResizeOperation for the manipulation of the
given Node . |
ResizeOperation(IResizableContentPart<? extends javafx.scene.Node> resizablePart,
double dw,
double dh)
Constructs a new
ResizeOperation for the manipulation of the
given Node . |
ResizeOperation(java.lang.String label,
IResizableContentPart<? extends javafx.scene.Node> resizablePart,
Dimension initialSize,
double dw,
double dh)
Constructs a new
ResizeOperation from the given values. |
Modifier and Type | Method and Description |
---|---|
org.eclipse.core.runtime.IStatus |
execute(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.IAdaptable info) |
double |
getDh()
Returns the delta height that is applied when executing this operation.
|
double |
getDw()
Returns the delta width that is applied when executing this operation.
|
Dimension |
getInitialSize()
Returns the dimensions that are applied when undoing this operation.
|
IResizableContentPart<? extends javafx.scene.Node> |
getResizablePart()
Returns the
IResizableContentPart that is resized by this
operation. |
boolean |
isContentRelevant()
Returns
true if this ITransactionalOperation is
actually changing model data (instead of only affecting the
visualization). |
boolean |
isNoOp()
Returns
true if this ITransactionalOperation has no
effect (in comparison to its initial state). |
org.eclipse.core.runtime.IStatus |
redo(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.IAdaptable info) |
void |
setDh(double dh)
Sets the delta height that will be applied when executing this operation
to the given value.
|
void |
setDw(double dw)
Sets the delta width that will be applied when executing this operation
to the given value.
|
org.eclipse.core.runtime.IStatus |
undo(org.eclipse.core.runtime.IProgressMonitor monitor,
org.eclipse.core.runtime.IAdaptable info) |
addContext, canExecute, canRedo, canUndo, dispose, getContexts, getLabel, hasContext, removeContext, setLabel, toString
public ResizeOperation(IResizableContentPart<? extends javafx.scene.Node> resizablePart)
ResizeOperation
for the manipulation of the
given Node
.resizablePart
- The Node
that is manipulated by this operation.public ResizeOperation(IResizableContentPart<? extends javafx.scene.Node> resizablePart, double dw, double dh)
ResizeOperation
for the manipulation of the
given Node
. The given delta width and height will be applied when
executing this operation.resizablePart
- The Node
that is manipulated by this operation.dw
- The delta width that is applied when executing this operation.dh
- The delta height that is applied when executing this
operation.public ResizeOperation(java.lang.String label, IResizableContentPart<? extends javafx.scene.Node> resizablePart, Dimension initialSize, double dw, double dh)
ResizeOperation
from the given values. Note that
the oldLocation does include the layout-bounds minimum.label
- Descriptive title for the operation.resizablePart
- The visual that is resized/relocated.initialSize
- The old size of the visual.dw
- The horizontal size difference.dh
- The vertical size difference.public org.eclipse.core.runtime.IStatus execute(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
execute
in interface org.eclipse.core.commands.operations.IUndoableOperation
execute
in class org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.core.commands.ExecutionException
public double getDh()
public double getDw()
public Dimension getInitialSize()
public IResizableContentPart<? extends javafx.scene.Node> getResizablePart()
IResizableContentPart
that is resized by this
operation.IResizableContentPart
that is resized by this
operation.public boolean isContentRelevant()
ITransactionalOperation
true
if this ITransactionalOperation
is
actually changing model data (instead of only affecting the
visualization). Otherwise returns false
. The content
relevance of an ITransactionalOperation
can be checked to
determine if the execution of the operation will affect the model, for
example, to set an editor's dirty flag.isContentRelevant
in interface ITransactionalOperation
true
if this ITransactionalOperation
is
actually changing model data, otherwise false
.public boolean isNoOp()
ITransactionalOperation
true
if this ITransactionalOperation
has no
effect (in comparison to its initial state). Otherwise returns
false
.isNoOp
in interface ITransactionalOperation
true
if this ITransactionalOperation
has no
effect, otherwise false
.public org.eclipse.core.runtime.IStatus redo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
redo
in interface org.eclipse.core.commands.operations.IUndoableOperation
redo
in class org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.core.commands.ExecutionException
public void setDh(double dh)
dh
- The delta height that will be applied when executing this
operation.public void setDw(double dw)
dw
- The delta width that will be applied when executing this
operation.public org.eclipse.core.runtime.IStatus undo(org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException
undo
in interface org.eclipse.core.commands.operations.IUndoableOperation
undo
in class org.eclipse.core.commands.operations.AbstractOperation
org.eclipse.core.commands.ExecutionException
Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.