public class OperationProcessor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SHOW_ALL_OPERATIONS |
Constructor and Description |
---|
OperationProcessor(View view) |
Modifier and Type | Method and Description |
---|---|
boolean |
forceSimpleApply()
Applies the first supported operation to the first supported datum
at the first supported spot.
|
java.util.List |
getListOfDataAndPositions(Operation operation)
Returns the list of
DataAndPositions supported for the given
operation. |
UIPosition |
getRepresentativeOperationPosition()
Returns the position, given the current state from the last call to
#consider , that best represents where an operation would be
performed. |
java.util.Iterator |
getSupportedOperations()
Returns an iterator of the
Operation s supported at the given
state. |
boolean |
hasSupportedOperation()
Returns whether, given the current state from the last call to
#consider , we have any operations that could be invoked. |
void |
setActionMask(int actionMask)
Updates the supported action mask.
|
void |
setEditable(boolean editable)
Updates whether the target is considered editable.
|
void |
setTargetModel(CmtModel targetModel) |
void |
setTransferable(oracle.javatools.datatransfer.ExtendedTransferable transferable) |
void |
setView(View view) |
void |
update(java.util.List positions)
Updates the current state of the processor.
|
public static final int SHOW_ALL_OPERATIONS
public OperationProcessor(View view)
public void setTransferable(oracle.javatools.datatransfer.ExtendedTransferable transferable)
public void setView(View view)
public void setTargetModel(CmtModel targetModel)
public void setActionMask(int actionMask)
actionMask
- Action mask (using DnDConstants's values) to consider.
An operation is not considered if its action mask
does not overlap with this.
If this is SHOW_ALL_OPERATIONS
, then all
operations will be considered regardless of action.public void setEditable(boolean editable)
editable
- Whether the target is considered editable. If not, then
any action that mutates the model is not considered.public void update(java.util.List positions)
positions
- List of UIPosition
s to consider operating atpublic boolean hasSupportedOperation()
#consider
, we have any operations that could be invoked.public UIPosition getRepresentativeOperationPosition()
#consider
, that best represents where an operation would be
performed. Returns null if no operation is valid.public java.util.Iterator getSupportedOperations()
Operation
s supported at the given
state. This iterator runs in rank order.
Never returns null.public java.util.List getListOfDataAndPositions(Operation operation)
DataAndPositions
supported for the given
operation. Returns null if this operation is not actually supported.public boolean forceSimpleApply() throws java.io.IOException
Operation.apply(oracle.jdeveloper.cmt.CmtModel, oracle.jdeveloper.uieditor.datatransfer.UIPosition, oracle.javatools.datatransfer.TransferDataInfo)
. Note that if one returns false,
this method tries the next. Thus, a false result means they all
returned false.java.lang.IllegalStateException
- if ! hasSupportedOperation or if the model
is currently in a transactionXmlCommitException
- from Operation.apply(oracle.jdeveloper.cmt.CmtModel, oracle.jdeveloper.uieditor.datatransfer.UIPosition, oracle.javatools.datatransfer.TransferDataInfo)
java.io.IOException
- from Operation.apply(oracle.jdeveloper.cmt.CmtModel, oracle.jdeveloper.uieditor.datatransfer.UIPosition, oracle.javatools.datatransfer.TransferDataInfo)