public abstract class TransformAdapter
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TransformAdapter.ConstructRegion |
static class |
TransformAdapter.LocationRegion |
static class |
TransformAdapter.Region |
| Constructor and Description |
|---|
TransformAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
addHighlight(ModelAdapter model,
java.lang.Object construct)
Adds a highlight region for a construct for this context.
|
void |
addRemovedHighlight(ModelAdapter model,
java.lang.Object construct)
Adds a highlight region for an about-to-be-removed construct in the model
for this context.
|
abstract void |
beginTransform(TransformContext context)
Begins a transform of this type.
|
void |
beginTransform(TransformContext context,
TransformSequenceContext sequenceContext)
Begins a transform of this type within a sequence of transforms of this
type.
|
void |
beginTransformSequence(TransformSequenceContext sequenceContext)
Begins a transform sequence.
|
abstract void |
cancelTransform(TransformContext context)
Cancels a transform of this type.
|
void |
cancelTransformSequence(TransformSequenceContext sequenceContext)
Cancels a transform sequence of this type.
|
protected abstract TransformContext |
createContext(TransformContext.Shape shape,
Transform transform,
Violation violation,
Location location,
java.net.URL pendingLocation,
Project pendingProject,
Workspace pendingWorkspace)
Creates a context for a transform over a violation at a location.
|
TransformContext |
createContext(Transform transform,
Violation violation,
Location location)
Deprecated.
|
abstract void |
endTransform(TransformContext context)
Ends a transform of this type.
|
void |
endTransformSequence(TransformSequenceContext sequenceContext)
Ends a transform sequence.
|
boolean |
equals(java.lang.Object object)
Gets whether this adapter is equal to an object.
|
java.util.List<Command> |
getDeferredCommands()
Gets the commands deferred by the apply method of a transform, or an empty
list if none.
|
java.util.Collection<Location> |
getHighlightRegions(TransformContext context)
Gets the highlight regions set by the apply method of a transform for its
model, or an empty list if none.
|
Location |
getSelection()
Gets the selection set by the apply method of a transform, or null
if none.
|
int |
hashCode()
Gets the hash code value for this adapter.
|
void |
invokeLater(Command command)
Invokes a command after the command currently being executed by the
Audit framework completes.
|
boolean |
isTransformable(Location location)
Gets whether a location is transformable by this transform adapter.
|
boolean |
isTransformable(ModelAdapter model)
Gets whether a model is transformable by this transform adapter.
|
java.lang.Boolean |
makeTransformable(TransformContext context)
Makes a transform location transformable if not already so.
|
protected java.lang.Boolean |
makeWritable(Node node,
Project project,
Workspace workspace) |
TransformContext |
newCreateContext(Transform transform,
Violation violation,
Location location,
java.net.URL pendingLocation)
Creates a create context for a transform over a violation at a pending
location.
|
TransformContext |
newCreateContext(Transform transform,
Violation violation,
Location location,
java.net.URL pendingLocation,
Project pendingProject,
Workspace pendingWorkspace)
Creates a create context for a transform over a violation at a pending
location.
|
TransformContext |
newDeleteContext(Transform transform,
Violation violation)
Creates a delete context for a transform over a violation.
|
TransformContext |
newDeleteContext(Transform transform,
Violation violation,
Location location)
Creates a delete context for a transform over a violation at a location.
|
TransformContext |
newMoveContext(Transform transform,
Violation violation,
Location location,
java.net.URL pendingLocation)
Creates a move context for a transform over a violation at a location.
|
TransformContext |
newMoveContext(Transform transform,
Violation violation,
Location location,
java.net.URL pendingLocation,
Project pendingProject,
Workspace pendingWorkspace)
Creates a move context for a transform over a violation at a location.
|
TransformContext |
newMoveContext(Transform transform,
Violation violation,
java.net.URL pendingLocation)
Creates a move context for a transform over a violation.
|
TransformContext |
newReadContext(Transform transform,
Violation violation)
Creates a read context for a transform over a violation.
|
TransformContext |
newReadContext(Transform transform,
Violation violation,
Location location)
Creates a read context for a transform over a violation at a location.
|
TransformContext |
newWriteContext(Transform transform,
Violation violation)
Creates a write context for a transform over a violation.
|
TransformContext |
newWriteContext(Transform transform,
Violation violation,
Location location)
Creates a write context for a transform over a violation at a location.
|
TransformContext |
newWriteContext(Transform transform,
Violation violation,
java.net.URL pendingLocation,
Project pendingProject,
Workspace pendingWorkspace)
Creates a write context for a transform over a violation at a pending
location.
|
void |
setPredecessorApplyData(TransformContext context,
java.lang.Object applyData)
Sets the predecessor apply data for a transform.
|
void |
setSelection(Location location,
int margin,
int endMargin)
Sets the selection to be set after a transform is applied.
|
void |
setSelection(ModelAdapter model,
java.lang.Object construct,
int margin,
int endMargin)
Sets the selection to be set after a transform is applied.
|
protected abstract TransformContext createContext(TransformContext.Shape shape, Transform transform, Violation violation, Location location, java.net.URL pendingLocation, Project pendingProject, Workspace pendingWorkspace)
public TransformContext createContext(Transform transform, Violation violation, Location location)
newWriteContext(Transform, Violation, Location).public TransformContext newReadContext(Transform transform, Violation violation, Location location)
public TransformContext newReadContext(Transform transform, Violation violation)
public TransformContext newWriteContext(Transform transform, Violation violation, Location location)
public TransformContext newWriteContext(Transform transform, Violation violation)
public TransformContext newWriteContext(Transform transform, Violation violation, java.net.URL pendingLocation, Project pendingProject, Workspace pendingWorkspace)
java.lang.IllegalArgumentException - if (@code pendingLocation} exists.public TransformContext newCreateContext(Transform transform, Violation violation, Location location, java.net.URL pendingLocation)
location argument are
used for the pending location.java.lang.IllegalArgumentException - if (@code pendingLocation} exists.public TransformContext newCreateContext(Transform transform, Violation violation, Location location, java.net.URL pendingLocation, Project pendingProject, Workspace pendingWorkspace)
java.lang.IllegalArgumentException - if (@code pendingLocation} exists.public TransformContext newDeleteContext(Transform transform, Violation violation, Location location)
location.getModel().getUrl(location).public TransformContext newDeleteContext(Transform transform, Violation violation)
getViolation().getLocation().getModel().getUrl(getViolation().getLocation()).public TransformContext newMoveContext(Transform transform, Violation violation, Location location, java.net.URL pendingLocation, Project pendingProject, Workspace pendingWorkspace)
location.getModel().getUrl(location).public TransformContext newMoveContext(Transform transform, Violation violation, Location location, java.net.URL pendingLocation)
location.getModel().getUrl(location).
The workspace and project of the location argument are used for the
pending location.public TransformContext newMoveContext(Transform transform, Violation violation, java.net.URL pendingLocation)
getViolation().getLocation().getModel().getUrl(getViolation().getLocation()).
The workspace and project of the violation location are used for
the pending location.java.lang.IllegalArgumentException - if (@code pendingLocation} exists.public boolean isTransformable(ModelAdapter model)
The default TransformAdapter implementation returns true if the
model is writable or is version-controlled and can be made writable.
model - The model to be be transformed.public boolean isTransformable(Location location)
isTransformable(ModelAdapter) returned true for that model.
The default TransformAdapter implementation returns true unless
the location is guarded.
location - The location to be transformed.public java.lang.Boolean makeTransformable(TransformContext context) throws java.lang.Exception
CommandProcessor.beginTrans(java.lang.String) has been
invoked to start a command processor batch operation;
The default TransformAdapter implementation uses the
VCSManager to check out the file containing the location if it is
read-only and version controlled.
context - A transform context created by this adapter.java.lang.Exceptionprotected java.lang.Boolean makeWritable(Node node, Project project, Workspace workspace) throws java.lang.Exception
java.lang.Exceptionpublic void beginTransformSequence(TransformSequenceContext sequenceContext) throws java.lang.InterruptedException, java.lang.Exception
TransformAdapter subclass and are
applied in sequence to the same model. The sequence context allows the
transform adapters to share state through the sequence, typically to allow
optimization (e.g., to coalesce multiple transactions into a single
transaction). The framework ensures the following before invoking this
method:
CommandProcessor.beginTrans(java.lang.String) has been
invoked to start a command processor batch operation;
The default TransformAdapter implementation does nothing.
sequenceContext - The sequence context for the current sequence.java.lang.InterruptedExceptionjava.lang.Exceptionpublic abstract void beginTransform(TransformContext context) throws java.lang.InterruptedException, java.lang.Exception
CommandProcessor.beginTrans(java.lang.String) has been
invoked to start a command processor batch operation;
beginTransformSequence(oracle.jdeveloper.audit.transform.TransformSequenceContext) method has been invoked;
context - A transform context created by this adapter.java.lang.InterruptedExceptionjava.lang.Exceptionpublic void beginTransform(TransformContext context, TransformSequenceContext sequenceContext) throws java.lang.InterruptedException, java.lang.Exception
CommandProcessor.beginTrans(java.lang.String) has been
invoked to start a command processor batch operation;
beginTransformSequence(oracle.jdeveloper.audit.transform.TransformSequenceContext) method has been invoked;
The default TransformAdapter) implementation delegates to beginTransform(TransformContext). Adapters that are aware of transform
sequences shoould override this method rather than that one. See beginTransformSequence(oracle.jdeveloper.audit.transform.TransformSequenceContext).
context - A transform context created by this adapter.sequenceContext - A context for a sequence of transforms created by
this adapter.java.lang.InterruptedExceptionjava.lang.Exceptionpublic abstract void endTransform(TransformContext context) throws java.lang.Exception
beginTransform(oracle.jdeveloper.audit.transform.TransformContext) has been invoked (its preconditions still
hold);
context - A transform context created by this adapter.java.lang.Exceptionpublic abstract void cancelTransform(TransformContext context) throws java.lang.Exception
beginTransform(oracle.jdeveloper.audit.transform.TransformContext) has been invoked (its preconditions still
hold);
endTransform(oracle.jdeveloper.audit.transform.TransformContext) method has thrown an
exception.
context - A transform context created by this type.java.lang.Exceptionpublic void setPredecessorApplyData(TransformContext context, java.lang.Object applyData)
context - applyData - public void endTransformSequence(TransformSequenceContext sequenceContext) throws java.lang.Exception
beginTransformSequence(oracle.jdeveloper.audit.transform.TransformSequenceContext) has been invoked and its preconditions still
hold.
The default TransformAdapter implementation does nothing.
sequenceContext - The sequence context for the current sequence.java.lang.Exceptionpublic void cancelTransformSequence(TransformSequenceContext sequenceContext) throws java.lang.Exception
beginTransformSequence(oracle.jdeveloper.audit.transform.TransformSequenceContext) has been invoked (its preconditions
still hold);
endTransformSequence(oracle.jdeveloper.audit.transform.TransformSequenceContext) method has
thrown an exception.
The default TransformAdapter implementation does nothing.
sequenceContext - The sequence context for the current sequence.java.lang.Exceptionpublic void invokeLater(Command command)
public java.util.List<Command> getDeferredCommands()
endTransform(oracle.jdeveloper.audit.transform.TransformContext) and invokes the commands returned in order.List of Commands.public void setSelection(ModelAdapter model, java.lang.Object construct, int margin, int endMargin)
TransformContext.setSelection(java.lang.Object, int, int).model - The model containing the construct to select.construct - The construct at which to place the caret.margin - Margin from start of construct to start of selection.endMargin - Margin from end of construct to end of selection.public void setSelection(Location location, int margin, int endMargin)
TransformContext.setSelection(java.lang.Object, int, int).location - The location to select.margin - Margin from start of construct to start of selection.endMargin - Margin from end of construct to end of selection.public Location getSelection()
endTransform(oracle.jdeveloper.audit.transform.TransformContext).Location of length 0.public void addHighlight(ModelAdapter model, java.lang.Object construct)
construct - The construct to highlight.public void addRemovedHighlight(ModelAdapter model, java.lang.Object construct)
construct - The construct to be removed.public java.util.Collection<Location> getHighlightRegions(TransformContext context)
endTransform(oracle.jdeveloper.audit.transform.TransformContext).context - A transform context created by this adapter.Collection of {#link Location}s.public boolean equals(java.lang.Object object)
TransformAdapter implementations will not need to override this method.
The default TransformAdapter implementation returns getClass().hashCode().equals in class java.lang.Objectpublic int hashCode()
TransformAdapter
implementations will not need to override this method.
The default TransformAdapter implementation returns getClass().hashCode().hashCode in class java.lang.Object