Chapter 2. Using the ProjectViewer plugin

The plugin interface consists of a tool bar, containing some command buttons, a menu containing the currently available projects (accessible through the button labeled with the current active node), and the project's views.

To open a ProjectViewer window, you'll need to choose the "Open Project Viewer" action from the plugin's menu. Optionally, you can go to the Global Options dialog in jEdit, and dock the window in your favorite position (in the "Docking" tab). Note that activating a project or group using the plugin menu will not open a ProjectViewer window if one is not already opened.

Organizing Your Projects

Project Viewer allows you to organize your projects into groups. You can create as many groups as you with in an hierarchical manner, by using the "Add group here" command in the tree's context menu, or choosing the "New group here" entry from under the desired group in the projects menu.

As with projects, it is possible to have groups as the root of the tree shown in the dockable window. For this, just choose a group from the projects menu to make it active. Some plugin functionality is not available when in this mode.

You can also move projects and groups to other locations in your group hierarchy by using the "Move to..." command in the tree's context menu and choosing the desired destination from the displayed menu.

Switching projects with keyboard

As you create more and more projects, you will want to be able to switch between them without using the mouse. ProjectViewer offers many keyboard-friendly ways of switching projects.

  1. If you want to use standard Swing shortcuts and arrow keys to navigate through the Project tree, you should also bind ProjectViewer actions Select Parent Group and Open Group or Project to keyboard shortcuts (alt-up and alt-down suggested). While you are there, don't forget to bind a shortcut for ProjectViewer itself.

  2. Each project and group gets its own "direct switch" action. You can bind these actions to keyboard shortcuts by selecting the ProjectViewer: Project Actions action set from the Global options -> ShortCuts panel -> Edit shortcuts: combobox.

  3. The FastOpen plugin offers more convenient and/or mouse-free ways of switching between files and projects, and is an extension to ProjectViewer.

The Project Views

There are four possible views of the files on a project: the "Folders" view, which shows the files as if in a file manager, organised in directories. The "Files" view, which shows all the project's files in a flat list. The "Working Files", which shows the files currently opened in jEdit. And the "Compact View", which compresses subdirectories into top-level nodes, showing a structure similar to the java package naming.

The files in the different views are colored according to the patterns and colors you have choosen for the filesystem-browser. Furthermore currently open files are highlighted by underlining their names.

You can interact with the project tree in several ways:

Importing Files

Differently from earlier releases, the plugin does not follow the filesystem layout to organize files anymore, except for certain cases; notably, when doing the initial import from the project root or when adding a file that has been saved from an open buffer and is not currently part of the project.

In the import dialog (available by choosing "Import files" from the right-click menu), you can choose any files to be imported to the selected node (the one where you clicked to get the context menu). The same filters available when doing the initial import for the project are available in the file chooser.

You may choose any files and directories to import, even files and directories that are not "children" of the selected node in the file system layout. This allows you to organize your files in any way you want. You may even enter the name of a non-existant file in the file chooser: it will be treated as a directory, and even though the directory does not exist on disk, you'll have the same functionality for it as you have for other directories in your project.

The file import dialog is a standard Java file dialog with a few added options to controle the behavior of the import process. These options are:

Commands available in the toolbar

The tool bar provides a fast way to access some of the functionality of the Project Viewer plugin. The available commands are:

Commands available in the context menu

The context menu provides context-sensitive options based on the current tree selection. The following commands can be found in the context menu (some of them have already been explained above):

Using PV commands from jEdit

Some commands are also available as jEdit actions so that shortcuts can be assigned to them. You can check all the possible commands available as actions by going to the "Shortcuts" panel in the jEdit options dialog, and selecting the ProjectViewer plugin.

When executing a command using a shortcut, you may notice that sometimes no action is performed and an error message appears in the status bar. This means that the action is not available for the current selection in the tree. To check which actions are available for the selected node(s), check the context menu by clicking the node with the right mouse button.

Third party plugins commands

Project Viewer can be extended by other plugins; they can add properties to a project and define new actions for nodes in the tree. Consult each plugins documentation for information about possible commands available for the Project Viewer plugin.

For developers go to chapter Developer Documentation to get some starting help fo how to cooperate with the Project Viewer plugin.