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

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


    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


    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

        // using the client after it shinies, and some clients using the editor might
        // have a different uncaught exception behaviour.
        EditorStaticDeps.logger.error().log("Repairing: " + e);

        // TODO(danilatos): This is a bit coarse, do more accurate/user friendly handling
        ContentElement el = Element.is(rawEvent.getEventTarget())
            ? nodeManager.findElementWrapper(Element.as(rawEvent.getEventTarget())) : null;
        if (el == null) {
          repairListener.onFullDocumentRevert(mutable());

          // Destroy all rendering
          ContentDocument savedDoc = removeContent();
          savedDoc.setShelved();

          // Re-insert document to re-render from scratch
          setContent(savedDoc);

          repairer.flashShowRepair(full().getDocumentElement());
        } else {
          repairer.revert(
              Point.inElement(el, el.getFirstChild()),
              Point.inElement(el, (ContentNode)null));
        }

        rawEvent.preventDefault();
      } finally {
View Full Code Here

  }

  private void scheduleElementForRevert(Element e) {
    // We get the back reference of the target's parent, because even if this
    // element is just inserted, the parent should have a corresponding content node.
    final ContentElement content = NodeManager.getBackReference(e);
    if (content == null) {
      return;
    }

    Iterator<ContentElement> i = toRevert.iterator();
    while (i.hasNext()) {
      ContentElement current = i.next();
      if (isAncestorOf(current, content)) {
        // Ancestor has already been scheduled for revert, we can return early.
        return;
      } else if (isAncestorOf(content, current)){
        // We no longer need to revert his node, as we will revert the ancestor
View Full Code Here

  /**
   * @return group this radio button belongs to, or null TODO(user): consider
   *         friendly error if group attribute is missing
   */
  private static ContentElement getGroup(ContentElement element) {
    ContentElement group = element.getElementByName(element.getAttribute(GROUP));
    return RadioGroup.isRadioGroup(group) ? group : null;
  }
View Full Code Here

  public void cleanup(ContentElement e, Attachment a) {
    doodads.remove(a);
  }

  private ContentElement getElement(Attachment c) {
    ContentElement e = doodads.get(c);
    if (e != null) {
      if (!e.isContentAttached()) {
        // Lazy removal. Perhaps do it from the node mutation event handler?
        doodads.remove(c);
      } else {
        return e;
      }
View Full Code Here

    return null;
  }

  @Override
  public void onContentUpdated(Attachment c) {
    ContentElement e = getElement(c);
    // TODO(nigeltao): can e ever be null?
    if (e == null) {
      return;
    }
View Full Code Here

    }
  }

  @Override
  public void onThumbnailUpdated(Attachment c) {
    ContentElement e = getElement(c);
    if (e == null) {
      return;
    }

    if (c.isMalware()) {
View Full Code Here

    }
  }

  @Override
  public void onUploadStatusUpdated(Attachment c) {
    ContentElement e = getElement(c);
    if (e == null) {
      return;
    }

    ImageThumbnailView v = renderer.getView(e);
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$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.