Java Code Examples for com.intellij.ui.treeStructure.SimpleNode#NO_CHILDREN

The following examples show how to use com.intellij.ui.treeStructure.SimpleNode#NO_CHILDREN . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GraphQLSchemasRootNode.java    From js-graphql-intellij-plugin with MIT License 6 votes vote down vote up
@NotNull
@Override
public SimpleNode[] getChildren() {
    try {
        if (DumbService.getInstance(myProject).isDumb() || !configManager.isInitialized()) {
            // empty the tree view during indexing and until the config has been initialized
            return SimpleNode.NO_CHILDREN;
        }
        final List<SimpleNode> children = Lists.newArrayList();
        for (Map.Entry<VirtualFile, GraphQLConfigData> entry : configManager.getConfigurationsByPath().entrySet()) {
            children.add(new GraphQLConfigSchemaNode(myProject, this, configManager, entry.getValue(), entry.getKey()));
        }
        if (children.isEmpty()) {
            children.add(new GraphQLDefaultSchemaNode(myProject, this));
        }
        children.sort(Comparator.comparing(PresentableNodeDescriptor::getName));
        return children.toArray(SimpleNode.NO_CHILDREN);
    } catch (IndexNotReadyException e) {
        return SimpleNode.NO_CHILDREN;
    }
}
 
Example 2
Source File: GraphQLConfigSchemaNode.java    From js-graphql-intellij-plugin with MIT License 5 votes vote down vote up
@Override
public SimpleNode[] buildChildren() {
    if (parent.projectsConfigData != null) {
        try {
            return parent.projectsConfigData.values().stream().map(config -> {
                return new GraphQLConfigSchemaNode(myProject, this, parent.configManager, config, parent.configBaseDir);
            }).toArray(SimpleNode[]::new);
        } catch (IndexNotReadyException ignored) {
            // entered "dumb" mode, so just return no children as the tree view will be rebuilt as empty shortly (GraphQLSchemasRootNode)
        }
    }
    return SimpleNode.NO_CHILDREN;
}
 
Example 3
Source File: GraphQLSchemaErrorsListNode.java    From js-graphql-intellij-plugin with MIT License 5 votes vote down vote up
@Override
public SimpleNode[] buildChildren() {
    if  (!schemaWithErrors.getRegistry().isProcessedGraphQL()) {
        // no GraphQL PSI files parse yet, so no need to show the "no query defined" error for a non-existing schema
        return SimpleNode.NO_CHILDREN;
    }
    final List<SimpleNode> children = Lists.newArrayList();
    for (GraphQLError error : schemaWithErrors.getErrors()) {
        children.add(new GraphQLSchemaErrorNode(this, error));
    }
    if (children.isEmpty()) {
        SimpleNode noErrors = new SimpleNode(this) {
            @Override
            public SimpleNode[] getChildren() {
                return NO_CHILDREN;
            }

            @Override
            public String getName() {
                return "No errors found";
            }
        };
        noErrors.setIcon(AllIcons.General.InspectionsOK);
        children.add(noErrors);
    }

    return children.toArray(SimpleNode.NO_CHILDREN);
}
 
Example 4
Source File: GraphQLSchemaErrorNode.java    From js-graphql-intellij-plugin with MIT License 4 votes vote down vote up
@Override
public SimpleNode[] buildChildren() {
    return SimpleNode.NO_CHILDREN;
}
 
Example 5
Source File: GraphQLSchemaEndpointsListNode.java    From js-graphql-intellij-plugin with MIT License 4 votes vote down vote up
@Override
public SimpleNode[] getChildren() {
    return SimpleNode.NO_CHILDREN;
}
 
Example 6
Source File: GraphQLSchemaEndpointsListNode.java    From js-graphql-intellij-plugin with MIT License 4 votes vote down vote up
@Override
public SimpleNode[] getChildren() {
    return SimpleNode.NO_CHILDREN;
}
 
Example 7
Source File: GraphQLSchemaContentNode.java    From js-graphql-intellij-plugin with MIT License 4 votes vote down vote up
@Override
public SimpleNode[] buildChildren() {
    return SimpleNode.NO_CHILDREN;
}
 
Example 8
Source File: PackagingElementNode.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
protected SimpleNode[] buildChildren() {
  return SimpleNode.NO_CHILDREN;
}