The Context Menu Handler

The jEditLauncher package also implements a context menu handler for the Windows shell. It is intended to be be installed as a handler available for any file. When you right-click on a file or shortcut icon, the context menu that appears will include an item displaying the jEdit icon and captioned Open with jEdit. If the file has an extension, another item will appear captioned Open *.XXX with jEdit, where XXX is the extension of the selected file. Clicking this item will cause jEdit to load all files with the same extension in the same directory as the selected file. Multiple file selections are also supported; in this circumstance only the Open with jEdit item appears.

If a single file with a .bsh extension is selected, the menu will also contain an item captioned Run script in jEdit. Selecting this item will cause jEditLauncher to run the selected file as a BeanShell script.

If exactly two files are selected, the menu will contain an entry for Show diff in jEdit. Selecting this item will load the two files in jEdit and have them displayed side-by-side with their differences highlighted by the JDiff plugin. The file selected first will be treated as the base for comparison purposes. If the plugin is not installed, an error message will be displayed in jEdit. See Chapter 8 for more information about installing plugins.