PageRenderTime 60ms CodeModel.GetById 51ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/doc/users-guide/api-message.xml

#
XML | 379 lines | 306 code | 70 blank | 3 comment | 0 complexity | 9cb72050e85a489b08648a4e4f8108d9 MD5 | raw file
  1<!-- jEdit 3.1 Plugin Guide, (C) 2001 John Gellene -->
  2
  3<!-- jEdit buffer-local properties:                           -->
  4<!-- :indentSize=1:tabSize=2:noTabs=true:maxLineLen=72:       -->
  5
  6<chapter id="api-message"><title>EditBus Classes</title>
  7
  8<para>
  9    This section describes the <classname>EditBus</classname> class
 10    itself, as well as the abstract <classname>EBMessage</classname>
 11    class and all classes that derive from it.
 12    See <xref linkend="host-display-manager" /> for an overview
 13    of how the EditBus works.
 14</para>
 15
 16<sect1 id="class-editbus"><title>Class EditBus</title>
 17
 18  <para>
 19    This class provides a messaging system for all components that implement
 20    the	<classname>EBComponent</classname> interface, including
 21    <classname>View</classname> and <classname>EBPlugin</classname>
 22    objects.
 23  </para>
 24
 25<itemizedlist>
 26
 27  <listitem>
 28    <funcsynopsis>
 29      <funcprototype>
 30        <funcdef>public static void <function>addToBus</function></funcdef>
 31        <paramdef>EBComponent <parameter>component</parameter></paramdef>
 32      </funcprototype>
 33    </funcsynopsis>
 34  </listitem>
 35
 36  <listitem>
 37    <funcsynopsis>
 38      <funcprototype>
 39        <funcdef>public static void <function>removeFromBus</function></funcdef>
 40        <paramdef>EBComponent <parameter>component</parameter></paramdef>
 41      </funcprototype>
 42    </funcsynopsis>
 43	<para>
 44		Adds or removes a subscribing component.
 45	</para>
 46  </listitem>
 47
 48  <listitem>
 49    <funcsynopsis>
 50      <funcprototype>
 51        <funcdef>public EBComponent[] <function>getComponents</function></funcdef>
 52        <void/>
 53      </funcprototype>
 54    </funcsynopsis>
 55	<para>
 56		Returns an array of all components connected to the EditBus.
 57	</para>
 58  </listitem>
 59
 60  <listitem>
 61    <funcsynopsis>
 62      <funcprototype>
 63        <funcdef>public void <function>send</function></funcdef>
 64        <paramdef>EBMessage <parameter>message</parameter></paramdef>
 65      </funcprototype>
 66    </funcsynopsis>
 67    <para>
 68        Send the specified message to all subscribers on the EditBus.
 69    </para>
 70  </listitem>
 71
 72</itemizedlist>
 73
 74</sect1>
 75
 76<sect1 id="class-ebcomponent"><title>Interface EBComponent</title>
 77<para>
 78  This interface is required for any class that subscribes to messages
 79  published on the EditBus. It contains a single method.
 80</para>
 81
 82<itemizedlist>
 83  <listitem>
 84    <funcsynopsis>
 85      <funcprototype>
 86        <funcdef>public void <function>handleMessage</function></funcdef>
 87        <paramdef>EBMessage <parameter>message</parameter></paramdef>
 88      </funcprototype>
 89    </funcsynopsis>
 90  </listitem>
 91</itemizedlist>
 92
 93</sect1>
 94
 95<sect1 id="class-ebmessage"><title>Class EBMessage</title>
 96<para>
 97    This abstract class defines a message that can be sent on the EditBus to
 98    subscribing components.  It contains two attributes that can be obtained
 99    with the following methods:
