I'd recommend to register a few node factory.

Something like:

@NodeFactory.Registration(projectType = NbGradleProject.GRADLE_PROJECT_TYPE, position = 190)
public class ConfigurationsNodeFactory implements NodeFactory {
}

https://github.com/apache/netbeans/blob/master/extide/gradle/src/org/netbeans/modules/gradle/nodes/ConfigurationsNodeFactory.java

On 12/29/20 1:57 PM, Orlyanskiy Vladimir wrote:

Hello.

I try to create NetBeans module for start Groovy scripts as external processes.

I have problem with adding and removing nodes in first level of project in Projects tab. Look to attached picture. If I will add new nodes to first level they will be shown only after restart NetBeans. But if will add nodes to SecondLevel, new nodes will be shown right now.

For second level I can add and remove Nodes in my class that extends Children.SortedArray GroovyProject/GroovyChildren.java at master · Enroi/GroovyProject (github.com) <https://github.com/Enroi/GroovyProject/blob/master/src/org/vorlyanskiy/netbeans/groovy/nodes/GroovyChildren.java>

But nodes for first level are created in class that extends NodeList<FileObject> GroovyProject/ProjectNodesList.java at master · Enroi/GroovyProject (github.com) <https://github.com/Enroi/GroovyProject/blob/master/src/org/vorlyanskiy/netbeans/groovy/nodes/ProjectNodesList.java>

I do not have any Children for root project node.

If I will add File change listeners to FileObject of Project, how to refresh child nodes of project? Or how to add and remove Nodes in first level of project?

Reply via email to