PageRenderTime 51ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/doc/news42/news.xml

#
XML | 792 lines | 642 code | 148 blank | 2 comment | 0 complexity | fb249c0d5b5f28eb540d25ecd4f6858e 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. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!-- :folding=sidekick: -->
  3. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  4. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
  5. <book>
  6. <bookinfo>
  7. <author>
  8. <firstname>Slava</firstname><surname>Pestov</surname>
  9. </author>
  10. <copyright><year>2003</year><holder>Slava Pestov</holder></copyright>
  11. <legalnotice><title>Legal Notice</title>
  12. <para>
  13. Permission is granted to copy, distribute and/or modify this document
  14. under the terms of the GNU Free Documentation License, Version 1.1 or
  15. any later version published by the Free Software Foundation; with no
  16. <quote>Invariant Sections</quote>, <quote>Front-Cover Texts</quote> or
  17. <quote>Back-Cover Texts</quote>, each as defined in the license. A copy of
  18. the license is included in the file <filename>COPYING.DOC.txt</filename>
  19. included with the jEdit distribution.
  20. </para>
  21. </legalnotice>
  22. <title>What's New in jEdit 4.2</title>
  23. </bookinfo>
  24. <chapter id="user-changes"><title>User-Visible Changes</title>
  25. <sect1 id="incompatible"><title>Incompatible Changes</title>
  26. <para>
  27. Soft wrapping to the text area width (by setting the wrap width to zero) is no longer supported.
  28. </para>
  29. <para>
  30. The <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Synchronized Scrolling</guimenuitem> command has been removed.
  31. </para>
  32. </sect1>
  33. <sect1 id="plugin-manager"><title>Plugin Manager</title>
  34. <para>
  35. A new plugin API has been added that allows plugins to be loaded and unloaded while jEdit is running. The plugin manager's user interface has also been overhauled to be more intuitive and powerful.
  36. </para>
  37. <para>
  38. While the new API is mostly backwards compatible, some plugins will no longer work. The best way to upgrade from 4.1 to 4.2 is to completely remove any existing plugins, and re-install a new set from scratch.
  39. </para>
  40. <para>
  41. Plugin options have been moved from the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem> dialog box to a new <guimenu>Plugins</guimenu>&gt;<guimenuitem>Plugin Options</guimenuitem> dialog box.
  42. </para>
  43. <para>
  44. If you are a plugin developer, see <xref linkend="api-changes"/>.
  45. </para>
  46. </sect1>
  47. <sect1 id="interface"><title>User Interface</title>
  48. <para>
  49. jEdit now saves the configuration of open views between sessions; this includes including their position, size and any splits. This information is stored in the <filename>perspective.xml</filename> file in the settings directory.
  50. </para>
  51. <para>
  52. Dockable windows can now be moved between panes without having to open the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem> dialog box. Just right-click on the dockable window's button, or for floating windows, click the small triangle in the top left corner of the window. In both cases this displays a menu where you can pick a new docking location for the window.
  53. </para>
  54. <para>
  55. A new <guimenu>Utilities</guimenu>&gt;<guimenuitem>Repeat Last Action</guimenuitem> command (shortcut: <keycombo><keycap>Control</keycap><keycap>Space</keycap></keycombo>) repeats the most recently invoked command.
  56. </para>
  57. <para>
  58. The status bar can now optionally display a simple 24-hour clock. This can be enabled in the <guilabel>Status Bar</guilabel> pane of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem> dialog box
  59. </para>
  60. </sect1>
  61. <sect1 id="editing"><title>Text Editing</title>
  62. <para>
  63. Drag and drop of text is now supported in the text area; it can be disabled in the <guimenuitem>Mouse</guimenuitem> pane of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem> dialog box.
  64. </para>
  65. <para>
  66. The <guimenu>Edit</guimenu>&gt;<guimenuitem>Complete Word</guimenuitem> command (shortcut: <keycombo><keycap>Control</keycap><keycap>B</keycap></keycombo>) now looks in all visible buffers for completions.
  67. </para>
  68. <para>
  69. <guimenu>Edit</guimenu>&gt;<guimenuitem>More Clipboard</guimenuitem>&gt;<guimenuitem>Vertical Paste</guimenuitem> command (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  70. <keycombo><keycap>Control</keycap><keycap>P</keycap></keycombo>) behaves in a more intelligent manner. Entering characters while a rectangular selection is active inserts into each row of the selection, thus a zero-width rectangular selection can now act like a <quote>tall caret</quote>.
  71. </para>
  72. <para>
  73. The new <guimenu>Edit</guimenu>&gt;<guimenuitem>More Selection</guimenuitem>&gt;<guimenuitem>Rectangular Selection</guimenuitem> command (shortcut: <keycombo><keycap>Alt</keycap><keycap>\</keycap></keycombo>) permits rectangular selections to be created using the keyboard. A static bar indicator is shown when rectangular selection mode is active. Clicking beyond the end of a line in rectangular selection mode (or <keycap>Control</keycap>-clicking otherwise) inserts the appropriate amount of whitespace and moves the caret to the clicked location.
  74. </para>
  75. <para>
  76. The new <guimenu>Edit</guimenu>&gt;<guimenuitem>More Clipboard</guimenuitem>&gt;<guimenuitem>Paste Deleted</guimenuitem> command (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
  77. <keycombo><keycap>Control</keycap><keycap>Y</keycap></keycombo>) lists the 20 most recently deleted strings of text. This list of deleted strings is also persistent.
  78. </para>
  79. <para>
  80. Register contents are now saved between editing sessions.
  81. </para>
  82. <para>
  83. The limit of 8 text areas editing a single buffer has been removed.
  84. </para>
  85. <para>
  86. Fold start lines are now colored according to their nesting level in the text area. The colors can be customized in the <guilabel>Syntax Highlighting</guilabel> pane of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem> dialog box. <keycap>Alt</keycap>-clicking on a fold in the gutter (or clicking with the middle mouse button) now narrows to that fold.
  87. </para>
  88. <para>
  89. When soft wrap is on, the text area now scrolls by screen lines, instead of scrolling by physical lines.
  90. </para>
  91. </sect1>
  92. <sect1 id="syntax"><title>Syntax Highlighting</title>
  93. <para>
  94. <!-- as of pre9, -->
  95. 27 new syntax highlighting modes were added, and many existing ones were enhanced. jEdit now supports syntax highlighting for 118 languages.
  96. </para>
  97. <para>
  98. The following new token types were added:
  99. </para>
  100. <itemizedlist>
  101. <listitem><para>COMMENT3</para></listitem>
  102. <listitem><para>COMMENT4</para></listitem>
  103. <listitem><para>LITERAL3</para></listitem>
  104. <listitem><para>LITERAL4</para></listitem>
  105. <listitem><para>KEYWORD4</para></listitem>
  106. </itemizedlist>
  107. <para>
  108. Any capture groups defined in the <literal>SPAN_REGEXP</literal>
  109. element's <literal>BEGIN</literal> child are now substituted into the <literal>END</literal> child for matching purposes. This allows here-docs in languages such as Perl to be highlighted correctly.
  110. </para>
  111. <para>
  112. A new <literal>NO_ESCAPE</literal> attribute has been added to the <literal>SPAN</literal> and <literal>SPAN_REGEXP</literal> elements.
  113. </para>
  114. <para>
  115. A new <literal>IMPORT</literal> rule causes the current ruleset to inherit the rules from the given ruleset.
  116. </para>
  117. <para>
  118. A background color defined for a ruleset's default token type now takes effect on tokens that appear inside this ruleset for which no explicit background color is defined.
  119. </para>
  120. </sect1>
  121. <sect1 id="search"><title>Search and Replace</title>
  122. <para>
  123. Added <guimenuitem>Ignore Case</guimenuitem> (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo> <keycombo><keycap>Control</keycap><keycap>I</keycap></keycombo>) and <guimenuitem>Regular Expressions</guimenuitem> (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo> <keycombo><keycap>Control</keycap><keycap>X</keycap></keycombo>) commands for toggling search bar settings from the keyboard.
  124. </para>
  125. <para>
  126. The <guimenuitem>Incremental Search Bar</guimenuitem> and <guimenuitem>HyperSearch Bar</guimenuitem> commands in the <guimenu>Search</guimenu> menu no longer insert the currently selected text into the search bar. If you prefer this behavior, use <guimenuitem>Incremental Search for Word</guimenuitem> and <guimenuitem>HyperSearch for Word</guimenuitem> instead.
  127. </para>
  128. <para>
  129. Clicking on a line in the <guimenuitem>HyperSearch Results</guimenuitem> window now selects all ocurrences of the search string in that line, not just the first occurrence.
  130. </para>
  131. </sect1>
  132. <sect1 id="files"><title>File Management</title>
  133. <para>
  134. The handling of files that are changed on disk by another program is now more flexible. There are three possible behaviors that can be specified in the <guibutton>General</guibutton> pane of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem> dialog box:
  135. </para>
  136. <itemizedlist>
  137. <listitem><para><guilabel>Do nothing</guilabel> - jEdit will not check if files are modified on disk by another program.</para></listitem>
  138. <listitem><para><guilabel>Prompt</guilabel> - a dialog box will be shown listing all changed files, offering to reload them.</para></listitem>
  139. <listitem><para><guilabel>Automatically reload</guilabel> - a dialog box will be shown listing all changed files, and they are all automatically reloaded.</para></listitem>
  140. </itemizedlist>
  141. <para>
  142. A full list of encodings is now shown in the file system browser's <guimenu>Commands</guimenu>&gt;<guimenuitem>Encoding</guimenuitem> menu and other places. The encoding declaration of XML files is now honoured when loading and saving buffers.
  143. </para>
  144. <para>
  145. When opening a symbolic link on Unix, the opened buffer has the path name of the link itself, not the file pointed by the link. However, it is still not possible to open the same buffer twice by opening two links to the same file.
  146. </para>
  147. </sect1>
  148. <sect1 id="vfs.browser"><title>File System Browser</title>
  149. <para>
  150. The file system browser now shows file details such as size, type, modification time and access permissions. Virtual file systems provided by plugins can add their own columns to the view.
  151. </para>
  152. <para>
  153. The favorites list can now contain files, and a new <guimenu>Utilities</guimenu>&gt;<guisubmenu>Favorites</guisubmenu> menu allows accessing favorites without having to open the file system browser first.
  154. </para>
  155. <para>
  156. File name completion in file dialog boxes has been greatly improved. It is now possible to navigate around the file system quite comfortably without using the mouse.
  157. </para>
  158. </sect1>
  159. </chapter>
  160. <chapter id="api-changes"><title>API Changes</title>
  161. <sect1 id="beanshell"><title>BeanShell</title>
  162. <para>
  163. BeanShell has been updated from version 1.2b7 to 2.0b1. The
  164. new release of BeanShell brings support for scripted
  165. classes, static imports, mixins, better
  166. error reporting, improved performance, and various fixes.
  167. </para>
  168. c
  169. <para>
  170. A number of jEdit-specific changes are also present in this
  171. BeanShell version; they will eventually be merged back into
  172. the main BeanShell source tree.
  173. </para>
  174. <para>
  175. A new preset BeanShell variable, <varname>wm</varname> is set to the
  176. <function>view.getDockableWindowManager()</function>.
  177. </para>
  178. <para>
  179. Previously plugins that wanted to provide BeanShell scripting
  180. commands had to source a BeanShell script on startup. This was
  181. slow. Now, BeanShell supports a <quote>command path</quote>.
  182. When an unresolved method name is entered, the command path is
  183. consulted for the method definition. Entries are added to the
  184. command path using the following method of the
  185. <ulink
  186. url="../api/org/gjt/sp/jedit/NameSpace.html">NameSpace</ulink>
  187. class:
  188. </para>
  189. <para>
  190. <funcsynopsis>
  191. <funcprototype>
  192. <funcdef>void <function>addCommandPath</function></funcdef>
  193. <paramdef>String <parameter>path</parameter></paramdef>
  194. <paramdef>Class <parameter>clas</parameter></paramdef>
  195. </funcprototype>
  196. </funcsynopsis>
  197. </para>
  198. <para>
  199. For example, if your plugin provides commands in the
  200. <filename>commands</filename> directory of the JAR file, you
  201. could call something like this:
  202. </para>
  203. <programlisting>BeanShell.getNameSpace().addCommandPath("/commands/",
  204. MyPlugin.class);</programlisting>
  205. </sect1>
  206. <sect1 id="plugin-api"><title>Dynamic Plugin Loading</title>
  207. <para>
  208. In jEdit 4.1 and earlier, plugins are always fully loaded at program
  209. startup, and unloaded at program shutdown. While the plugin loader and
  210. API was very simple as a result, this scheme had two main
  211. disadvantages:
  212. </para>
  213. <itemizedlist>
  214. <listitem><para>Having a large number of plugins generally slowed down
  215. jEdit startup, since many plugins performed a lot of lengthy
  216. initialization.
  217. Even if all plugins made their <function>start()</function>
  218. methods as quick as possible, there would still be the overhead of
  219. scanning the JAR files, loading the plugin classes, and so on.</para>
  220. </listitem>
  221. <listitem><para>There was no way to reload plugins in a running jEdit
  222. instance. This made plugin development and use of the plugin manager
  223. a bit cumbersome.</para>
  224. </listitem>
  225. </itemizedlist>
  226. <para>
  227. Through a stroke of insight, one notices that the only
  228. functions called from most plugins' <function>start()</function>
  229. methods fall into two categories:
  230. </para>
  231. <itemizedlist>
  232. <listitem><para>Registration of virtual file systems, fold handlers,
  233. macro handlers, Console shells, SideKick parsers, ...</para>
  234. </listitem>
  235. <listitem><para>Arbitriary initialization that only needs to be
  236. done when the plugin is first invoked by the user, and not at
  237. program startup.</para></listitem>
  238. </itemizedlist>
  239. <para>
  240. jEdit 4.2 moves the former task out of the <function>start()</function>
  241. method and into a file within the JAR that can be parsed quickly. This
  242. allows the plugin core class to only be loaded, and its
  243. <function>start()</function> method called, only when
  244. the plugin is first invoked. Note that the <function>start()</function>
  245. method is always called from the event dispatch thread (or from
  246. the main thread if the GUI has not yet been loaded). Therefore you
  247. do not need to worry about thread-safety issues.
  248. </para>
  249. <para>
  250. Also, plugins can now be loaded and unloaded at runtime.
  251. </para>
  252. </sect1>
  253. <sect1 id="class-editplugin"><title>EditPlugin Class Changes</title>
  254. <para>
  255. Documentation for the properties mentioned below, and their possible values,
  256. can be found in the
  257. documentation for the <ulink
  258. url="../api/org/gjt/sp/jedit/EditPlugin.html">EditPlugin</ulink> class.
  259. </para>
  260. <para>
  261. jEdit distinguishes between jEdit 4.1 and 4.2-style plugins by checking
  262. for the presence of a single property,
  263. <property>plugin.<replaceable>class
  264. name</replaceable>.activate</property>. If this property is present, the
  265. plugin is loaded using the new API.
  266. </para>
  267. <para>
  268. Since the plugin's menu might need to be displayed before its core class
  269. is fully loaded, there is a new way of specifying the plugin menu using
  270. properties; the <function>createMenuItems()</function> method of the
  271. <ulink
  272. url="../api/org/gjt/sp/jedit/EditPlugin.html">EditPlugin</ulink>
  273. class has been deprecated.
  274. </para>
  275. <para>
  276. For example, the jEdit 4.1 version of the QuickNotepad plugin had the
  277. following <function>createMenuItems()</function> method:
  278. </para>
  279. <programlisting>public void createMenuItems(Vector menuItems)
  280. {
  281. menuItems.addElement(GUIUtilities.loadMenu("quicknotepad.menu"));
  282. }</programlisting>
  283. <para>
  284. Additionally, the following two properties were defined in
  285. <filename>QuickNotepad.props</filename>:
  286. </para>
  287. <programlisting>quicknotepad.menu.label=QuickNotepad
  288. quicknotepad.menu=quicknotepad - quicknotepad.choose-file \
  289. quicknotepad.save-file quicknotepad.copy-to-buffer</programlisting>
  290. <para>
  291. The jEdit 4.2 version of this plugin no longer has a
  292. <function>createMenuItems()</function> method, and instead defines the
  293. following property:
  294. </para>
  295. <programlisting>plugin.QuickNotepadPlugin.menu=quicknotepad \
  296. - \
  297. quicknotepad.choose-file \
  298. quicknotepad.save-file \
  299. quicknotepad.copy-to-buffer</programlisting>
  300. <para>
  301. Note that specifying a <property>.label</property> property for the menu
  302. is no longer necessary, as the label becomes the name of the plugin.
  303. </para>
  304. <para>
  305. If the content of your plugin's menu is determined at runtime, you must
  306. use the new dynamic menu API by defining a property like so:
  307. </para>
  308. <programlisting>plugin.MyPlugin.menu.code=new MyPluginMenuProvider();</programlisting>
  309. <para>
  310. The value of the property is a BeanShell snippet that should evaluate to a
  311. <ulink
  312. url="../api/org/gjt/sp/jedit/menu/DynamicMenuProvider.html">DynamicMenuProvider</ulink>
  313. instance.
  314. </para>
  315. <para>
  316. Similarly, option panes should are now specified using properties, and
  317. the <function>createOptionPanes()</function> method of the
  318. <ulink
  319. url="../api/org/gjt/sp/jedit/EditPlugin.html">EditPlugin</ulink>
  320. class has been deprecated.
  321. </para>
  322. <para>
  323. In QuickNotepad's case, the <function>createOptionPanes()</function>
  324. method has been removed:
  325. </para>
  326. <programlisting>public void createOptionPanes(OptionsDialog od)
  327. {
  328. od.addOptionPane(new QuickNotepadOptionPane());
  329. }</programlisting>
  330. <para>
  331. The new properties look like this:
  332. </para>
  333. <programlisting>plugin.QuickNotepadPlugin.option-pane=quicknotepad
  334. options.quicknotepad.code=new QuickNotepadOptionPane();</programlisting>
  335. </sect1>
  336. <sect1 id="actions"><title>Actions</title>
  337. <para>
  338. The syntax of the <filename>actions.xml</filename> file has not changed.
  339. </para>
  340. <para>
  341. A few methods of the <ulink
  342. url="../api/org/gjt/sp/jedit/EditAction.html">EditAction</ulink>
  343. class were made
  344. final, since these three values must be known even if the action
  345. instance in question has not been loaded:
  346. </para>
  347. <itemizedlist>
  348. <listitem><para><function>getLabel()</function></para></listitem>
  349. <listitem><para><function>isToggle()</function></para></listitem>
  350. <listitem><para><function>getMouseOverText()</function></para></listitem>
  351. </itemizedlist>
  352. <para>
  353. This change does not affect plugins that define actions using an
  354. <filename>actions.xml</filename> file. However, if your plugin creates
  355. action instances dynamically, you will need to make calls like the
  356. following instead of overriding these methods:
  357. </para>
  358. <programlisting>jEdit.setTemporaryProperty("<replaceable>action name</replaceable>.label",
  359. "<replaceable>Hello World</replaceable>");
  360. jEdit.setTemporaryProperty("<replaceable>action name</replaceable>.toggle",
  361. "<replaceable>true or false</replaceable>");
  362. jEdit.setTemporaryProperty("<replaceable>action name</replaceable>.mouse-over",
  363. "<replaceable>some string</replaceable>");</programlisting>
  364. <para>
  365. Make sure to use <function>jEdit.setTemporaryProperty()</function> and
  366. not <function>jEdit.setProperty()</function> since the latter will save
  367. the values to the user properties file, which is probably not what you
  368. want.
  369. </para>
  370. <para>
  371. The <function>jEdit.getActions()</function> method has been
  372. deprecated, since it must load all plugin <filename>actions.xml</filename>
  373. files in order to return an array of <ulink
  374. url="../api/org/gjt/sp/jedit/EditAction.html">EditAction</ulink>
  375. instances. Use <function>jEdit.getActionNames()</function> instead,
  376. which returns an array of strings.
  377. </para>
  378. <para>
  379. A new abstract method was added to the <ulink
  380. url="../api/org/gjt/sp/jedit/gui/InputHandler.html">InputHandler</ulink>
  381. class:
  382. </para>
  383. <para>
  384. <funcsynopsis>
  385. <funcprototype>
  386. <funcdef>void <function>addKeyBinding</function></funcdef>
  387. <paramdef>String <parameter>keyBinding</parameter></paramdef>
  388. <paramdef>String <parameter>action</parameter></paramdef>
  389. </funcprototype>
  390. </funcsynopsis>
  391. </para>
  392. <para>
  393. The <function>removeKeyBinding()</function> method of the <ulink
  394. url="../api/org/gjt/sp/jedit/gui/DefaultInputHandler.html">DefaultInputHandler</ulink>
  395. class has finally been implemented. Previously it always threw
  396. an <classname>InternalError</classname> when invoked.
  397. </para>
  398. </sect1>
  399. <sect1 id="dockables"><title>Dockable Windows</title>
  400. <para>
  401. The syntax of the <filename>dockables.xml</filename> file has not changed.
  402. </para>
  403. <para>
  404. Instead of overriding the deprecated
  405. <function>JComponent.requestDefaultFocus()</function> method,
  406. dockable windows can now implement the new <ulink
  407. url="../api/org/gjt/sp/jedit/gui/DefaultFocusComponent.html">DefaultFocusComponent</ulink>
  408. interface and its
  409. <function>focusOnDefaultComponent()</function> method.
  410. </para>
  411. </sect1>
  412. <sect1 id="services"><title>Services</title>
  413. <para>
  414. A new <filename>services.xml</filename> file can be provided in the
  415. plugin JAR file. The preferred way of adding virtual file systems, fold
  416. handlers and many other types of extensions is through this file. Its
  417. syntax is described in the documentation for the <ulink
  418. url="../api/org/gjt/sp/jedit/ServiceManager.html">ServiceManager</ulink>
  419. class.
  420. </para>
  421. </sect1>
  422. <sect1 id="vfs"><title>Virtual File Systems</title>
  423. <para>
  424. Instead of calling <function>VFSManager.registerVFS()</function> in your
  425. plugin's <function>start()</function> method, add entries in the
  426. <filename>services.xml</filename> file that look like so:
  427. </para>
  428. <programlisting><![CDATA[<SERVICE CLASS="org.gjt.sp.jedit.io.VFS" NAME="ftp">
  429. new ftp.FtpVFS(false);
  430. </SERVICE>]]></programlisting>
  431. <para>
  432. A new <ulink
  433. url="../api/org/gjt/sp/jedit/io/VFS.DirectoryEntryCompare.html">VFS.DirectoryEntryCompare</ulink>
  434. class was added,
  435. for sorting lists of VFS directory entries.
  436. </para>
  437. <para>
  438. Fields named <varname>canRead</varname> and <varname>canWrite</varname>
  439. were added to the <ulink
  440. url="../api/org/gjt/sp/jedit/io/VFS.DirectoryEntry.html">VFS.DirectoryEntry</ulink>
  441. class.
  442. </para>
  443. <para>
  444. There is a new extended attribute API to go with the details view in the
  445. file system browser. Pass an array of extended attribute names to the
  446. <ulink
  447. url="../api/org/gjt/sp/jedit/io/VFS.html">VFS</ulink> constructor, then
  448. provide an implementation
  449. of the <function>getExtendedAttribute()</function> method in your
  450. subclass of <ulink
  451. url="../api/org/gjt/sp/jedit/io/VFS.DirectoryEntry.html">VFS.DirectoryEntry</ulink>.
  452. </para>
  453. <para>
  454. The following two methods in the <ulink
  455. url="../api/org/gjt/sp/jedit/io/VFSManager.html">VFSManager</ulink>
  456. class have been deprecated since they can no longer be implemented for
  457. file systems using the deferred loading API
  458. </para>
  459. <itemizedlist>
  460. <listitem><para><function>getVFSByName()</function> - use
  461. <function>getVFSForProtocol()</function>
  462. instead.</para></listitem>
  463. <listitem><para><function>getFilesystems()</function> - use
  464. <function>getVFSs()</function>, which returns a string array,
  465. instead.</para></listitem>
  466. </itemizedlist>
  467. </sect1>
  468. <sect1 id="extensions"><title>Text Area Extensions</title>
  469. <para>
  470. The API for text area extensions is still the same, however you
  471. must make sure your plugin correctly adds itself to existing
  472. text areas when it is loaded after jEdit startup, and that it
  473. removes itself from open views if it is unloaded before jEdit
  474. exits.
  475. </para>
  476. <para>
  477. A new method was added to the <ulink
  478. url="../api/org/gjt/sp/jedit/textarea/TextAreaExtension.html">TextAreaExtension</ulink>
  479. class:
  480. </para>
  481. <para>
  482. <funcsynopsis>
  483. <funcprototype>
  484. <funcdef>void <function>paintScreenLineRange</function></funcdef>
  485. <paramdef>Graphics2D <parameter>gfx</parameter></paramdef>
  486. <paramdef>int <parameter>firstLine</parameter></paramdef>
  487. <paramdef>int <parameter>lastLine</parameter></paramdef>
  488. <paramdef>int[] <parameter>physicalLines</parameter></paramdef>
  489. <paramdef>int[] <parameter>start</parameter></paramdef>
  490. <paramdef>int[] <parameter>end</parameter></paramdef>
  491. <paramdef>int <parameter>y</parameter></paramdef>
  492. <paramdef>int <parameter>lineHeight</parameter></paramdef>
  493. </funcprototype>
  494. </funcsynopsis>
  495. </para>
  496. <para>
  497. See the class documentation for information on each parameter.
  498. </para>
  499. <para>
  500. You can override this method to paint a range of
  501. lines at once, instead of having to respond to each individual
  502. <function>paintValidLine()</function> and
  503. <function>paintInvalidLine</function> call.
  504. </para>
  505. <para>
  506. While for many text area extensions using this method will result
  507. in no speedup, some like the error highlight in the ErrorList
  508. plugin become more efficient. The error highlight searches an
  509. array each time it has to paint a line. Previously the array
  510. was searched for each line painted in screen. Using this method,
  511. it is possible to search the array only once when painting a
  512. range of lines.
  513. </para>
  514. </sect1>
  515. <sect1 id="syntax-api"><title>Syntax Highlighting</title>
  516. <para>
  517. The <classname>org.gjt.sp.jedit.syntax</classname> package can now
  518. be used in other programs.
  519. All you need to provide is error handling and logic for locating
  520. the XML mode files. See the
  521. <ulink url="../api/org/gjt/sp/jedit/syntax/package-summary.html">package
  522. documentation</ulink> for details.
  523. </para>
  524. </sect1>
  525. <sect1 id="textarea-api"><title>Text Area and Folding</title>
  526. <para>The
  527. <ulink
  528. url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
  529. class has a new <function>addToLeftOfScrollBar()</function> method that
  530. adds a component to the left of the scroll bar. Previously plugins like
  531. JDiff had to resort to undocumented hacks to do this.
  532. </para>
  533. <para>
  534. The code that displays lines of text on screen has been overhauled for
  535. improved performance and correctness. As a result, two methods in
  536. <ulink
  537. url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
  538. that have been deprecated since jEdit 4.0 were removed:
  539. </para>
  540. <itemizedlist>
  541. <listitem><para><function>xToOffset()</function></para>
  542. </listitem>
  543. <listitem><para><function>offsetToX()</function></para>
  544. </listitem>
  545. </itemizedlist>
  546. <para>
  547. As in jEdit 4.0 and 4.1, the <function>xyToOffset()</function> and
  548. <function>offseToXY()</function> methods replace these two.
  549. </para>
  550. <para>
  551. Also, the way folds are handled has changed. The
  552. <classname>FoldVisibilityManager</classname> class has been removed,
  553. and a number of methods in the <ulink
  554. url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
  555. class have been removed also:
  556. </para>
  557. <itemizedlist>
  558. <listitem><para><function>virtualToPhysical()</function></para>
  559. </listitem>
  560. <listitem><para><function>physicalToVirtual()</function></para>
  561. </listitem>
  562. <listitem><para><function>getVirtualLineCount()</function></para>
  563. </listitem>
  564. </itemizedlist>
  565. <para>
  566. The replacement for the <classname>FoldVisibilityManager</classname>
  567. class is a class named <ulink
  568. url="../api/org/gjt/sp/jedit/io/DisplayManager.html">DisplayManager</ulink>,
  569. with a similar but not identical API.
  570. </para>
  571. <para>
  572. Previously, a <quote>virtual line number</quote> was a line number such
  573. that each physical line (delimited by <literal>\n</literal>) counted
  574. as 1 if it was visible, and 0 if it was not. They did not take into
  575. account lines that were split on screen as a result of soft wrap, and
  576. this made the soft wrap scrolling code rather complicated.
  577. </para>
  578. <para>
  579. In jEdit 4.2, virtual line numbers are no longer used internally; now,
  580. similar <quote>scroll line numbers</quote> are used. Scroll line numbers
  581. take both hidden lines and soft wrap into account. The
  582. <function>getFirstLine()</function> and
  583. <function>setFirstLine()</function> methods of the
  584. <ulink
  585. url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
  586. class now work with
  587. scroll line numbers.
  588. </para>
  589. <para>
  590. An internal API for converting between scroll line numbers and physical
  591. line numbers exists, but it is rather complicated and it will not be
  592. made public. Instead, if you want the text area to scroll to a given
  593. physical line number, use the new
  594. <function>setFirstPhysicalLine()</function> method in the
  595. <ulink
  596. url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
  597. class.
  598. </para>
  599. <para>
  600. Instead of calling <function>FoldHandler.registerFoldHandler()</function>
  601. in your
  602. plugin's <function>start()</function> method, add entries in the
  603. <filename>services.xml</filename> file that look like so:
  604. </para>
  605. <programlisting><![CDATA[<SERVICE CLASS="org.gjt.sp.jedit.buffer.FoldHandler" NAME="sidekick">
  606. new sidekick.SideKickFoldHandler()
  607. </SERVICE>]]></programlisting>
  608. </sect1>
  609. <sect1 id="misc-api-changes"><title>Miscellaneous API Changes</title>
  610. <para>
  611. A new <function>View.goToBuffer()</function> method has been added.
  612. If the specified buffer is already
  613. visible in one of the view's edit panes, it sends focus to that edit
  614. pane. Otherwise, it calls <function>setBuffer()</function>
  615. on the current edit pane.
  616. </para>
  617. <para>
  618. The constructor of the <ulink
  619. url="../api/org/gjt/sp/jedit/io/EBMessage.html">EBMessage</ulink> class
  620. now takes
  621. an <classname>Object</classname>, as opposed to an
  622. <ulink
  623. url="../api/org/gjt/sp/jedit/io/EBComponent.html">EBComponent</ulink>.
  624. Plugins that provide custom message
  625. types will need to be recompiled.
  626. </para>
  627. <para>
  628. The following deprecated method was removed from the
  629. <ulink
  630. url="../api/org/gjt/sp/jedit/io/GUIUtilities.html">GUIUtilities</ulink>
  631. class:
  632. </para>
  633. <para>
  634. <funcsynopsis>
  635. <funcprototype>
  636. <funcdef>void <function>loadMenu</function></funcdef>
  637. <paramdef>View <parameter>view</parameter></paramdef>
  638. <paramdef>String <parameter>name</parameter></paramdef>
  639. </funcprototype>
  640. </funcsynopsis>
  641. </para>
  642. </sect1>
  643. </chapter>
  644. </book>