public short acceptNode(Node n) { acceptRange.setStart(n, 0); if (tr.getStartContainer() == n) { return FILTER_ACCEPT; } if ((acceptRange.compareBoundaryPoints(Range.START_TO_START, tr) < 0 || acceptRange .compareBoundaryPoints(Range.END_TO_START, tr) > 0) && n != tr.getStartContainer() && n != tr.getEndContainer()) { return NodeFilter.FILTER_SKIP; } return NodeFilter.FILTER_ACCEPT; }
public short acceptNode(Node n) { acceptRange.setStart(n, 0); if (tr.getStartContainer() == n) { return FILTER_ACCEPT; } if ((acceptRange.compareBoundaryPoints(Range.START_TO_START, tr) < 0 || acceptRange .compareBoundaryPoints(Range.END_TO_START, tr) > 0) && n != tr.getStartContainer() && n != tr.getEndContainer()) { return NodeFilter.FILTER_SKIP; } return NodeFilter.FILTER_ACCEPT; }
public short acceptNode(Node n) { acceptRange.setStart(n, 0); if (tr.getStartContainer() == n) { return FILTER_ACCEPT; } if ((acceptRange.compareBoundaryPoints(Range.START_TO_START, tr) < 0 || acceptRange .compareBoundaryPoints(Range.END_TO_START, tr) > 0) && n != tr.getStartContainer() && n != tr.getEndContainer()) { return NodeFilter.FILTER_SKIP; } return NodeFilter.FILTER_ACCEPT; }
&& range.compareBoundaryPoints(Range.START_TO_START, lastSelectionRange) == 0 && range.compareBoundaryPoints(Range.END_TO_END, lastSelectionRange) == 0) { return; lastSelectionRange = range.cloneRange(); if (range.compareBoundaryPoints(Range.START_TO_END, range) == 0) { getComponent().getRootBox().clearSelection(modified); } else { boolean endBeforeStart = (this.markInfo.range.compareBoundaryPoints( Range.START_TO_START, this.dotInfo.range) >= 0);
&& range.compareBoundaryPoints(Range.START_TO_START, lastSelectionRange) == 0 && range.compareBoundaryPoints(Range.END_TO_END, lastSelectionRange) == 0) { return; lastSelectionRange = range.cloneRange(); if (range.compareBoundaryPoints(Range.START_TO_END, range) == 0) { getComponent().getRootBox().clearSelection(modified); } else { boolean endBeforeStart = (this.markInfo.range.compareBoundaryPoints( Range.START_TO_START, this.dotInfo.range) >= 0);
&& range.compareBoundaryPoints(Range.START_TO_START, lastSelectionRange) == 0 && range.compareBoundaryPoints(Range.END_TO_END, lastSelectionRange) == 0) { return; lastSelectionRange = range.cloneRange(); if (range.compareBoundaryPoints(Range.START_TO_END, range) == 0) { getComponent().getRootBox().clearSelection(modified); } else { boolean endBeforeStart = (this.markInfo.range.compareBoundaryPoints( Range.START_TO_START, this.dotInfo.range) >= 0);
public Range getSelectionRange() { if (this.dotInfo == null || this.dotInfo.range == null) { return null; } Range r = docRange.createRange(); // some xml parsers don't allow end<start in the same text node. So, // handle dot<mark here if (this.markInfo.range.compareBoundaryPoints(Range.START_TO_START, this.dotInfo.range) <= 0) { r.setStart(this.markInfo.range.getStartContainer(), this.markInfo.range .getStartOffset()); r.setEnd(this.dotInfo.range.getStartContainer(), this.dotInfo.range.getStartOffset()); } else { r.setStart(this.dotInfo.range.getStartContainer(), this.dotInfo.range.getStartOffset()); r.setEnd(this.markInfo.range.getStartContainer(), this.markInfo.range.getStartOffset()); } return r; }
public Range getSelectionRange() { if (this.dotInfo == null || this.dotInfo.range == null) { return null; } Range r = docRange.createRange(); // some xml parsers don't allow end<start in the same text node. So, // handle dot<mark here if (this.markInfo.range.compareBoundaryPoints(Range.START_TO_START, this.dotInfo.range) <= 0) { r.setStart(this.markInfo.range.getStartContainer(), this.markInfo.range .getStartOffset()); r.setEnd(this.dotInfo.range.getStartContainer(), this.dotInfo.range.getStartOffset()); } else { r.setStart(this.dotInfo.range.getStartContainer(), this.dotInfo.range.getStartOffset()); r.setEnd(this.markInfo.range.getStartContainer(), this.markInfo.range.getStartOffset()); } return r; }
public Range getSelectionRange() { if (this.dotInfo == null || this.dotInfo.range == null) { return null; } Range r = docRange.createRange(); // some xml parsers don't allow end<start in the same text node. So, // handle dot<mark here if (this.markInfo.range.compareBoundaryPoints(Range.START_TO_START, this.dotInfo.range) <= 0) { r.setStart(this.markInfo.range.getStartContainer(), this.markInfo.range .getStartOffset()); r.setEnd(this.dotInfo.range.getStartContainer(), this.dotInfo.range.getStartOffset()); } else { r.setStart(this.dotInfo.range.getStartContainer(), this.dotInfo.range.getStartOffset()); r.setEnd(this.markInfo.range.getStartContainer(), this.markInfo.range.getStartOffset()); } return r; }