100</para>
101
102<itemizedlist>
103  <listitem>
104    <funcsynopsis>
105      <funcprototype>
106        <funcdef>public EBComponent <function>getSource</function></funcdef>
107        <void/>
108      </funcprototype>
109    </funcsynopsis>
110  </listitem>
111
112  <listitem>
113    <funcsynopsis>
114      <funcprototype>
115        <funcdef>public boolean <function>isVetoed</function></funcdef>
116        <void/>
117      </funcprototype>
118    </funcsynopsis>
119  </listitem>
120
121  <listitem>
122    <funcsynopsis>
123      <funcprototype>
124        <funcdef>public void <function>veto</function></funcdef>
125        <void/>
126      </funcprototype>
127    </funcsynopsis>
128    <para>
129        This sets the <parameter>vetoed</parameter> state to
130        <constant>true</constant>, which terminates circulation of the
131        message to subscribers on the EditBus.  To prevent a message from being
132        vetoed, the message object must be derived from the abstract class
133        <classname>EBMessage.NonVetoable</classname>.  An object of this class
134        will throw an <classname>InternalError</classname> if the
135        <function>veto()</function> method is called on it.
136    </para>
137  </listitem>
138
139</itemizedlist>
140
141<para>
142    A summary of classes derived from <classname>EBMessage</classname>
143    can be found in the following sections.
144</para>
145
146</sect1>
147
148<sect1 id="class-bufferupdate"><title>Class BufferUpdate</title>
149<para>
150    This message is sent when the status of a buffer changes.  It may
151    not be vetoed by a subscriber, so that all subscribers are
152    assured of receiving it regardless of an individual subscriber's
153    response.
154</para>
155
156<itemizedlist>
157
158  <listitem>
159    <funcsynopsis>
160      <funcprototype>
161        <funcdef>public Buffer <function>getBuffer</function></funcdef>
162        <void/>
163      </funcprototype>
164    </funcsynopsis>
165  </listitem>
166
167  <listitem>
168    <funcsynopsis>
169      <funcprototype>
170        <funcdef>public View <function>getView</function></funcdef>
171        <void/>
172      </funcprototype>
173    </funcsynopsis>
174    <para>
175      This may be <literal>null</literal> with some message types.
176    </para>
177  </listitem>
178
179  <listitem>
180    <funcsynopsis>
181      <funcprototype>
182        <funcdef>public Object <function>getWhat</function></funcdef>
183        <void/>
184      </funcprototype>
185    </funcsynopsis>
186    <para>
187      Returns one of the following constants defined in the
188      <classname>BufferUpdate</classname> class:
189    </para>
190    <itemizedlist>
191      <listitem><para><varname>CREATED</varname></para></listitem>
192      <listitem><para><varname>LOAD_STARTED</varname></para></listitem>
193      <listitem><para><varname>DIRTY_CHANGED</varname></para></listitem>
194      <listitem><para><varname>MARKERS_CHANGED</varname></para></listitem>
195      <listitem><para><varname>MODE_CHANGED</varname></para></listitem>
196      <listitem><para><varname>ENCODING_CHANGED</varname></para></listitem>
197      <listitem><para><varname>SAVING</varname></para></listitem>
198    </itemizedlist>
199  </listitem>
200
201</itemizedlist>
202
203</sect1>
204
205<sect1 id="class-editorexiting"><title>Class EditorExiting</title>
206
207<para>
208  This message signifies that the host application is about to exit.
209  The message has no parameters and may not be vetoed.
210</para>
211
212</sect1>
213
214<sect1 id="class-editorexitrequested"><title>Class EditorExitRequested</title>
215
216<para>
217  This message signifies that a request has been made for the host application
218  to exit. The request is subject to cancellation in response to a request to
219  write a modified buffer to storage. It may not be vetoed.
220</para>
221
222<itemizedlist>
223
224  <listitem>
225    <funcsynopsis>
226      <funcprototype>
227        <funcdef>public View <function>getView</function></funcdef>
228        <void/>
229      </funcprototype>
230    </funcsynopsis>
231  </listitem>
232
233</itemizedlist>
234
235</sect1>
236
237<sect1 id="class-editorstarted"><title>Class EditorStarted</title>
238
239<para>
240  This message signifies that the host application has started. The
241  message is sent before any views are created. The message has no
242  parameters and it may not be vetoed.
243</para>
244
245</sect1>
246
247<sect1 id="class-editpaneupdate"><title>Class EditPaneUpdate</title>
248<para>
249    This message is sent when the status of a edit pane changes.  It may
250    not be vetoed.
251</para>
252
253<itemizedlist>
254
255  <listitem>
256    <funcsynopsis>
257      <funcprototype>
258        <funcdef>public EditPane <function>getEditPane</function></funcdef>
259        <void/>
260      </funcprototype>
261    </funcsynopsis>
262  </listitem>
263
264  <listitem>
265    <funcsynopsis>
266      <funcprototype>
267        <funcdef>public Object <function>getWhat</function></funcdef>
268        <void/>
269      </funcprototype>
270    </funcsynopsis>
271    <para>
272      Returns one of the following constants defined in the
273      <classname>EditPaneUpdate</classname> class:
274    </para>
275    <itemizedlist>
276      <listitem><para><varname>CREATED</varname></para></listitem>
277      <listitem><para><varname>DESTROYED</varname></para></listitem>
278      <listitem><para><varname>BUFFER_CHANGED</varname> - a change in the buffer
279        displayed in the edit pane</para></listitem>
280    </itemizedlist>
281  </listitem>
282
283</itemizedlist>
284
285
286</sect1>
287
288<sect1 id="class-macroschanged"><title>Class MacrosChanged</title>
289
290<para>
291  This message signifies that the list of available macros have changed.
292  The message has no parameters and may not be vetoed.
293</para>
294
295</sect1>
296
297<sect1 id="class-propertieschanged"><title>Class PropertiesChanged</title>
298
299<para>
300  This message is sent when configuration settings have been changed through
301  any of the option panes in the options dialog. The message has no
302  parameters and may be vetoed.
303</para>
304
305</sect1>
306
307<sect1 id="class-searchsettingschanged">
308<title>Class SearchSettingsChanged</title>
309
310<para>
311  This message is sent when settings in the <quote>Search and
312  Replace</quote> dialog have changed. The message has no
313  parameters and may be vetoed.
314</para>
315
316</sect1>
317
318<sect1 id="class-vfsupdate"><title>Class VFSUpdate</title>
319<para>
320    This message is sent when the status of a file or directory changes.
321    This allows subscribers that display or operate upon files an
322    opportunity to adjust their state.  This message may not be vetoed.
323</para>
324
325<itemizedlist>
326
327  <listitem>
328    <funcsynopsis>
329      <funcprototype>
330        <funcdef>public String <function>getPath</function></funcdef>
331        <void/>
332      </funcprototype>
333    </funcsynopsis>
334  </listitem>
335
336</itemizedlist>
337
338
339</sect1>
340
341<sect1 id="class-viewupdate"><title>Class ViewUpdate</title>
342<para>
343    This message is sent when the status of a view changes. It may
344    not be vetoed.
345</para>
346
347<itemizedlist>
348
349  <listitem>
350    <funcsynopsis>
351      <funcprototype>
352        <funcdef>public View <function>getView</function></funcdef>
353        <void/>
354      </funcprototype>
355    </funcsynopsis>
356  </listitem>
357
358  <listitem>
359    <funcsynopsis>
360      <funcprototype>
361        <funcdef>public Object <function>getWhat</function></funcdef>
362        <void/>
363      </funcprototype>
364    </funcsynopsis>
365    <para>
366      Returns one of the following constants defined in the
367      <classname>ViewUpdate</classname> class:
368    </para>
369    <itemizedlist>
370      <listitem><para><varname>CREATED</varname></para></listitem>
371      <listitem><para><varname>CLOSED</varname></para></listitem>
372    </itemizedlist>
373  </listitem>
374
375</itemizedlist>
376
377</sect1>
378
379</chapter>