PageRenderTime 77ms CodeModel.GetById 59ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/doc/news42/news.xml

#
XML | 838 lines | 674 code | 163 blank | 1 comment | 0 complexity | 736d98ae0e4f54fdc8e8348995f3248c MD5 | raw file
  1<?xml version="1.0" encoding="UTF-8" ?>
  2
  3<!-- :folding=sidekick: -->
  4
  5<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  6		"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
  7
  8<book>
  9	<bookinfo>
 10		<author>
 11			<firstname>Slava</firstname><surname>Pestov</surname>
 12		</author>
 13		<copyright><year>2003</year>
 14		<year>2004</year><holder>Slava Pestov</holder></copyright>
 15		<legalnotice><title>Legal Notice</title>
 16			<para>
 17				Permission is granted to copy, distribute and/or modify this document
 18				under the terms of the GNU Free Documentation License, Version 1.1 or
 19				any later version published by the Free Software Foundation; with no
 20				<quote>Invariant Sections</quote>, <quote>Front-Cover Texts</quote> or
 21				<quote>Back-Cover Texts</quote>, each as defined in the license. A copy of
 22				the license is included in the file <filename>COPYING.DOC.txt</filename>
 23				included with the jEdit distribution.
 24			</para>
 25		</legalnotice>
 26		<title>What's New in jEdit 4.2</title>
 27	</bookinfo>
 28
 29	<chapter id="user-changes"><title>User-Visible Changes</title>
 30	
 31	<sect1 id="incompatible"><title>Removed Features</title>
 32	
 33	<para>
 34	 Soft wrapping to the text area width (by setting the wrap width to zero) is no longer supported.
 35	</para>
 36
 37	<para>
 38	 The <guimenu>View</guimenu>&gt;<guisubmenu>Scrolling</guisubmenu>&gt;<guimenuitem>Synchronized Scrolling</guimenuitem> command has been removed.
 39	</para>
 40
 41	<para>
 42	 The <application>jEditLauncher</application> component for Windows shell integration is no longer included.
 43	</para>
 44
 45	</sect1>
 46
 47	<sect1 id="plugin-manager"><title>Plugin Manager</title>
 48	
 49	<para>
 50	 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.
 51	</para>
 52
 53	<para>
 54	 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.
 55	</para>
 56	
 57	<para>
 58	 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.
 59	</para>
 60
 61	<para>
 62	 If you are a plugin developer, see <xref linkend="api-changes"/>.
 63	</para>
 64
 65	</sect1>
 66
 67	<sect1 id="interface"><title>User Interface</title>
 68	
 69	<para>
 70	 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.
 71	</para>
 72
 73	<para>
 74	 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.
 75	</para>
 76
 77	<para>
 78	 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.
 79	</para>
 80
 81	<para>
 82	 The status bar can now optionally display a simple clock. This can be enabled in the <guilabel>Status Bar</guilabel> pane of the <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem> dialog box
 83	</para>
 84
 85	</sect1>
 86	
 87	<sect1 id="editing"><title>Text Editing</title>
 88	
 89	<para>
 90	 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.
 91	</para>
 92
 93	<para>
 94	 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. Also, the longest common prefix of the completions is inserted if there are multiple completions.
 95	</para>
 96
 97	<para>
 98	 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>
 99	 <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.
