📄 changes40.txt
字号:
$Id: changes40.txt,v 1.4 2001/11/11 03:02:31 jgellene Exp $Changes made to QuickNotepad plugin for jEdit 4.0:(1) Under jEdit 3.2.2 and prior versions, the plugin had a separate class,QuickNotepadDockable, implementing the DockableWindow interface. The class'smethods delegated actions to the plugin's top-level visible component, a classderived from JPanel called QuickNotepad. The DockableWindow interface isdeprecated in jEdit 4.0, so this class was eliminated. If the top-levelcomponent had implemented the DockableWindow interface, it would have beennecessary to remove DockableWindow as an implemented interface and the eliminatethe getName() and getComponent() methods of that interface in the plugin class.(2) A new file, dockables.xml, was created containing XML markup for theconstructor of a plugin component. Under the new plugin API, this file is readto determine the method call or calls for constructing a new instance of adockable plugin component. The file is quite short:<?xml version="1.0"?><!DOCTYPE DOCKABLES SYSTEM "dockables.dtd"><!-- QuickNotepad dockable window --><DOCKABLES> <DOCKABLE NAME="quicknotepad"> new QuickNotepad(view, position); </DOCKABLE></DOCKABLES>The parameters are those found in the existing version of the QuickNotepadconstructor. Both "view" and "position" are defined by the new plugin API in thenamespace in which the constructor is called. The value of position is takenfrom optional properties set by the user. In the absence of a user setting, theposition parameter is set to place the plugin component in a floating window.The NAME attribute is taken to conform to the value of the static variableQuickNotepadPlugin.NAME, which is also used to identify the plugin in the useraction code contained in actions.xml.By default, the plugin API adds two actions for a plugin. The first is entitled[name of plugin] (in this case, "quicknotepad"), and simply activates the pluginby executing the code contained in the DOCKABLE element. The second actiontoggles the plugin's visible component, the title of the action is [name ofplugin]-toggle (in this case, "quicknotepad-toggle"). The plugin API handlesthis action internally.To prevent these actions from being created, you can add a NO_ACTIONS="true"attribute to the DOCKABLE element. The NAME and NO_ACTIONS attributes are theonly attributes defined for a DOCKABLE entry. A NAME is required; NO_ACTIONS isset to "false" by default.(3) In the actions.xml file, the user action definitions were revised to callDockableWindowManager.getDockable() instead ofDockableManager.getDockableWindow(). In addition, the actions for toggling theplugin docking window and bringing the QuickNotepad window to the foregroundwere eliminated. The toggle action was duplicative of the built-in actionsupplied through dockables.xml, and the "bring to front" action had becomeredundant.(4) There were two deletions made in QuickNotepadPlugin, the main plugin class.The handleMessage() method was eliminated because it was only necessary for theplugin to listen for the CreateDockableWindow message. As a result, it is nolonger necessary for this plugin to connect to the EditBus, so its derivationwas changed from EBPlugin to EditPlugin. Individual instances of theQuickNotepad class still need to listen for a PropertiesChanged message, so thatclass continues to implement EBComponent.In addition, since the EditBus no longer maintains an active list of windows,the call to EditBus.addToNamedList() is no longer needed in the class's start()method and so was eliminated, leaving an empty start() method.(5) No changes were required in the option pane class, QuickNotepadOptionsPane,or the other other classes defining components of the plugin.(6) Finally, several changes were made to the propoerties file of the plugin,QuickNotepad.props. First, the plugin's dependency properties were changed tomake the plugin dependent upon version 4.0 or greater of jEdit:plugin.QuickNotepadPlugin.depend.1=jedit 04.00.00.00Next, the quicknotepad.title property was eliminated, and the "label" propertiesfor the docking window and plugin menu were reorganized into two categories:labels for action created by dockable.xml (quicknotepad.label andquicknotepad-toggle.label), and labels for actions created by actions.xml (theremaining user actions: "choose-file", "save-file" and "copy-to-buffer").The plugin was built using the standard build.xml supplied for plugins,after checking to make sure that the name of the plugin and the location ofjedit.jar were correct. It was also necessary to add dockables.xml to the listof files to be archived by the jar utility. Iterations of the build processhelped to uncover deprecated API elements.The help file was built from DocBook XML source using xsltproc. The build.xmlAnt build file and the users-guide.xsl customization file contain annotationswhich may be helpful in building plugin documentation. In particular, a few<indexterm> tags were added to the documentation source to provide referencesfor the index to be generated for all plugin files.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -