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

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


  }

  @Override
  public void showSuggestionsFor(HasSuggestions suggestable) {
    popupCloser.cancelScheduledClose();
    ContentElement element = suggestable.getSuggestionElement();
    // NOTE(user): If content is not attached, then at the moment, we don't
    // bring up any suggestions. In the future, we may decide to look for other
    // suggestions that are sufficiently near.
    if (element.isContentAttached()) {
      setCurrent(suggestables.getElement(element));
    }
  }
View Full Code Here


      // HACK(danilatos): I had to patch MenuBar to make this method public.
      // Getting more and more tempting to write own menu class...
      // Calling this makes the first item in the menu selected by default,
      // so just pressing enter will choose it.
      menu.moveSelectionDown();
      ContentElement element = suggestable.getSuggestionElement();

      popupAnchor = element.getImplNodelet();
      // If savedSelection is null, it should be the first time we are showing a popup (not moving
      // around). So, we save the selection because it becomes null later when we lose focus,
      // at least in IE.
      if (savedSelection == null) {
        savedSelection = selectionHelper.getSelectionRange();
View Full Code Here

    Element parentNodelet = filteredHtml.getParentElement(target);
    if (parentNodelet == null) {
      throw new RuntimeException(
          "Somehow we are asking for the wrapper of something not in the editor??");
    }
    ContentElement parentElement = NodeManager.getBackReference(parentNodelet);

    // Find our foothold in wrapper land
    if (nodeletBeforeTextNodes == null) {
      // reached the beginning
      wrapperBeforeTextNodes = null;
View Full Code Here

    } else {
      nodeletAfter = point.getNodeAfter().getImplNodeletRightwards();
    }

    if (nodeletAfter == null) {
      ContentElement visibleNode = renderedContentView.getVisibleNode(
          point.getContainer()).asElement();
      assert visibleNode != null;

      Element el = visibleNode.getContainerNodelet();
      return el != null ? Point.<Node>inElement(el, null) : null;
    } else {
      Node parentNode = nodeletAfter.getParentNode();
      // NOTE(danilatos): Instead, getImplNodeletRightwards(), (or the use of
      // some other utility method) should probably instead be guaranteeing nodeletAfter
View Full Code Here

  @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

    public boolean isTabTarget(ContentNode node) {
      if (node == null || node.asElement() == null) {
        return false;
      }
      ContentElement elem = node.asElement();
      String nodeTagName = elem.getTagName();
      return TAB_TARGETS.contains(nodeTagName);
    }
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

    Point<ContentNode> point = DocHelper.ensureNodeBoundary(
        DocHelper.transparentSlice(location, cxt),
        cxt.annotatableContent(), cxt.textNodeOrganiser());

    // NOTE(danilatos): Needed as a workaround to bug 2152316
    ContentElement container = point.getContainer().asElement();
    ContentNode nodeAfter = point.getNodeAfter();
    if (nodeAfter != null) {
      container = nodeAfter.getParentElement();
    }
    ////
View Full Code Here

  /**
   * Sets the caption text of this doodad.
   */
  public void setCaptionText(String text) {
    CMutableDocument doc = element.getMutableDoc();
    ContentElement caption = DocHelper.getElementWithTagName(doc, Caption.TAGNAME, element);
    if (caption != null) {
      doc.emptyElement(caption);
      doc.insertText(Point.<ContentNode> end(caption), text);
    }
  }
View Full Code Here

    /**
     * Notifies parent that this events node has changed, if parent implements
     */
    private void onContentEventsChanged(ContentElement element) {
      ContentElement parent = element.getParentElement();
      // TODO(user): Notify parent if parent cares.
    }
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.