Examples of GroupNode


Examples of com.astamuse.asta4d.extnode.GroupNode

    protected Element transform(Element elem, Renderer content) {
        Element result = ElementUtil.safeClone(elem);

        // add a dummy parent so that the result element can be replaced by the
        // sub renderer.
        GroupNode wrapper = new GroupNode();
        wrapper.appendChild(result);
        RenderUtil.apply(result, content);

        return wrapper;
    }
View Full Code Here

Examples of com.astamuse.asta4d.extnode.GroupNode

            Object result = future.get();
            Transformer<?> transformer = TransformerFactory.generateTransformer(result);
            return transformer.invoke(elem);
        } catch (InterruptedException | ExecutionException e) {
            logger.error("Failed retrieve result from future:" + e.getMessage(), e);
            return new GroupNode();
        }
    }
View Full Code Here

Examples of com.astamuse.asta4d.extnode.GroupNode

            }
        }

        RenderUtil.applySnippets(doc);

        Element grp = new GroupNode();
        List<Node> children = new ArrayList<>(doc.body().childNodes());
        for (Node node : children) {
            node.remove();
            grp.appendChild(node);
        }

        return grp;
    }
View Full Code Here

Examples of com.astamuse.asta4d.extnode.GroupNode

        Document embedDoc = embedTarget.getDocumentClone();
        /*
                Elements children = embedDoc.body().children();
                Element wrappingNode = ElementUtil.wrapElementsToSingleNode(children);
        */
        Element wrappingNode = new GroupNode(ExtNodeConstants.GROUP_NODE_ATTR_TYPE_EMBED_WRAPPER);
        // retrieve all the blocks that misincluded into head
        Element head = embedDoc.head();
        Elements headChildren = head.children();
        List<Node> tempList = new ArrayList<>();
        String tagName;
        for (Element child : headChildren) {
            if (StringUtil.in(child.tagName(), "script", "link", ExtNodeConstants.BLOCK_NODE_TAG)) {
                child.remove();
                wrappingNode.appendChild(child);
            }
        }

        Element body = embedDoc.body();
        Elements bodyChildren = body.children();
        ElementUtil.appendNodes(wrappingNode, new ArrayList<Node>(bodyChildren));

        // copy all the attrs to the wrapping group node
        Iterator<Attribute> attrs = elem.attributes().iterator();
        Attribute attr;
        while (attrs.hasNext()) {
            attr = attrs.next();
            wrappingNode.attr(attr.getKey(), attr.getValue());
        }

        // a embed template file may by included many times in same parent
        // template, so we have to avoid duplicated snippet refs
        resetSnippetRefs(wrappingNode);
View Full Code Here

Examples of com.astamuse.asta4d.extnode.GroupNode

    public ElementUtil() {
    }

    public final static Element text(String text) {
        TextNode node = new TextNode(text, "");
        Element wrap = new GroupNode();
        wrap.appendChild(node);
        return wrap;
    }
View Full Code Here

Examples of com.astamuse.asta4d.extnode.GroupNode

        List<Node> children = body.childNodes();
        return wrapElementsToSingleNode(children);
    }

    public final static Element wrapElementsToSingleNode(List<Node> elements) {
        Element groupNode = new GroupNode();
        List<Node> list = new ArrayList<Node>(elements);
        for (Node node : list) {
            node.remove();
            groupNode.appendChild(node);
        }
        return groupNode;
    }
View Full Code Here

Examples of com.intellij.usages.impl.GroupNode

    SimpleColoredComponent textChunks = new SimpleColoredComponent();
    textChunks.setIpad(new Insets(0, 0, 0, 0));
    textChunks.setBorder(null);

    if (column == 0) {
      GroupNode parent = (GroupNode) usageNode.getParent();
      appendGroupText(parent, panel, fileBgColor);
      if (usage == ShowUsagesAction.MORE_USAGES_SEPARATOR) {
        textChunks.append("...<");
        textChunks.append("more usages", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
        textChunks.append(">...");
View Full Code Here

Examples of com.intellij.usages.impl.GroupNode

  }

  private void appendGroupText(final GroupNode node, JPanel panel, Color fileBgColor) {
    UsageGroup group = node == null ? null : node.getGroup();
    if (group == null) return;
    GroupNode parentGroup = (GroupNode) node.getParent();
    appendGroupText(parentGroup, panel, fileBgColor);
    if (node.canNavigateToSource()) {
      SimpleColoredComponent renderer = new SimpleColoredComponent();

      renderer.setIcon(group.getIcon(false));
View Full Code Here

Examples of com.intellij.usages.impl.GroupNode

      if (!(element instanceof UsageNode)) return element.toString();
      UsageNode node = (UsageNode) element;
      if (node instanceof StringNode) return "";
      Usage usage = node.getUsage();
      if (usage == MORE_USAGES_SEPARATOR) return "";
      GroupNode group = (GroupNode) node.getParent();
      return usage.getPresentation().getPlainText() + group;
    }
View Full Code Here

Examples of com.intellij.usages.impl.GroupNode

    SimpleColoredComponent textChunks = new SimpleColoredComponent();
    textChunks.setIpad(new Insets(0,0,0,0));
    textChunks.setBorder(null);

    if (column == 0) {
      GroupNode parent = (GroupNode)usageNode.getParent();
      appendGroupText(parent, panel, fileBgColor);
      if (usage == ShowUsagesAction.MORE_USAGES_SEPARATOR) {
        textChunks.append("...<");
        textChunks.append("more usages", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
        textChunks.append(">...");
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.