try {
//Get the Text directory, creating if deleted
FileObject Text = project.getTextFolder(true);
//Get the DataObject that represents it
DataFolder TextDataObject =
DataFolder.findFolder(Text);
//Get its default node—we'll wrap our node around it to change the
//display name, icon, etc.
Node realTextFolderNode = TextDataObject.getNodeDelegate();
//This FilterNode will be our project node
return new TextNode(realTextFolderNode, project);
} catch (DataObjectNotFoundException donfe) {