PageRenderTime 49ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/jars/QuickNotepad/changes40.txt

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