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
FieldsModifier and TypeFieldDescriptionprivate final org.openide.filesystems.FileChangeAdapterListener for file changes in the project directory.private final org.netbeans.api.project.ProjectThe project this children list belongs to.private final org.openide.filesystems.FileObjectThe project's root directory.Fields inherited from class org.openide.nodes.Children.Array
nodesFields inherited from class org.openide.nodes.Children
LEAF, MUTEX -
Constructor Summary
ConstructorsConstructorDescriptionAnahataFileChildren(org.netbeans.api.project.Project project) Constructs a new children manager for the Anahata folder. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected org.openide.nodes.Node[]createNodes(org.openide.filesystems.FileObject key) private voidScans the project directory for .md files and ensures anahata.md exists.protected voidMethods inherited from class org.openide.nodes.Children.Keys
add, clone, destroyNodes, refreshKey, remove, setBefore, setKeys, setKeysMethods inherited from class org.openide.nodes.Children.Array
initCollection, refreshMethods inherited from class org.openide.nodes.Children
create, createLazy, findChild, getNode, getNodeAt, getNodes, getNodes, getNodesCount, getNodesCount, isInitialized, nodes, snapshot
-
Field Details
-
project
private final org.netbeans.api.project.Project projectThe project this children list belongs to. -
projectDir
private final org.openide.filesystems.FileObject projectDirThe project's root directory. -
fileChangeListener
private final org.openide.filesystems.FileChangeAdapter fileChangeListenerListener 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:
addNotifyin classorg.openide.nodes.Children
-
removeNotify
protected void removeNotify()Detaches listeners and clears keys to prevent memory leaks when the node is no longer needed.
- Overrides:
removeNotifyin classorg.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.AnahataMdNodefilter for the masteranahata.mdfile.- Specified by:
createNodesin classorg.openide.nodes.Children.Keys<org.openide.filesystems.FileObject>
-

