| java.lang.Object org.netbeans.modules.visualweb.designer.jsf.text.DomRangeImpl
DomRangeImpl | class DomRangeImpl implements DomProvider.DomRange(Code) | | XXX Moved from designer/../Range.
Represents a range: two positions, where one position
is considered the "dot" (current location). E.g. if you
swipe select out a range, the "start" point of the selection
is the mark, and the "end" point is the mark.
Implementation notes: I first used DOM Range directly,
but that doesn't work well for example within rendered jsf
fragments, since the Range can only be attached to the Document
itself; it also had no concept of dot and mark, so I was having
to track this state separately along with the range, and there's
some cleanup logic to be done, so all this is now managed by
this class.
author: Tor Norbye |
Method Summary | |
public static DomRange | create(DomDocumentImpl domDocumentImpl, Node dotNode, int dotOffset, Node markNode, int markOffset) | public boolean | deleteRangeContents() Delete the contents of the selection. | public void | detach() | public DomPosition | getDot() Fetches the current position of the caret. | public DomPosition | getFirstPosition() Return the first endpoint of the range in the document. | public DomPosition | getLastPosition() Return the second/last endpoint of the range in the document. | public DomPosition | getMark() Fetches the current position of the caret. | public boolean | isDot(DomPosition dot) | public boolean | isEmpty() Return true iff the range is empty, e.g. | public boolean | isReadOnlyRegion() | public void | setDot(Node dotNode, int dotOffset, Bias bias) | public void | setMark(Node markNode, int markOffset, Bias bias) | public void | setRange(Node start, int startOffset, Node end, int endOffset) | public String | toString() |
deleteRangeContents | public boolean deleteRangeContents()(Code) | | Delete the contents of the selection. Beep if the range is read-only.
true iff the deletion succeeded (an empty selection can alwaysbe successfully deleted) |
detach | public void detach()(Code) | | Free up resources associated with this range
|
getDot | public DomPosition getDot()(Code) | | Fetches the current position of the caret.
the position >= 0 |
getFirstPosition | public DomPosition getFirstPosition()(Code) | | Return the first endpoint of the range in the document.
|
getLastPosition | public DomPosition getLastPosition()(Code) | | Return the second/last endpoint of the range in the document.
|
getMark | public DomPosition getMark()(Code) | | Fetches the current position of the caret.
the position >= 0 |
isDot | public boolean isDot(DomPosition dot)(Code) | | Return true iff the given position coincides with the dot position
|
isEmpty | public boolean isEmpty()(Code) | | Return true iff the range is empty, e.g. the dot and mark are the same
|
isReadOnlyRegion | public boolean isReadOnlyRegion()(Code) | | Return true iff the range is in a read-only region
|
setDot | public void setDot(Node dotNode, int dotOffset, Bias bias)(Code) | | |
setMark | public void setMark(Node markNode, int markOffset, Bias bias)(Code) | | |
setRange | public void setRange(Node start, int startOffset, Node end, int endOffset)(Code) | | |
|
|