Class AnahataNodeFactory.AnahataFileChildren

java.lang.Object
org.openide.nodes.Children
org.openide.nodes.Children.Array
org.openide.nodes.Children.Keys<org.openide.filesystems.FileObject>
uno.anahata.asi.nb.nodes.AnahataNodeFactory.AnahataFileChildren
All Implemented Interfaces:
Cloneable
Enclosing class:
AnahataNodeFactory

private static class AnahataNodeFactory.AnahataFileChildren extends org.openide.nodes.Children.Keys<org.openide.filesystems.FileObject>
Manages the children of the Anahata folder, specifically looking for .md files.
Author:
anahata
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.openide.nodes.Children

    org.openide.nodes.Children.Array, org.openide.nodes.Children.Keys<T>, org.openide.nodes.Children.Map<T>, org.openide.nodes.Children.SortedArray, org.openide.nodes.Children.SortedMap<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final org.openide.filesystems.FileChangeAdapter
    Listener for file changes in the project directory.
    private final org.netbeans.api.project.Project
    The project this children list belongs to.
    private final org.openide.filesystems.FileObject
    The project's root directory.

    Fields inherited from class org.openide.nodes.Children.Array

    nodes

    Fields inherited from class org.openide.nodes.Children

    LEAF, MUTEX
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnahataFileChildren(org.netbeans.api.project.Project project)
    Constructs a new children manager for the Anahata folder.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    protected org.openide.nodes.Node[]
    createNodes(org.openide.filesystems.FileObject key)
    private void
    Scans the project directory for .md files and ensures anahata.md exists.
    protected void

    Methods inherited from class org.openide.nodes.Children.Keys

    add, clone, destroyNodes, refreshKey, remove, setBefore, setKeys, setKeys

    Methods inherited from class org.openide.nodes.Children.Array

    initCollection, refresh

    Methods inherited from class org.openide.nodes.Children

    create, createLazy, findChild, getNode, getNodeAt, getNodes, getNodes, getNodesCount, getNodesCount, isInitialized, nodes, snapshot

    Methods inherited from class Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • project

      private final org.netbeans.api.project.Project project
      The project this children list belongs to.
    • projectDir

      private final org.openide.filesystems.FileObject projectDir
      The project's root directory.
    • fileChangeListener

      private final org.openide.filesystems.FileChangeAdapter fileChangeListener
      Listener for file changes in the project directory.
  • Constructor Details

    • AnahataFileChildren

      public AnahataFileChildren(org.netbeans.api.project.Project project)
      Constructs a new children manager for the Anahata folder.
      Parameters:
      project - The project to monitor.
  • Method Details

    • addNotify

      protected void addNotify()

      Attaches a file change listener to the project directory to ensure the "Anahata" folder contents stay in sync with the filesystem.

      Overrides:
      addNotify in class org.openide.nodes.Children
    • removeNotify

      protected void removeNotify()

      Detaches listeners and clears keys to prevent memory leaks when the node is no longer needed.

      Overrides:
      removeNotify in class org.openide.nodes.Children
    • refreshKeys

      private void refreshKeys()
      Scans the project directory for .md files and ensures anahata.md exists.
    • createNodes

      protected org.openide.nodes.Node[] createNodes(org.openide.filesystems.FileObject key)

      Maps files to their respective nodes, applying the AnahataNodeFactory.AnahataMdNode filter for the master anahata.md file.

      Specified by:
      createNodes in class org.openide.nodes.Children.Keys<org.openide.filesystems.FileObject>