| java.lang.Object org.netbeans.modules.visualweb.designer.jsf.text.DomPositionImpl
DomPositionImpl | class DomPositionImpl implements DomPosition(Code) | | XXX Moved from designer/../Position.
Represents a location within a DOM document. The position is defined
the same as the w3c Range description of a boundary point:
http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
author: Tor Norbye |
Method Summary | |
public static short | compareBoundaryPoints(DomPosition a, DomPosition b) | public static short | compareBoundaryPoints(Node endPointA, int offsetA, Node endPointB, int offsetB) | static DomPosition | create(DomDocumentImpl domDocumentImpl, Node node, int offset, Bias bias) Create a new position at the given node and offset. | static DomPosition | createNext(DomDocumentImpl domDocumentImpl, Node node, boolean after) Create a position for the given node. | public boolean | equals(Object object) | public static DomPosition | first(DomPosition a, DomPosition b) Return the position which is earliest in the document: a or b. | public Bias | getBias() Return the bias of the position. | public Node | getNode() | public int | getOffset() | public DomPosition | getRenderedPosition() Return a position in the rendered DOM that corresponds to this position (which needs to
be a position in a source DOM). | public DomPosition | getSourcePosition() If the current position is in a rendered/DocumentFragment subtree of the
document, try to locate the equivalent position in the source document
and return that. | public Element | getTargetElement() If the position is pointing to a specific element (e.g. | public int | hashCode() | public boolean | isEarlierThan(DomPosition pos) | public boolean | isInside(Element element) Return true if this position points to some position inside the
given element. | public boolean | isLaterThan(DomPosition pos) | public boolean | isRenderedPosition() Gets whether is it rendered position. | public boolean | isSourcePosition() Gets whether it is source position. | public boolean | isStrictlyEarlierThan(DomPosition pos) Return true iff this position is earlier than (but NOT at the same position
as) the given position in the document
Parameters: pos - The position to compare to True iff this position is strictly earlier than (e.g. | public boolean | isStrictlyLaterThan(DomPosition pos) Return true iff this position is later than (but NOT at the same position
as) the given position in the document
Parameters: pos - The position to compare to True iff this position is strictly later than (e.g. | public static DomPosition | last(DomPosition a, DomPosition b) Return the position which is latest in the document: a or b. | public String | toString() |
compareBoundaryPoints | public static short compareBoundaryPoints(DomPosition a, DomPosition b)(Code) | | |
compareBoundaryPoints | public static short compareBoundaryPoints(Node endPointA, int offsetA, Node endPointB, int offsetB)(Code) | | |
create | static DomPosition create(DomDocumentImpl domDocumentImpl, Node node, int offset, Bias bias)(Code) | | Create a new position at the given node and offset. Note that the node is
the PARENT of the node you're pointing to - read the DOM traversal document
referenced at the top of this class' javadoc. Text nodes are special handled;
in this case the node points to the text node and the offset to a character
within the text node.
|
createNext | static DomPosition createNext(DomDocumentImpl domDocumentImpl, Node node, boolean after)(Code) | | Create a position for the given node. This will be the Node's PARENT
node plus its index in that parent's node list.
If after is true, the position should point to the position AFTER
this element.
|
first | public static DomPosition first(DomPosition a, DomPosition b)(Code) | | Return the position which is earliest in the document: a or b.
Parameters: a - The first position to compare Parameters: b - The second position to compare The position which is earliest in the document: a or b |
getBias | public Bias getBias()(Code) | | Return the bias of the position. Positions are always between nodes or
characters; this defines which side we have an affinity to.
|
getNode | public Node getNode()(Code) | | Fetches the element/node that contains the position
the element/node |
getOffset | public int getOffset()(Code) | | Fetches the current offset
the offset >= 0 |
getRenderedPosition | public DomPosition getRenderedPosition()(Code) | | Return a position in the rendered DOM that corresponds to this position (which needs to
be a position in a source DOM).
throws: UnsupportedOperationException - if this is Position.NONE instance |
getSourcePosition | public DomPosition getSourcePosition()(Code) | | If the current position is in a rendered/DocumentFragment subtree of the
document, try to locate the equivalent position in the source document
and return that. If it cannot find an equivalent source
position it will return Position.NONE.
|
getTargetElement | public Element getTargetElement()(Code) | | If the position is pointing to a specific element (e.g. right before or right after),
return it. Otherwise, return null.
The element pointed to by this position, or null |
hashCode | public int hashCode()(Code) | | |
isEarlierThan | public boolean isEarlierThan(DomPosition pos)(Code) | | Return true iff this position is earlier than (or at the same position
as) the given position in the document
Parameters: pos - The position to compare to True iff this position is earlier than or equal to thegiven position |
isInside | public boolean isInside(Element element)(Code) | | Return true if this position points to some position inside the
given element. Pointing to either side of the element is not considered
inside.
|
isLaterThan | public boolean isLaterThan(DomPosition pos)(Code) | | Return true iff this position is later than (or at the same position
as) the given position in the document
Parameters: pos - The position to compare to True iff this position is later than or equal to thegiven position |
isRenderedPosition | public boolean isRenderedPosition()(Code) | | Gets whether is it rendered position. Note: NONE is not considered rendered position.
XXX There should be only rendered position here (in the designer).
|
isSourcePosition | public boolean isSourcePosition()(Code) | | Gets whether it is source position. Note: NONE is not considered source position.
XXX There should be only rendered position here (in the designer).
|
isStrictlyEarlierThan | public boolean isStrictlyEarlierThan(DomPosition pos)(Code) | | Return true iff this position is earlier than (but NOT at the same position
as) the given position in the document
Parameters: pos - The position to compare to True iff this position is strictly earlier than (e.g. notequal to) the given position |
isStrictlyLaterThan | public boolean isStrictlyLaterThan(DomPosition pos)(Code) | | Return true iff this position is later than (but NOT at the same position
as) the given position in the document
Parameters: pos - The position to compare to True iff this position is strictly later than (e.g. notequal to) the given position |
last | public static DomPosition last(DomPosition a, DomPosition b)(Code) | | Return the position which is latest in the document: a or b.
Parameters: a - The first position to compare Parameters: b - The second position to compare The position which is latest in the document: a or b |
|
|