Package org.waveprotocol.wave.client.editor.content

Examples of org.waveprotocol.wave.client.editor.content.ContentElement$Action


    for (ContentNode node = firstItem;
         node != null && node != stopAt;
         prev = node, node = view.getNextSibling(node)) {
      assert node instanceof ContentElement : "Expected node to be instance of ContentElement";
      ContentElement el = (ContentElement) node;

      int indent = Paragraph.getIndent(el);

      if (Paragraph.isHeading(el)) {
        helper.maybeCloseListItem();
View Full Code Here


    if (lineAt == null) {
      return;
    }

    while (lineAt != null) {
      ContentElement lineTag = lineAt.getLineElement();

      // apply if it's ok
      int position = mapper.getLocation(lineTag);
      if (position >= end) { // equals implies selection is before line tag, so don't apply.
        break;
View Full Code Here

  public static boolean hasListener(ContentNode node) {
    return getListener(node) != null;
  }

  private static EditModeListener getListener(ContentNode node) {
    ContentElement e = node.asElement();
    return e.asElement() != null ? e.getProperty(EDIT_MODE_LISTENER_PROP) : null;
  }
View Full Code Here

    return null;
  }

  /** {@inheritDoc} */
  public Point<ContentNode> getFirstValidSelectionPoint() {
    ContentElement root = renderedContentView.getDocumentElement();
    // Must use filtered view, because of assertion in findOrCreateValidSelectionPoint
    ContentNode first = renderedContentView.getFirstChild(root);

    // assert there's no transparent wrapper, which would render the point invalid
    // for many uses
View Full Code Here

    return stringListToJSO(getDataNames(), caja);
  }

  public String getData(String name) {
    Preconditions.checkNotNull(name, "Name of data values may not be null");
    ContentElement nameValuePair = doFindNameValuePair(name);
    if (nameValuePair == null) {
      return null;
    }
    return nameValuePair.getAttribute(HtmlTemplate.NAMEVALUEPAIR_VALUE_ATTR);
  }
View Full Code Here

  }

  public void putData(String name, String value) {
    Preconditions.checkNotNull(name, "Name of data values may not be null");
    if (value == getData(name) || (value != null && value.equals(getData(name)))) { return; }
    ContentElement nameValuePair = doFindNameValuePair(name);
    if (value == null && nameValuePair != null) {
      htmlTemplateElement.getMutableDoc().deleteNode(nameValuePair);
    } else {
      if (nameValuePair == null) {
        doAddNameValuePair(name, value);
View Full Code Here

  public JavaScriptObject getPartIdentifiersJSO() {
    return stringListToJSO(getPartIdentifiers(), caja);
  }

  public Element getPartRendering(String id) {
    ContentElement part = doFindPart(id);
    if (part == null) { return null; }
    return part.getImplNodelet();
  }
View Full Code Here

    return id;
  }

  public void removePart(String id) {
    Preconditions.checkNotNull(id, "Identifier of part rendering may not be null");
    ContentElement part = doFindPart(id);
    if (part != null) {
      htmlTemplateElement.getMutableDoc().deleteNode(part);
    }
  }
View Full Code Here

  /** Private constructor, build through the static factory instead to ensure correct product. */
  private ValidSelectionStrategy() {}

  @Override
  public Skip resolveSkip(ContentNode node, Skip[] skipLevels) {
    ContentElement elt = node.asElement();
    if (elt == null) {
      return Skip.NONE; // selection ok in text node
    }

    boolean isRendered = (skipLevels[RENDERED_INDEX] == Skip.NONE);
View Full Code Here

    if (event.isMouseEvent()) {
      // Flush because the selection location may have changed to somewhere
      // else in the same text node. We MUST handle mouse down events for
      // this.
      editorInteractor.forceFlush();
      ContentElement node = editorInteractor.findElementWrapper(event.getTarget());
      event.setCaret(new ContentPoint(node, null));
      if (node != null && event.isClickEvent()) {
        router.handleClick(node, event);
        editorInteractor.clearCaretAnnotations();
        editorInteractor.rebiasSelection(CursorDirection.NEUTRAL);
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.client.editor.content.ContentElement$Action

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.