This task involves planning a change to jEdit's edit modes and macros features. You will need to first familiarize yourself with jEdit and the edit modes and macros.
jEdit-4-1-pre6
. JEdit will appear momentarily.
Some warning messages will be displayed in the console: this
is normal. Do not close JEdit.Several files can be opened and edited at once. Each open file is referred to as a buffer.JEdit supports context-specific behaviour and actions through the use of edit modes and macros. From the jEdit user manual:
An edit mode specifies syntax highlighting rules, auto indent behavior, and various other customizations for editing a certain file type.
Macros in jEdit are short scripts written in a scripting language called BeanShell. They provide an easy way to automate repetitive keyboard and menu procedures, as well as access to the objects and methods created by jEdit. Macros also provide a powerful facility for customizing jEdit and automating complex text processing and programming tasks.
modes/xml.xml
. Notice
how different elements of the XML file are highlighted in
different colours and fonts. All edit modes are described
using XML: this particular file describes the edit mode for
XML files.modes
: this directory contains file
definitions for the edit modes. The jEdit user manual notes:
jEdit looks for edit modes in two locations; themodes
subdirectory of the jEdit settings directory, and themodes
subdirectory of the jEdit install directory. The location of the settings directory is system-specific.
catalog
. The
jEdit user manual notes:
Each mode directory contains a catalog
file. All edit modes contained in that directory must be
listed in the catalog, otherwise they will not be available
to jEdit.
- Choose File -> Open and look at the contents of the jEdit-4.1pre6 directory. Using the file chooser dialog, look at the directory structure of the
macros
directory; note its correspondance with the contents of the Macros menu. From the jEdit user manual:Macros are defined in files written in a language called BeanShell. [...]
Macros are stored in two places: the
macros
subdirectory of the jEdit home directory, and themacros
subdirectory of the user-specific settings directory.There is no central description file for macros analogous to the edit modes'
catalog
file.When jEdit first loads, it scans the designated macro directories and assembles a listing of individual macros in the
Macros
menu. When scanning the names, jEdit will delete underscore characters and the.bsh
extension for menu labels, so thatList_Useful_Information.bsh
, for example, will be displayed in theMacros
menu asList Useful Information
.
You are to create a a plan for performing the following task. This involves identifying the relevant program elements that need to be changed and how they should be changed, and those program elements that are necessary to understand for the change. NOTE: You are not actually required perform the changes. Rather you should identify the particular classes and methods to be used describe any new classes required. These instructions should be appropriate for giving to a first-year coop student to rapidly turn to working code.
You are to perform the software exploration using the provided software exploration tool. We ask that you attempt to use this tool for as much of your exploration as possible: we are interested in what information it cannot provide, and the circumstances. If you cannot find the answer to your query, then by all means use the normal Eclipse facilities.
Change Task: jEdit may be used for editing the macro and edit mode definitions. Your task is to add support to dynamically reload any edit modes or update its macro listings should they change. The modified version should meet the following requirements:
You are given the following expert knowledge about the source code:
jEdit's internals provides support for an event
broadcast system, including file system changes, in
org.gjt.sp.jedit.EditBus
.
Please notify the investigator when you are ready to commence.