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

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


  }

  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

    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

        ImageThumbnail.register(registries.getElementHandlerRegistry(), attachmentManager,
            new ThumbnailActionHandler() {
          @Override
          public boolean onClick(ImageThumbnailWrapper thumbnail) {
            ContentElement e = thumbnail.getElement();
            String newId = Window.prompt("New attachment id, or 'remove' to remove the attribute",
                e.getAttribute(ImageThumbnail.ATTACHMENT_ATTR));

            if (newId == null) {
              // They hit escape
              return true;
            }

            if ("remove".equals(newId)) {
              newId = null;
            }

            e.getMutableDoc().setElementAttribute(e, ImageThumbnail.ATTACHMENT_ATTR, newId);
            return true;
          }
        });

View Full Code Here

   */
  public static GadgetElementChild create(ContentNode node) {
    if ((node == null) || !node.isElement()) {
      return null;
    } else {
      ContentElement element = node.asElement();
      return new GadgetElementChild(element);
    }
  }
View Full Code Here

    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

TOP

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

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.