PageRenderTime 15ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms


Plain Text | 99 lines | 78 code | 21 blank | 0 comment | 0 complexity | f086bb3878fb4e254acb861be507c511 MD5 | raw file
 1$Id: changes40.txt 3890 2001-11-11 03:02:31Z jgellene $
 3Changes made to QuickNotepad plugin for jEdit 4.0:
 5(1) Under jEdit 3.2.2 and prior versions, the plugin had a separate class,
 6QuickNotepadDockable, implementing the DockableWindow interface. The class's
 7methods delegated actions to the plugin's top-level visible component, a class
 8derived from JPanel called QuickNotepad. The DockableWindow interface is
 9deprecated in jEdit 4.0, so this class was eliminated. If the top-level
10component had implemented the DockableWindow interface, it would have been
11necessary to remove DockableWindow as an implemented interface and the eliminate
12the getName() and getComponent() methods of that interface in the plugin class.
14(2) A new file, dockables.xml, was created containing XML markup for the
15constructor of a plugin component. Under the new plugin API, this file is read
16to determine the method call or calls for constructing a new instance of a
17dockable plugin component. The file is quite short:
19<?xml version="1.0"?>
21<!DOCTYPE DOCKABLES SYSTEM "dockables.dtd">
23<!-- QuickNotepad dockable window -->
26  <DOCKABLE NAME="quicknotepad">
27    new QuickNotepad(view, position);
31The parameters are those found in the existing version of the QuickNotepad
32constructor. Both "view" and "position" are defined by the new plugin API in the
33namespace in which the constructor is called. The value of position is taken
34from optional properties set by the user. In the absence of a user setting, the
35position parameter is set to place the plugin component in a floating window.
37The NAME attribute is taken to conform to the value of the static variable
38QuickNotepadPlugin.NAME, which is also used to identify the plugin in the user
39action code contained in actions.xml.
41By default, the plugin API adds two actions for a plugin. The first is entitled
42[name of plugin] (in this case, "quicknotepad"), and simply activates the plugin
43by executing the code contained in the DOCKABLE element. The second action
44toggles the plugin's visible component, the title of the action is [name of
45plugin]-toggle (in this case, "quicknotepad-toggle"). The plugin API handles
46this action internally.
48To prevent these actions from being created, you can add a NO_ACTIONS="true"
49attribute to the DOCKABLE element. The NAME and NO_ACTIONS attributes are the
50only attributes defined for a DOCKABLE entry. A NAME is required; NO_ACTIONS is
51set to "false" by default.
53(3) In the actions.xml file, the user action definitions were revised to call
54DockableWindowManager.getDockable() instead of
55DockableManager.getDockableWindow(). In addition, the actions for toggling the
56plugin docking window and bringing the QuickNotepad window to the foreground
57were eliminated. The toggle action was duplicative of the built-in action
58supplied through dockables.xml, and the "bring to front" action had become
61(4) There were two deletions made in QuickNotepadPlugin, the main plugin class.
63The handleMessage() method was eliminated because it was only necessary for the
64plugin to listen for the CreateDockableWindow message. As a result, it is no
65longer necessary for this plugin to connect to the EditBus, so its derivation
66was changed from EBPlugin to EditPlugin. Individual instances of the
67QuickNotepad class still need to listen for a PropertiesChanged message, so that
68class continues to implement EBComponent.
70In addition, since the EditBus no longer maintains an active list of windows,
71the call to EditBus.addToNamedList() is no longer needed in the class's start()
72method and so was eliminated, leaving an empty start() method.
74(5) No changes were required in the option pane class, QuickNotepadOptionsPane,
75or the other other classes defining components of the plugin.
77(6) Finally, several changes were made to the propoerties file of the plugin,
78QuickNotepad.props. First, the plugin's dependency properties were changed to
79make the plugin dependent upon version 4.0 or greater of jEdit:
83Next, the quicknotepad.title property was eliminated, and the "label" properties
84for the docking window and plugin menu were reorganized into two categories:
85labels for action created by dockable.xml (quicknotepad.label and
86quicknotepad-toggle.label), and labels for actions created by actions.xml (the
87remaining user actions: "choose-file", "save-file" and "copy-to-buffer").
89The plugin was built using the standard build.xml supplied for plugins,
90after checking to make sure that the name of the plugin and the location of
91jedit.jar were correct. It was also necessary to add dockables.xml to the list
92of files to be archived by the jar utility. Iterations of the build process
93helped to uncover deprecated API elements.
95The help file was built from DocBook XML source using xsltproc. The build.xml
96Ant build file and the users-guide.xsl customization file contain annotations
97which may be helpful in building plugin documentation. In particular, a few
98<indexterm> tags were added to the documentation source to provide references
99for the index to be generated for all plugin files.