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

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


  @Override
  public Element createDomImpl(Renderable element) {
    // HACK(danilatos) temp workaround, see todo in SuggestionButton and Suggestion
    // regarding their dep on ContentElement
    ContentElement haxContentElement = (ContentElement) element;

    HasSuggestions suggestions = new Suggestion(haxContentElement,
        haxContentElement.getContext());
    element.setProperty(HAS_SUGGESTIONS_PROP, suggestions);

    SuggestionButton display = new SuggestionButton(haxContentElement);
    // TODO(user): Avoid using non-html tag names
    Element nodelet = Document.get().createElement(FULL_TAGNAME);
View Full Code Here


    this.replacementRangeHelper = getOrCreateRangeTracker(documentContext);
   }

  private RangeTracker getOrCreateRangeTracker(
      DocumentContext<ContentNode, ContentElement, ContentTextNode> context) {
    ContentElement docElement = context.document().getDocumentElement();
    RangeTracker ret =
        docElement.getProperty(LINK_RANGE_TRACKER_PROP);

    if (ret == null) {
      ret = new RangeTracker(context.localAnnotations(), CURRENT_LINK_DEBUG_ID);
      docElement.setProperty(LINK_RANGE_TRACKER_PROP, ret);
    }
    return ret;
  }
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

    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

    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

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.