Examples of ContentNode


Examples of org.jdesktop.wonderland.modules.contentrepo.common.ContentNode

        return selected;
    }

    private void changeSelection() {
        ContentNode selected = getSelection();
       
        boolean enableDownload = false;
        boolean enableDelete = false;
        if (selected == null) {
            typeLabel.setText("");
View Full Code Here

Examples of org.jdesktop.wonderland.modules.contentrepo.common.ContentNode

        downloadButton.setEnabled(enableDownload);
        deleteButton.setEnabled(enableDelete);
    }

    private void changeDirectory() {
        ContentNode selected = getSelection();
        if (selected instanceof ContentCollection) {
            setCollection((ContentCollection) selected);
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.modules.contentrepo.common.ContentNode

            }
        }
    }//GEN-LAST:event_downloadButtonActionPerformed

    private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
        ContentNode selected = getSelection();

        try {
            directory.removeChild(selected.getName());
        } catch (ContentRepositoryException cre) {
            logger.log(Level.WARNING, "Error removing " + selected.getPath(),
                       cre);
        }

        setCollection(directory);
    }//GEN-LAST:event_deleteButtonActionPerformed
View Full Code Here

Examples of org.jdesktop.wonderland.modules.contentrepo.common.ContentNode

                  "Please contact your system administrator for assistance.");
            return;
        }

        try {
            ContentNode node = translatePath(wcr, request.getPathInfo());
            if (node == null) {
                error(request, response, "Path " + request.getPathInfo() +
                      " not found.");
                return;
            }

            String action = request.getParameter("action");
            if (action == null && ServletFileUpload.isMultipartContent(request)) {
                action = "upload";
            }
           
            if (action != null) {
                node = handleAction(request, response, node, action);
                if (node == null) {
                    // indicates that the action has handled forwarding on
                    // its own, for example to the error page
                    return;
                }
            }

            DirectoryEntry current = new DirectoryEntry(node);
            request.setAttribute("current", current);

            if (node instanceof ContentCollection) {
                handleCollection(request, response, (ContentCollection) node);
            } else if (node instanceof ContentResource) {
                handleResource(request, response, (ContentResource) node);
            } else {
                error(request, response, "Unknown node type " + node.getClass());
            }
        } catch (ContentRepositoryException cre) {
            throw new ServletException(cre);
        }
    }
View Full Code Here

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

    //Event event = Document.get().createKeyPressEvent(
    //    false, false, false, false, KeyCodes.KEY_BACKSPACE, 0).cast();

    Text input = Document.get().createTextNode("ABCDE");
    ContentNode node = new ContentTextNode(input, null);

    final Point<ContentNode> start = Point.inText(node, 1);
    final Point<ContentNode> end = Point.inText(node, 4);
    FakeEditorInteractor interactor = setupFakeEditorInteractor(
        new FocusedContentRange(start, end));
View Full Code Here

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

    // meta element, null impl nodelet
    ContentElement n1 = c.createElement("m", root, null);
    n1.setImplNodelets(null, null);

    // regular node
    ContentNode n2 = c.createElement("a", root, null);

    // basic check
    assertSame(null, m.wrapperElementPointToNodeletPoint(
        Point.<ContentNode>end(root)).getNodeAfter());

    // check left-biasing
    rootNodelet.appendChild(Document.get().createBRElement());
    assertSame(rootNodelet.getLastChild(), m.wrapperElementPointToNodeletPoint(
        Point.<ContentNode>end(root)).getNodeAfter());

    // basic check
    assertSame(n2.getImplNodelet(), m.wrapperElementPointToNodeletPoint(
        Point.inElement(root, n2)).getNodeAfter());

    // search-rightwards for next impl nodelet check (n1 has null impl nodelet)
    assertSame(n2.getImplNodelet(), m.wrapperElementPointToNodeletPoint(
        Point.<ContentNode>inElement(root, n1)).getNodeAfter());

  }
View Full Code Here

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

     * @param start
     * @param end
     * @param shiftDown
     */
    private void handleTab(Point<ContentNode> start, Point<ContentNode> end, boolean shiftDown) {
      ContentNode node = start.getContainer();
      while (node != null) {
        if (isTabTarget(node)) {
          break;
        }
        node = node.getParentElement();
      }

      // If we're not in a caption, tab = indent/outdent
      if (node == null) {
        applyParagraphIndent(start, end, shiftDown);
View Full Code Here

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

   */
  public static void renderChildren(
      ReadableDocumentView<ContentNode, ContentElement, ContentTextNode> view,
      Element parent,
      ContentNode contentParent, SelectionMatcher selectionMatcher) {
    ContentNode current = contentParent.getFirstChild();
    while (current != null) {
      ContentNode done = renderSequence(view, current, null, parent, selectionMatcher);
      current = view.getNextSibling(done);
    }
  }
View Full Code Here

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

    ContentView renderedContent = renderedView;

    assert end == null || end.getContainer() == start.getContainer() :
        "No reverting across elements";

    ContentNode before = Point.nodeBefore(renderedContent, start);
    Node nodeletBefore = before == null ? null : before.getImplNodelet();
    Element parentNodelet;
    if (nodeletBefore == null) {
      parentNodelet = renderedContent.getVisibleNode(start.getContainer()).getImplNodelet().cast();
    } else {
      parentNodelet = nodeletBefore.getParentElement();
    }

    ContentNode first = start.getNodeAfter();
    ContentNode last = end == null ? null : end.getNodeAfter();
    assert renderedContent.getVisibleNode(first) == first;
    assert renderedContent.getVisibleNode(last) == last;
    assert last == null
        || renderedContent.getParentElement(first) == renderedContent.getParentElement(last)
        : "First and last are expected to have same parent";
    {
      ContentNode node;
      for (node = first; node != last; node = renderedContent.getNextSibling(node)) {
        // If node is consistent, we assume the ones after are ok.
        if (end == null && node.isConsistent()) {
          break;
        }

        node.revertImplementation();
      }
      last = node;
    }

    // TODO(danilatos): Actually use some view that strips unknown nodes out. or do something
View Full Code Here

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

    if (cp.getContainer().isTextNode()) {
      ContentTextNode textNode = (ContentTextNode) cp.getContainer();
      return cp.getTextOffset() <= textNode.getLength();
    } else {
      ContentNode nodeAfter = cp.getNodeAfter();
      return nodeAfter == null || cp.getContainer() == nodeAfter.getParentElement();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.