100	</para>
101	
102	<para>
103	 Register contents are now saved between editing sessions.
104	</para>
105
106	<para>
107	 The limit of 8 text areas editing a single buffer has been removed.
108	</para>
109
110	<para>
111	 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.
112	</para>
113
114	<para>
115	 When soft wrap is on, the text area now scrolls by screen lines, instead of scrolling by physical lines.
116	</para>
117
118	</sect1>
119
120	<sect1 id="rect"><title>Rectangular Editing</title>
121
122	<para>
123	 <guimenu>Edit</guimenu>&gt;<guimenuitem>More Clipboard</guimenuitem>&gt;<guimenuitem>Vertical Paste</guimenuitem> command (shortcut: <keycombo><keycap>Control</keycap><keycap>E</keycap></keycombo>
124	 <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>.
125	</para>
126	
127	<para>
128	 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.
129	</para>
130	
131	<para>
132	 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.
133	</para>
134
135	<para>
136	 The rectangular selection now acts like a <quote>tall caret</quote>. Inserting text or pressing <keycap>Backspace</keycap> or <keycap>Delete</keycap> while a rectangular selection is active performs that operation on each selected line.
137	</para>
138
139	</sect1>
140
141	<sect1 id="syntax"><title>Syntax Highlighting</title>
142	 <para>
143	  Many new syntax highlighting modes were added, and many existing ones were enhanced. jEdit now supports syntax highlighting for 133 languages.
144	 </para>
145	 <para>
146	  The following new token types were added:
147	 </para>
148	 <itemizedlist>
149	 <listitem><para>COMMENT3</para></listitem>
150	 <listitem><para>COMMENT4</para></listitem>
151	 <listitem><para>LITERAL3</para></listitem>
152	 <listitem><para>LITERAL4</para></listitem>
153	 <listitem><para>KEYWORD4</para></listitem>
154	 </itemizedlist>
155	 <para>
156	  Any capture groups defined in the <literal>SPAN_REGEXP</literal>
157	  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.
158	 </para>
159	 <para>
160	  A new <literal>NO_ESCAPE</literal> attribute has been added to the <literal>SPAN</literal> and <literal>SPAN_REGEXP</literal> elements.
161	 </para>
162	 <para>
163	  A new <literal>IMPORT</literal> rule causes the current ruleset to inherit the rules from the given ruleset.
164	 </para>
165	 <para>
166	  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.
167	 </para>
168	</sect1>
169
170	<sect1 id="search"><title>Search and Replace</title>
171	
172	<para>
173	 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.
174	</para>
175
176	<para>
177	 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.
178	</para>
179
180	<para>
181	 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.
182	</para>
183
184	</sect1>
185
186	<sect1 id="files"><title>File Management</title>
187	
188	<para>
189	 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:
190	</para>
191
192	<itemizedlist>
193	 <listitem><para><guilabel>Do nothing</guilabel> - jEdit will not check if files are modified on disk by another program.</para></listitem>
194	 <listitem><para><guilabel>Prompt</guilabel> - a dialog box will be shown listing all changed files, offering to reload them.</para></listitem>
195	 <listitem><para><guilabel>Automatically reload</guilabel> - a dialog box will be shown listing all changed files, and they are all automatically reloaded.</para></listitem>
196	</itemizedlist>
197
198	<para>
199	 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.
200	</para>
201
202	</sect1>
203
204	<sect1 id="encodings"><title>Handling of Multiple Encodings</title>
205	
206	<para>
207	 A full list of encodings supported by your Java implementation is now shown in the file system browser's <guimenu>Commands</guimenu>&gt;<guimenuitem>Encoding</guimenuitem> menu and other places. Previously only a small list of common encodings was shown.
208	</para>
209
210	<para>
211	 Files saved in the <literal>UTF-8Y</literal> encoding are now supported. This encoding is identical to <literal>UTF-8</literal> except there
212	 is a three-byte signature (<literal>0xEFBBBF</literal>) at the beginning of the file.
213	</para>
214
215	<para>
216	 UTF8-Y-encoded files are auto-detected as being such.
217	</para>
218
219	<para>
220	 The encoding used by XML files is also auto-detected if the file provides an XML declaration like the following:
221	</para>
222
223	<programlisting><![CDATA[<?xml version="1.0" encoding="UTF-8"?>]]></programlisting>
224	</sect1>
225
226	<sect1 id="vfs.browser"><title>File System Browser</title>
227	
228	<para>
229	 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.
230	</para>
231
232	<para>
233	 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.
234	</para>
235
236	<para>
237	 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.
238	</para>
239
240	</sect1>
241
242	<sect1 id="bundled-macros"><title>Bundled Macros</title>
243	
244	<para>
245	 There are a number of new bundled macros, and most of the existing ones have undergone enhancements and bug fixes. jEdit 4.1 bundled 28 macros in 4 categories; jEdit 4.2 bundles 58 macros in 7 categories.
246	</para>
247
248	<para>
249	  Of course you can create new macros of your own, either by recording actions or writing them from scratch.
250	</para>
251
252	</sect1>
253
254	</chapter>
255	
256	<chapter id="api-changes"><title>API Changes</title>
257	
258	<sect1 id="beanshell"><title>BeanShell</title>
259
260	<para>
261		BeanShell has been updated from version 1.2b7 to 2.0b1. The
262		new release of BeanShell brings support for scripted
263		classes, static imports, mixins, better
264		error reporting, improved performance, and various fixes.
265	</para>
266
267	<para>
268		A number of jEdit-specific changes are also present in this
269		BeanShell version; they will eventually be merged back into
270		the main BeanShell source tree.
271	</para>
272
273	<para>
274		A new preset BeanShell variable, <varname>wm</varname> is set to the
275		<function>view.getDockableWindowManager()</function>.
276	</para>
277
278
279	<para>
280		Previously plugins that wanted to provide BeanShell scripting
281		commands had to source a BeanShell script on startup. This was
282		slow. Now, BeanShell supports a <quote>command path</quote>.
283		When an unresolved method name is entered, the command path is
284		consulted for the method definition. Entries are added to the
285		command path using the following method of the
286		<ulink
287		url="../api/org/gjt/sp/jedit/NameSpace.html">NameSpace</ulink>
288		class:
289	</para>
290
291	<para>
292		<funcsynopsis>
293		<funcprototype>
294		<funcdef>void <function>addCommandPath</function></funcdef>
295		<paramdef>String <parameter>path</parameter></paramdef>
296		<paramdef>Class <parameter>clas</parameter></paramdef>
297		</funcprototype>
298		</funcsynopsis>
299	</para>
300
301	<para>
302		For example, if your plugin provides commands in the
303		<filename>commands</filename> directory of the JAR file, you
304		could call something like this:
305	</para>
306
307	<programlisting>BeanShell.getNameSpace().addCommandPath("/commands/",
308    MyPlugin.class);</programlisting>
309
310	</sect1>
311	
312	<sect1 id="plugin-api"><title>Dynamic Plugin Loading</title>
313
314	<para>
315		In jEdit 4.1 and earlier, plugins are always fully loaded at program
316		startup, and unloaded at program shutdown. While the plugin loader and
317		API was very simple as a result, this scheme had two main
318		disadvantages:
319	</para>
320
321	<itemizedlist>
322		<listitem><para>Having a large number of plugins generally slowed down
323		jEdit startup, since many plugins performed a lot of lengthy
324		initialization.
325		Even if all plugins made their <function>start()</function>
326		methods as quick as possible, there would still be the overhead of
327		scanning the JAR files, loading the plugin classes, and so on.</para>
328		</listitem>
329		<listitem><para>There was no way to reload plugins in a running jEdit
330		instance. This made plugin development and use of the plugin manager
331		a bit cumbersome.</para>
332		</listitem>
333	</itemizedlist>
334
335	<para>
336		Through a stroke of insight, one notices that the only
337		functions called from most plugins' <function>start()</function>
338		methods fall into two categories:
339	</para>
340
341	<itemizedlist>
342		<listitem><para>Registration of virtual file systems, fold handlers,
343		macro handlers, Console shells, SideKick parsers, ...</para>
344		</listitem>
345		<listitem><para>Arbitriary initialization that only needs to be
346		done when the plugin is first invoked by the user, and not at
347		program startup.</para></listitem>
348	</itemizedlist>
349	
350	<para>
351		jEdit 4.2 moves the former task out of the <function>start()</function>
352		method and into a file within the JAR that can be parsed quickly. This
353		allows the plugin core class to only be loaded, and its
354		<function>start()</function> method called, only when
355		the plugin is first invoked. Note that the <function>start()</function>
356		method is always called from the event dispatch thread (or from
357		the main thread if the GUI has not yet been loaded). Therefore you
358		do not need to worry about thread-safety issues.
359	</para>
360	
361	<para>
362		Also, plugins can now be loaded and unloaded at runtime.
363	</para>
364	
365	</sect1>
366
367	<sect1 id="class-editplugin"><title>EditPlugin Class Changes</title>
368	
369	<para>
370		Documentation for the properties mentioned below, and their possible values,
371		can be found in the
372		documentation for the <ulink
373		url="../api/org/gjt/sp/jedit/EditPlugin.html">EditPlugin</ulink> class.
374	</para>
375
376	<para>
377		jEdit distinguishes between jEdit 4.1 and 4.2-style plugins by checking
378		for the presence of a single property,
379		<property>plugin.<replaceable>class
380		name</replaceable>.activate</property>. If this property is present, the
381		plugin is loaded using the new API.
382	</para>
383
384	<para>
385		Since the plugin's menu might need to be displayed before its core class
386		is fully loaded, there is a new way of specifying the plugin menu using
387		properties; the <function>createMenuItems()</function> method of the
388		<ulink
389		url="../api/org/gjt/sp/jedit/EditPlugin.html">EditPlugin</ulink>
390		class has been deprecated.
391	</para>
392
393	<para>
394		For example, the jEdit 4.1 version of the QuickNotepad plugin had the
395		following <function>createMenuItems()</function> method:
396	</para>
397
398	<programlisting>public void createMenuItems(Vector menuItems)
399{
400    menuItems.addElement(GUIUtilities.loadMenu("quicknotepad.menu"));
401}</programlisting>
402
403	<para>
404		Additionally, the following two properties were defined in
405		<filename>QuickNotepad.props</filename>:
406	</para>
407
408	<programlisting>quicknotepad.menu.label=QuickNotepad
409quicknotepad.menu=quicknotepad - quicknotepad.choose-file \
410    quicknotepad.save-file quicknotepad.copy-to-buffer</programlisting>
411
412	<para>
413		The jEdit 4.2 version of this plugin no longer has a
414		<function>createMenuItems()</function> method, and instead defines the
415		following property:
416	</para>
417
418	<programlisting>plugin.QuickNotepadPlugin.menu=quicknotepad \
419    - \
420    quicknotepad.choose-file \
421    quicknotepad.save-file \
422    quicknotepad.copy-to-buffer</programlisting>
423
424	<para>
425		Note that specifying a <property>.label</property> property for the menu
426		is no longer necessary, as the label becomes the name of the plugin.
427	</para>
428
429	<para>
430		If the content of your plugin's menu is determined at runtime, you must
431		use the new dynamic menu API by defining a property like so:
432	</para>
433
434	<programlisting>plugin.MyPlugin.menu.code=new MyPluginMenuProvider();</programlisting>
435
436	<para>
437		The value of the property is a BeanShell snippet that should evaluate to a
438		<ulink
439		url="../api/org/gjt/sp/jedit/menu/DynamicMenuProvider.html">DynamicMenuProvider</ulink>
440		instance.
441	</para>
442
443	<para>
444		Similarly, option panes should are now specified using properties, and
445		the <function>createOptionPanes()</function> method of the
446		<ulink
447		url="../api/org/gjt/sp/jedit/EditPlugin.html">EditPlugin</ulink>
448		class has been deprecated.
449	</para>
450
451	<para>
452		In QuickNotepad's case, the <function>createOptionPanes()</function>
453		method has been removed:
454	</para>
455
456	<programlisting>public void createOptionPanes(OptionsDialog od)
457    {
458        od.addOptionPane(new QuickNotepadOptionPane());
459    }</programlisting>
460
461	<para>
462		The new properties look like this:
463	</para>
464
465	<programlisting>plugin.QuickNotepadPlugin.option-pane=quicknotepad
466options.quicknotepad.code=new QuickNotepadOptionPane();</programlisting>
467
468	</sect1>
469
470	<sect1 id="actions"><title>Actions</title>
471	
472	<para>
473		The syntax of the <filename>actions.xml</filename> file has not changed.
474	</para>
475
476	<para>
477		A few methods of the <ulink
478		url="../api/org/gjt/sp/jedit/EditAction.html">EditAction</ulink>
479		class were made
480		final, since these three values must be known even if the action
481		instance in question has not been loaded:
482	</para>
483	
484	<itemizedlist>
485		<listitem><para><function>getLabel()</function></para></listitem>
486		<listitem><para><function>isToggle()</function></para></listitem>
487		<listitem><para><function>getMouseOverText()</function></para></listitem>
488	</itemizedlist>
489	
490	<para>
491		This change does not affect plugins that define actions using an
492		<filename>actions.xml</filename> file. However, if your plugin creates
493		action instances dynamically, you will need to make calls like the
494		following instead of overriding these methods:
495	</para>
496
497	<programlisting>jEdit.setTemporaryProperty("<replaceable>action name</replaceable>.label",
498    "<replaceable>Hello World</replaceable>");
499jEdit.setTemporaryProperty("<replaceable>action name</replaceable>.toggle",
500    "<replaceable>true or false</replaceable>");
501jEdit.setTemporaryProperty("<replaceable>action name</replaceable>.mouse-over",
502    "<replaceable>some string</replaceable>");</programlisting>
503
504	<para>
505		Make sure to use <function>jEdit.setTemporaryProperty()</function> and
506		not <function>jEdit.setProperty()</function> since the latter will save
507		the values to the user properties file, which is probably not what you
508		want.
509	</para>
510
511	<para>
512		The <function>jEdit.getActions()</function> method has been
513		deprecated, since it must load all plugin <filename>actions.xml</filename>
514		files in order to return an array of <ulink
515		url="../api/org/gjt/sp/jedit/EditAction.html">EditAction</ulink>
516		instances. Use <function>jEdit.getActionNames()</function> instead,
517		which returns an array of strings.
518	</para>
519
520	<para>
521		A new abstract method was added to the <ulink
522		url="../api/org/gjt/sp/jedit/gui/InputHandler.html">InputHandler</ulink>
523		class:
524	</para>
525	
526	<para>
527		<funcsynopsis>
528		<funcprototype>
529		<funcdef>void <function>addKeyBinding</function></funcdef>
530		<paramdef>String <parameter>keyBinding</parameter></paramdef>
531		<paramdef>String <parameter>action</parameter></paramdef>
532		</funcprototype>
533		</funcsynopsis>
534	</para>
535
536	<para>
537		The <function>removeKeyBinding()</function> method of the <ulink
538		url="../api/org/gjt/sp/jedit/gui/DefaultInputHandler.html">DefaultInputHandler</ulink>
539		class has finally been implemented. Previously it always threw
540		an <classname>InternalError</classname> when invoked.
541	</para>
542
543	</sect1>
544
545	<sect1 id="dockables"><title>Dockable Windows</title>
546	
547	<para>
548		The syntax of the <filename>dockables.xml</filename> file has not changed.
549	</para>
550
551	<para>
552		Instead of overriding the deprecated
553		<function>JComponent.requestDefaultFocus()</function> method,
554		dockable windows can now implement the new <ulink
555		url="../api/org/gjt/sp/jedit/gui/DefaultFocusComponent.html">DefaultFocusComponent</ulink>
556		interface and its
557		<function>focusOnDefaultComponent()</function> method.
558	</para>
559
560	</sect1>
561
562	<sect1 id="services"><title>Services</title>
563	
564	<para>
565		A new <filename>services.xml</filename> file can be provided in the
566		plugin JAR file. The preferred way of adding virtual file systems, fold
567		handlers and many other types of extensions is through this file. Its
568		syntax is described in the documentation for the <ulink
569		url="../api/org/gjt/sp/jedit/ServiceManager.html">ServiceManager</ulink>
570		class.
571	</para>
572
573	</sect1>
574
575	<sect1 id="vfs"><title>Virtual File Systems</title>
576	
577	<para>
578		Instead of calling <function>VFSManager.registerVFS()</function> in your
579		plugin's <function>start()</function> method, add entries in the
580		<filename>services.xml</filename> file that look like so:
581	</para>
582
583	<programlisting><![CDATA[<SERVICE CLASS="org.gjt.sp.jedit.io.VFS" NAME="ftp">
584    new ftp.FtpVFS(false);
585</SERVICE>]]></programlisting>
586
587	<para>
588		A new  <ulink
589		url="../api/org/gjt/sp/jedit/io/VFS.DirectoryEntryCompare.html">VFS.DirectoryEntryCompare</ulink>
590		class was added,
591		for sorting lists of VFS directory entries.
592	</para>
593
594	<para>
595		Fields named <varname>canRead</varname> and <varname>canWrite</varname>
596		were added to the <ulink
597		url="../api/org/gjt/sp/jedit/io/VFS.DirectoryEntry.html">VFS.DirectoryEntry</ulink>
598		class.
599	</para>
600
601	<para>
602		There is a new extended attribute API to go with the details view in the
603		file system browser. Pass an array of extended attribute names to the
604		<ulink
605		url="../api/org/gjt/sp/jedit/io/VFS.html">VFS</ulink> constructor, then
606		provide an implementation
607		of the <function>getExtendedAttribute()</function> method in your
608		subclass of <ulink
609		url="../api/org/gjt/sp/jedit/io/VFS.DirectoryEntry.html">VFS.DirectoryEntry</ulink>.
610	</para>
611
612	<para>
613		The following two methods in the <ulink
614		url="../api/org/gjt/sp/jedit/io/VFSManager.html">VFSManager</ulink>
615		class have been deprecated since they can no longer be implemented for
616		file systems using the deferred loading API
617	</para>
618
619	<itemizedlist>
620		<listitem><para><function>getVFSByName()</function> - use
621		<function>getVFSForProtocol()</function>
622		instead.</para></listitem>
623		<listitem><para><function>getFilesystems()</function> - use
624		<function>getVFSs()</function>, which returns a string array,
625		instead.</para></listitem>
626	</itemizedlist>
627
628	</sect1>
629
630	<sect1 id="extensions"><title>Text Area Extensions</title>
631
632	<para>
633		The API for text area extensions is still the same, however you
634		must make sure your plugin correctly adds itself to existing
635		text areas when it is loaded after jEdit startup, and that it
636		removes itself from open views if it is unloaded before jEdit
637		exits.
638	</para>
639
640	<para>
641		A new method was added to the <ulink
642		url="../api/org/gjt/sp/jedit/textarea/TextAreaExtension.html">TextAreaExtension</ulink>
643		class:
644	</para>
645
646	<para>
647		<funcsynopsis>
648		<funcprototype>
649		<funcdef>void <function>paintScreenLineRange</function></funcdef>
650		<paramdef>Graphics2D <parameter>gfx</parameter></paramdef>
651		<paramdef>int <parameter>firstLine</parameter></paramdef>
652		<paramdef>int <parameter>lastLine</parameter></paramdef>
653		<paramdef>int[] <parameter>physicalLines</parameter></paramdef>
654		<paramdef>int[] <parameter>start</parameter></paramdef>
655		<paramdef>int[] <parameter>end</parameter></paramdef>
656		<paramdef>int <parameter>y</parameter></paramdef>
657		<paramdef>int <parameter>lineHeight</parameter></paramdef>
658		</funcprototype>
659		</funcsynopsis>
660	</para>
661
662	<para>
663		See the class documentation for information on each parameter.
664	</para>
665
666	<para>
667		You can override this method to paint a range of
668		lines at once, instead of having to respond to each individual
669		<function>paintValidLine()</function> and
670		<function>paintInvalidLine</function> call.
671	</para>
672
673	<para>
674		While for many text area extensions using this method will result
675		in no speedup, some like the error highlight in the ErrorList
676		plugin become more efficient. The error highlight searches an
677		array each time it has to paint a line. Previously the array
678		was searched for each line painted in screen. Using this method,
679		it is possible to search the array only once when painting a
680		range of lines.
681	</para>
682
683	</sect1>
684
685	<sect1 id="syntax-api"><title>Syntax Highlighting</title>
686	
687	<para>
688		The <classname>org.gjt.sp.jedit.syntax</classname> package can now
689		be used in other programs.
690		All you need to provide is error handling and logic for locating
691		the XML mode files. See the
692		<ulink url="../api/org/gjt/sp/jedit/syntax/package-summary.html">package
693		documentation</ulink> for details.
694	</para>
695
696	</sect1>
697
698	<sect1 id="textarea-api"><title>Text Area and Folding</title>
699
700	<para>The
701		<ulink
702		url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
703		class has a new <function>addToLeftOfScrollBar()</function> method that
704		adds a component to the left of the scroll bar. Previously plugins like
705		JDiff had to resort to undocumented hacks to do this.
706	</para>
707
708	<para>
709		The code that displays lines of text on screen has been overhauled for
710		improved performance and correctness. As a result, two methods in
711		<ulink
712		url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
713		that have been deprecated since jEdit 4.0 were removed:
714	</para>
715
716	<itemizedlist>
717		<listitem><para><function>xToOffset()</function></para>
718		</listitem>
719		<listitem><para><function>offsetToX()</function></para>
720		</listitem>
721	</itemizedlist>
722
723	<para>
724		As in jEdit 4.0 and 4.1, the <function>xyToOffset()</function> and
725		<function>offseToXY()</function> methods replace these two.
726	</para>
727
728	<para>
729		Also, the way folds are handled has changed. The
730		<classname>FoldVisibilityManager</classname> class has been removed,
731		and a number of methods in the <ulink
732		url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
733		class have been removed also:
734	</para>
735
736	<itemizedlist>
737		<listitem><para><function>virtualToPhysical()</function></para>
738		</listitem>
739		<listitem><para><function>physicalToVirtual()</function></para>
740		</listitem>
741		<listitem><para><function>getVirtualLineCount()</function></para>
742		</listitem>
743	</itemizedlist>
744
745	<para>
746		The replacement for the <classname>FoldVisibilityManager</classname>
747		class is a class named <ulink
748		url="../api/org/gjt/sp/jedit/io/DisplayManager.html">DisplayManager</ulink>,
749		with a similar but not identical API.
750	</para>
751
752	<para>
753		Previously, a <quote>virtual line number</quote> was a line number such
754		that each physical line (delimited by <literal>\n</literal>) counted
755		as 1 if it was visible, and 0 if it was not. They did not take into
756		account lines that were split on screen as a result of soft wrap, and
757		this made the soft wrap scrolling code rather complicated.
758	</para>
759
760	<para>
761		In jEdit 4.2, virtual line numbers are no longer used internally; now,
762		similar <quote>scroll line numbers</quote> are used. Scroll line numbers
763		take both hidden lines and soft wrap into account. The
764		<function>getFirstLine()</function> and
765		<function>setFirstLine()</function> methods of the
766		<ulink
767		url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
768		class now work with
769		scroll line numbers.
770	</para>
771
772	<para>
773		An internal API for converting between scroll line numbers and physical
774		line numbers exists, but it is rather complicated and it will not be
775		made public. Instead, if you want the text area to scroll to a given
776		physical line number, use the new
777		<function>setFirstPhysicalLine()</function> method in the
778		<ulink
779		url="../api/org/gjt/sp/jedit/textarea/JEditTextArea.html">JEditTextArea</ulink>
780		class.
781	</para>
782
783	<para>
784		Instead of calling <function>FoldHandler.registerFoldHandler()</function>
785		in your
786		plugin's <function>start()</function> method, add entries in the
787		<filename>services.xml</filename> file that look like so:
788	</para>
789
790	<programlisting><![CDATA[<SERVICE CLASS="org.gjt.sp.jedit.buffer.FoldHandler" NAME="sidekick">
791    new sidekick.SideKickFoldHandler()
792</SERVICE>]]></programlisting>
793
794	</sect1>
795
796	<sect1 id="misc-api-changes"><title>Miscellaneous API Changes</title>
797	
798	<para>
799		A new <function>View.goToBuffer()</function> method has been added.
800		If the specified buffer is already
801		visible in one of the view's edit panes, it sends focus to that edit
802		pane. Otherwise, it calls <function>setBuffer()</function>
803		on the current edit pane.
804	</para>
805
806	<para>
807		The constructor of the <ulink
808		url="../api/org/gjt/sp/jedit/io/EBMessage.html">EBMessage</ulink> class
809		now takes
810		an <classname>Object</classname>, as opposed to an
811		<ulink
812		url="../api/org/gjt/sp/jedit/io/EBComponent.html">EBComponent</ulink>.
813		Plugins that provide custom message
814		types will need to be recompiled.
815	</para>
816	
817	<para>
818		The following deprecated method was removed from the
819		<ulink
820		url="../api/org/gjt/sp/jedit/io/GUIUtilities.html">GUIUtilities</ulink>
821		class:
822	</para>
823	
824	<para>
825		<funcsynopsis>
826		<funcprototype>
827		<funcdef>void <function>loadMenu</function></funcdef>
828		<paramdef>View <parameter>view</parameter></paramdef>
829		<paramdef>String <parameter>name</parameter></paramdef>
830		</funcprototype>
831		</funcsynopsis>
832	</para>
833
834	</sect1>
835
836	</chapter>
837	
838</book>