Java 类com.intellij.ui.treeStructure.PatchedDefaultMutableTreeNode 实例源码

项目:idea-coremedia-plugin    文件:DoctypeTreeModel.java   
/**
 * Creates the TreeModel representing the document model structure
 *
 * @return TreeModel
 */
private TreeModel createTreeModel()
{
    final DefaultMutableTreeNode root = new PatchedDefaultMutableTreeNode("DocumentTypeModel");

    final List<Doctype> documentTypes = doctypeModel.getDoctypes();
    final List<DefaultMutableTreeNode> nodes = wrapDoctypesInTreeNodes(documentTypes);
    for (DefaultMutableTreeNode node : nodes)
    {
        Doctype doctype = (Doctype) node.getUserObject();
        if (doctype.getParent() == null)
        {
            root.add(node);
        }
        else
        {
            DefaultMutableTreeNode parent = findDoctypeTreeNodeByName(nodes, doctype.getParent().getName());
            if (parent != null)
            {
                parent.add(node);
            }
        }
    }

    return new DefaultTreeModel(root);
}
项目:idea-coremedia-plugin    文件:PropertiesTreeModel.java   
/**
 * Creates the TreeModel representing the properties of the doctype
 *
 * @return TreeModel
 */
private TreeModel createTreeModel()
{
    final DefaultMutableTreeNode root = new PatchedDefaultMutableTreeNode("Properties");

    root.add(createDoctypeWithPropertiesTreeNode(doctype));
    Doctype parent = doctype.getParent();
    while (parent != null)
    {
        root.add(createDoctypeWithPropertiesTreeNode(parent));
        parent = parent.getParent();
    }

    return new DefaultTreeModel(root);
}
项目:idea-coremedia-plugin    文件:PropertiesTreeModel.java   
/**
 * Creates the TreeNode containing the properties for the given doctype and the doctype as root node
 *
 * @param doctype Doctype
 * @return TreeNode
 */
private DefaultMutableTreeNode createDoctypeWithPropertiesTreeNode(Doctype doctype)
{
    final DefaultMutableTreeNode root = new PatchedDefaultMutableTreeNode(doctype);
    final List<DefaultMutableTreeNode> nodes = wrapDoctypesInTreeNodes(doctype.getProperties());
    for (DefaultMutableTreeNode node : nodes)
    {
        root.add(node);
    }
    return root;
}
项目:idea-coremedia-plugin    文件:PropertiesTreeModel.java   
/**
 * Creates a List with TreeNodes for each property in the given List
 *
 * @param properties List with properties
 * @return List with TreeNodes
 */
private List<DefaultMutableTreeNode> wrapDoctypesInTreeNodes(@NotNull List<Property> properties)
{
    final List<DefaultMutableTreeNode> results = new ArrayList<DefaultMutableTreeNode>(properties.size());
    for (Property property : properties)
    {
        results.add(new PatchedDefaultMutableTreeNode(property));
    }
    return results;
}
项目:idea-coremedia-plugin    文件:DoctypeTreeModel.java   
/**
 * Creates a List with TreeNodes for each document type in the given List
 *
 * @param doctypes List with doctypes
 * @return List with TreeNodes
 */
private List<DefaultMutableTreeNode> wrapDoctypesInTreeNodes(List<Doctype> doctypes)
{
    final List<DefaultMutableTreeNode> results = new ArrayList<DefaultMutableTreeNode>();
    if (doctypes != null)
    {
        for (Doctype doctype : doctypes)
        {
            results.add(new PatchedDefaultMutableTreeNode(doctype));
        }
    }
    return results;
}
项目:intellij-ce-playground    文件:FilteringTreeBuilder.java   
protected final DefaultMutableTreeNode createChildNode(final NodeDescriptor childDescr) {
  return new PatchedDefaultMutableTreeNode(childDescr);
}
项目:tools-idea    文件:FilteringTreeBuilder.java   
protected final DefaultMutableTreeNode createChildNode(final NodeDescriptor childDescr) {
  return new PatchedDefaultMutableTreeNode(childDescr);
}
项目:consulo    文件:FilteringTreeBuilder.java   
protected final DefaultMutableTreeNode createChildNode(final NodeDescriptor childDescr) {
  return new PatchedDefaultMutableTreeNode(childDescr);
}