/** * {@inheritDoc} */ @Override public int getSelectionStart() { return selection_.getStartOffset(); }
/** * {@inheritDoc} */ @Override public int getSelectionStart() { return selection_.getStartOffset(); }
/** * Returns the number of characters that the selection's anchor is offset within the anchor node. * @return the number of characters that the selection's anchor is offset within the anchor node */ public int jsxGet_anchorOffset() { return getPageSelection().getStartOffset(); }
/** * Returns the number of characters that the selection's anchor is offset within the anchor node. * @return the number of characters that the selection's anchor is offset within the anchor node */ public int jsxGet_anchorOffset() { return getPageSelection().getStartOffset(); }
/** * Returns the number of characters that the selection's anchor is offset within the anchor node. * @return the number of characters that the selection's anchor is offset within the anchor node */ public int jsxGet_anchorOffset() { return getPageSelection().getStartOffset(); }
public String toString() { return range.getStartContainer() + ":" + range.getStartOffset(); }
public String toString() { return range.getStartContainer() + ":" + range.getStartOffset(); }
public String toString() { return range.getStartContainer() + ":" + range.getStartOffset(); }
/** * Returns the start position of the selected text in the owner element. * @return the start position of the selected text in the owner element */ public int getSelectionStart() { final Range selection = getSelectionInner(); if (selection != null) { return selection.getStartOffset(); } return element_.getText().length(); }
/** * Returns the start position of the selected text in the owner element. * @return the start position of the selected text in the owner element */ public int getSelectionStart() { final Range selection = getSelectionInner(); if (selection != null) { return selection.getStartOffset(); } return element_.getText().length(); }
/** * Returns the start position of the selected text in the owner element. * @return the start position of the selected text in the owner element */ public int getSelectionStart() { final Range selection = getSelectionInner(); if (selection != null) { return selection.getStartOffset(); } return element_.getText().length(); }
/** * {@inheritDoc} */ @Override public void setSelectionEnd(int selectionEnd) { final int length = element_.getText().length(); selectionEnd = Math.min(length, Math.max(selectionEnd, 0)); selection_.setEnd(element_, selectionEnd); if (selection_.getStartOffset() > selectionEnd) { selection_.setStart(element_, selectionEnd); } } }
/** * Returns the number of characters that the selection's anchor is offset within the anchor node. * @return the number of characters that the selection's anchor is offset within the anchor node */ @JsxGetter public int getAnchorOffset() { final Range last = getLastRange(); if (last == null) { return 0; } return last.getStartOffset(); }
/** * Returns the number of characters that the selection's anchor is offset within the anchor node. * @return the number of characters that the selection's anchor is offset within the anchor node */ @JsxGetter public int getAnchorOffset() { final Range last = getLastRange(); if (last == null) { return 0; } return last.getStartOffset(); }
/** * {@inheritDoc} */ @Override public void setSelectionEnd(int selectionEnd) { final int length = element_.getText().length(); selectionEnd = Math.min(length, Math.max(selectionEnd, 0)); selection_.setEnd(element_, selectionEnd); if (selection_.getStartOffset() > selectionEnd) { selection_.setStart(element_, selectionEnd); } } }
/** * Returns the selected text in the owner element, or <tt>null</tt> if there is no selected text. * @return the selected text in the owner element, or <tt>null</tt> if there is no selected text */ public String getSelectedText() { final Range selection = getSelectionInner(); if (selection != null) { return element_.getText().substring(selection.getStartOffset(), selection.getEndOffset()); } return null; }
/** * Returns the selected text in the owner element, or <tt>null</tt> if there is no selected text. * @return the selected text in the owner element, or <tt>null</tt> if there is no selected text */ public String getSelectedText() { final Range selection = getSelectionInner(); if (selection != null) { return element_.getText().substring(selection.getStartOffset(), selection.getEndOffset()); } return null; }
/** * Returns the selected text in the owner element, or <tt>null</tt> if there is no selected text. * @return the selected text in the owner element, or <tt>null</tt> if there is no selected text */ public String getSelectedText() { final Range selection = getSelectionInner(); if (selection != null) { return element_.getText().substring(selection.getStartOffset(), selection.getEndOffset()); } return null; }
Range(final org.w3c.dom.ranges.Range w3cRange) { final DomNode domNodeStartContainer = (DomNode) w3cRange.getStartContainer(); startContainer_ = domNodeStartContainer.getScriptableObject(); startOffset_ = w3cRange.getStartOffset(); final DomNode domNodeEndContainer = (DomNode) w3cRange.getEndContainer(); endContainer_ = domNodeEndContainer.getScriptableObject(); endOffset_ = w3cRange.getEndOffset(); }
Range(final org.w3c.dom.ranges.Range w3cRange) { final DomNode domNodeStartContainer = (DomNode) w3cRange.getStartContainer(); startContainer_ = domNodeStartContainer.getScriptableObject(); startOffset_ = w3cRange.getStartOffset(); final DomNode domNodeEndContainer = (DomNode) w3cRange.getEndContainer(); endContainer_ = domNodeEndContainer.getScriptableObject(); endOffset_ = w3cRange.getEndOffset(); }