/** * {@inheritDoc} * @see HtmlInput#reset() */ @Override public void reset() { super.reset(); setSelectionEnd(0); }
/** * Sets the value of "selectionEnd" attribute. * @param end selection end */ public void jsxSet_selectionEnd(final int end) { ((HtmlTextInput) getDomNodeOrDie()).setSelectionEnd(end); }
/** * Sets the value of "selectionEnd" attribute. * @param end selection end */ public void jsxSet_selectionEnd(final int end) { ((HtmlTextInput) getDomNodeOrDie()).setSelectionEnd(end); }
/** * Sets the value of "selectionEnd" attribute. * @param end selection end */ public void jsxSet_selectionEnd(final int end) { ((HtmlTextInput) getDomNodeOrDie()).setSelectionEnd(end); }
/** * {@inheritDoc} * @see HtmlInput#reset() */ @Override public void reset() { super.reset(); setSelectionEnd(0); }
@Override void typeDone(final String newValue, final int newCursorPosition) { setAttribute("value", newValue); setSelectionStart(newCursorPosition); setSelectionEnd(newCursorPosition); } };
@Override void typeDone(final String newValue, final int newCursorPosition) { setAttribute("value", newValue); setSelectionStart(newCursorPosition); setSelectionEnd(newCursorPosition); } };
@Override void typeDone(final String newValue, final int newCursorPosition) { setAttribute("value", newValue); setSelectionStart(newCursorPosition); setSelectionEnd(newCursorPosition); } };
/** * {@inheritDoc} */ @Override public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue); // if value is changed and this element has the focus, then select the new value final Page page = getPage(); if (qualifiedName.equals("value") && page instanceof HtmlPage && ((HtmlPage) page).getFocusedElement() == this) { setSelectionStart(attributeValue.length()); setSelectionEnd(attributeValue.length()); } }
/** * {@inheritDoc} */ @Override public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue); // if value is changed and this element has the focus, then select the new value final Page page = getPage(); if (qualifiedName.equals("value") && page instanceof HtmlPage && ((HtmlPage) page).getFocusedElement() == this) { setSelectionStart(attributeValue.length()); setSelectionEnd(attributeValue.length()); } }
/** * {@inheritDoc} */ @Override public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue); // if value is changed and this element has the focus, then select the new value final Page page = getPage(); if (qualifiedName.equals("value") && page instanceof HtmlPage && ((HtmlPage) page).getFocusedElement() == this) { setSelectionStart(attributeValue.length()); setSelectionEnd(attributeValue.length()); } }
/** * {@inheritDoc} */ @Override protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, notifyMutationObservers); if ("value".equals(qualifiedName)) { final SgmlPage page = getPage(); if (page != null && page.isHtmlPage()) { int pos = 0; if (!hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START)) { pos = attributeValue.length(); } setSelectionStart(pos); setSelectionEnd(pos); } } }
/** * {@inheritDoc} */ @Override protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { super.setAttributeNS(namespaceURI, qualifiedName, attributeValue, notifyAttributeChangeListeners, notifyMutationObservers); if ("value".equals(qualifiedName)) { final SgmlPage page = getPage(); if (page != null && page.isHtmlPage()) { int pos = 0; if (!hasFeature(JS_INPUT_SET_VALUE_MOVE_SELECTION_TO_START)) { pos = attributeValue.length(); } setSelectionStart(pos); setSelectionEnd(pos); } } }
String text = input.getText(); input.setSelectionStart(text.length()); input.setSelectionEnd(text.length());