Package rocket.selection.client

Examples of rocket.selection.client.SelectionEndPoint


  public boolean isEnabled(final Element element) {
    return false == Css.USER_SELECT_DISABLED.equals(ComputedStyle.getComputedStyle( element ).getString(Css.USER_SELECT));
  }

  public SelectionEndPoint getStart(final Selection selection) {
    final SelectionEndPoint start = new SelectionEndPoint();
    start.setTextNode((Text) JavaScript.getObject(selection, Constants.ANCHOR_NODE).cast());
    start.setOffset(JavaScript.getInteger(selection, Constants.ANCHOR_OFFSET));
    return start;
  }
View Full Code Here


       selection.removeAllRanges();
       selection.addRange( range );
       }-*/;

  public SelectionEndPoint getEnd(final Selection selection) {
    final SelectionEndPoint end = new SelectionEndPoint();
    end.setTextNode((Text) JavaScript.getObject(selection, Constants.FOCUS_NODE).cast());
    end.setOffset(JavaScript.getInteger(selection, Constants.FOCUS_OFFSET));
    return end;
  }
View Full Code Here

       }-*/;

  @Override
  protected void surround0(final Selection selection, final Element element) {
    // get child index of selection start textNode from its parent.
    final SelectionEndPoint selectionStart = this.getStart(selection);
    final Text textNode = selectionStart.getTextNode();
    final Element parentOfTextNode = JavaScript.getElement(textNode, PARENT_NODE);

    int insertIndex = 0;
    if (selectionStart.getOffset() > 0) {
      insertIndex = this.getChildIndexOfTextNode(textNode) + 1;
    }

    // extract selection to become a child of element.
    this.extract0(selection, element);
View Full Code Here

TOP

Related Classes of rocket.selection.client.SelectionEndPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.