Class | Description |
---|---|
IconComposer |
Create decorated icons for VPT nodes
|
ProjectCustomTreeModel |
A tree model for customized trees, trees that do not follow the node
hierarchy as defined by the original data.
|
ProjectTreeModel |
A tree model that defines a few methods used internally by
ProjectViewer.
|
ProjectTreePanel |
A panel that contains the several trees for showing project data.
|
VPTCellRenderer |
Used by the jTree to underline the file name when it's opened.
|
VPTCompactModel |
A tree model that compress the view by displaying packed directories.
|
VPTContextMenu |
A handler for context menu requests on the tree, providing node-sensitive
functionality.
|
VPTDirectory |
Models a directory that is part of a project.
|
VPTFile |
Models a file that is part of a project.
|
VPTFileListModel |
A tree model that represents all files in a project without any relationship
to the nodes they are a child of.
|
VPTFilterData | |
VPTFilteredModel |
A tree model that shows nodes grouped according to configurable
filters.
|
VPTGroup |
A VPTGroup is a container for groups and projects.
|
VPTNode |
Node implementation for the Virtual Project Tree.
|
VPTProject |
Models a project.
|
VPTRoot |
The root of the PV tree, representing "All Projects"
Aside from being the root of the project tree, it
provides methods for manipulating the projects and persisting data
to the disk.
|
VPTSelectionListener |
Listens to the project JTree and responds to file selections.
|
VPTWorkingFileListModel |
A tree model that shows all files currently opened in jEdit in a flat list.
|
It's possible to create new kinds of nodes to be inserted into a project. Although not tested, all the necessary functionality is available. To create a new kind of node, the following steps need to be taken:
VPTNode
.NodeHandler
to handle
loading and saving of your node type. Don't forget to register the node handler
in the start()
method of your EditPlugin implementation.Action
that provides a way to
import new nodes into a project. Optionally, you may extend
Importer
to ease the importing of new
nodes.These steps should be enough to create a new kind of node and make it be
automatically persisted by the ProjectViewer plugin with the corresponding
project. You may want to provide other actions to be executed on the given
node (by creating more Action subclasses), or implement the
open()
method of the node to specify
an action to be executed when the node receives a double click on the tree.
When implementing open()
, make sure to make the close()
,
canOpen()
and isOpened()
methods consistent with
your implementation.
Implementing new nodes should be considered highly experimental, so bear that in mind when going through this path.
To register node handlers with ProjectViewer, add an entry to your plugin's services.xml file. The service class is projectviewer.persist.NodeHandler.
Registering custom node handlers has one shortcoming: when your plugin is unloaded, the classes won't be able to be garbage collected. This happens because there's no safe way to remove the custom nodes that have been added to the project and wait for the plugin to be activated again to create a new version of that node with the new instance of the Class. So, the ProjectViewer plugin will keep a reference to the custom node's class and to the node handler's class so that it is possible to persist that node when the project is saved.
If you develop custom nodes, you should keep this in mind to make sure that this does not affect the newly loaded instance of your plugin. Declaring ProjectViewer as an optional dependency for your plugin should fix this issue, since it will make jEdit reload ProjectViewer when your plugin is reloaded, although that may cause data loss (e.g., if PV loads without your plugin being loaded, the data related to your plugin's nodes in a project config file will be lost).