TwoWayEdit Class
- public abstract class TwoWayEdit
extends Object
A utility class to handle the details of submitting a two-way edit request to the compiler.
While this class may be used directly, two-way edits are almost always initiated with methods
on the ISourceElement
interface,
making direct use of this class unneccesary.
-
Hierarchy
-
Object
TwoWayEdit
-
Direct Known Subclasses
-
TwoWayEdit.AddChild
, TwoWayEdit.ChangeProperty
, TwoWayEdit.RemoveChild
public static class | TwoWayEdit.AddChild
A TwoWayEdit representing the addition of a child to a source element. |
public static class | TwoWayEdit.ChangeProperty
A two-way edit representing the change of a single element property. |
public static class | TwoWayEdit.RemoveChild
A two-way edit representing the removal of a child from a source element. |
public abstract boolean |
-
doEdit (IStructureFeature feature)
- This method performs the actual two-way edit by pushing the requested change to the compiler via the
specified IStructureFeature.
|
public boolean |
-
fire ()
- Performs the two-way edit by getting a compiler lock, then requesting the edit.
|
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_data
protected Object
_data
_elemSource
protected ISourceElement
_elemSource
TwoWayEdit
protected TwoWayEdit(ISourceElement
elemSource,
Object
data)
doEdit(IStructureFeature) Method
public abstract boolean doEdit(IStructureFeature
feature)
throws InvalidElementException
This method performs the actual two-way edit by pushing the requested change to the compiler via the
specified IStructureFeature.
Parameters
-
feature
- The IStructureFeature for the document that owns the source elements to be affected by the
two-way edit.
Exceptions
-
InvalidElementException
- if any of the source elements involved in the two-way edit have since been
removed from the parse tree. Element status can be checked prior to the two-way edit by calling
ISourceElement.getStatus
.
fire() Method
public boolean fire()
throws InvalidElementException
Performs the two-way edit by getting a compiler lock, then requesting the edit.
This method assumes that the document is synchronized (no outstanding compilations).
Returns
- boolean indicating success or failure.
Exceptions
-
InvalidElementException
- if an edit is attempted on an element that is not part of a valid parse tree.