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

/www/tags/NOV_07_2009/htdocs/api/org/gjt/sp/jedit/EditBus.html

#
HTML | 304 lines | 255 code | 39 blank | 10 comment | 0 complexity | 59f92624abc6a450fbd8ec3defc59b54 MD5 | raw file
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2<!--NewPage-->
  3<HTML>
  4<HEAD>
  5<!-- Generated by javadoc (build 1.5.0_14) on Tue Jul 22 07:13:44 GMT-08:00 2008 -->
  6<TITLE>
  7EditBus (jEdit API)
  8</TITLE>
  9
 10<META NAME="keywords" CONTENT="org.gjt.sp.jedit.EditBus class">
 11
 12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
 13
 14
 15<NOSCRIPT>
 16</NOSCRIPT>
 17
 18</HEAD>
 19
 20<BODY BGCOLOR="white" >
 21
 22
 23<!-- ========= START OF TOP NAVBAR ======= -->
 24<A NAME="navbar_top"><!-- --></A>
 25<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
 26<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
 27<TR>
 28<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
 29<A NAME="navbar_top_firstrow"><!-- --></A>
 30<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
 31  <TR ALIGN="center" VALIGN="top">
 32  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
 33  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
 34  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
 35  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/EditBus.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
 36  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
 37  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
 38  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
 39  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
 40  </TR>
 41</TABLE>
 42</TD>
 43<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
 44</EM>
 45</TD>
 46</TR>
 47
 48<TR>
 49<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 50&nbsp;<A HREF="../../../../org/gjt/sp/jedit/EditAction.Wrapper.html" title="class in org.gjt.sp.jedit"><B>PREV CLASS</B></A>&nbsp;
 51&nbsp;<A HREF="../../../../org/gjt/sp/jedit/EditPane.html" title="class in org.gjt.sp.jedit"><B>NEXT CLASS</B></A></FONT></TD>
 52<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 53  <A HREF="../../../../index.html?org/gjt/sp/jedit/EditBus.html" target="_top"><B>FRAMES</B></A>  &nbsp;
 54&nbsp;<A HREF="EditBus.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
 55&nbsp;
 56<NOSCRIPT>
 57  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
 58</NOSCRIPT>
 59
 60
 61</FONT></TD>
 62</TR>
 63<TR>
 64<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 65  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
 66<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 67DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
 68</TR>
 69</TABLE>
 70<A NAME="skip-navbar_top"></A>
 71<!-- ========= END OF TOP NAVBAR ========= -->
 72
 73<HR>
 74<!-- ======== START OF CLASS DATA ======== -->
 75<H2>
 76<FONT SIZE="-1">
 77org.gjt.sp.jedit</FONT>
 78<BR>
 79Class EditBus</H2>
 80<PRE>
 81java.lang.Object
 82  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.jedit.EditBus</B>
 83</PRE>
 84<HR>
 85<DL>
 86<DT><PRE>public class <B>EditBus</B><DT>extends java.lang.Object</DL>
 87</PRE>
 88
 89<P>
 90jEdit's global event notification mechanism.<p>
 91
 92 Plugins register with the EditBus to receive messages reflecting
 93 changes in the application's state, including changes in buffers,
 94 views and edit panes, changes in the set of properties maintained
 95 by the application, and the closing of the application.<p>
 96
 97 The EditBus maintains a list of objects that have requested to receive
 98 messages. When a message is sent using this class, all registered
 99 components receive it in turn. Classes for objects that subscribe to
100 the EditBus must implement the <A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit"><CODE>EBComponent</CODE></A> interface, which
101 defines the single method <A HREF="../../../../org/gjt/sp/jedit/EBComponent.html#handleMessage(org.gjt.sp.jedit.EBMessage)"><CODE>EBComponent.handleMessage(EBMessage)</CODE></A>.<p>
102
103 A plugin core class that extends the
104 <A HREF="../../../../org/gjt/sp/jedit/EBPlugin.html" title="class in org.gjt.sp.jedit"><CODE>EBPlugin</CODE></A> abstract class (and whose name ends with
105 <code>Plugin</code> for identification purposes) will automatically be
106 added to the EditBus during jEdit's startup routine.  Any other
107 class - for example, a dockable window that needs to receive
108 notification of buffer changes - must perform its own registration by calling
109 <A HREF="../../../../org/gjt/sp/jedit/EditBus.html#addToBus(org.gjt.sp.jedit.EBComponent)"><CODE>addToBus(EBComponent)</CODE></A> during its initialization.
110 A convenient place to register in a class derived from <code>JComponent</code>
111 would be in an implementation of the <code>JComponent</code> method
112 <code>addNotify()</code>.<p>
113
114 Message types sent by jEdit can be found in the
115 <A HREF="../../../../org/gjt/sp/jedit/msg/package-summary.html"><CODE>org.gjt.sp.jedit.msg</CODE></A> package.<p>
116
117 Plugins can also send their own messages - any object can send a message to
118 the EditBus by calling the static method <A HREF="../../../../org/gjt/sp/jedit/EditBus.html#send(org.gjt.sp.jedit.EBMessage)"><CODE>send(EBMessage)</CODE></A>.
119 Most plugins, however, only concern themselves with receiving, not
120 sending, messages.
121<P>
122
123<P>
124<DL>
125<DT><B>Since:</B></DT>
126  <DD>jEdit 2.2pre6</DD>
127<DT><B>See Also:</B><DD><A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit"><CODE>EBComponent</CODE></A>, 
128<A HREF="../../../../org/gjt/sp/jedit/EBMessage.html" title="class in org.gjt.sp.jedit"><CODE>EBMessage</CODE></A></DL>
129<HR>
130
131<P>
132
133<!-- ========== METHOD SUMMARY =========== -->
134
135<A NAME="method_summary"><!-- --></A>
136<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
137<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
138<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
139<B>Method Summary</B></FONT></TH>
140</TR>
141<TR BGCOLOR="white" CLASS="TableRowColor">
142<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
143<CODE>static&nbsp;void</CODE></FONT></TD>
144<TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditBus.html#addToBus(org.gjt.sp.jedit.EBComponent)">addToBus</A></B>(<A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A>&nbsp;comp)</CODE>
145
146<BR>
147&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a component to the bus.</TD>
148</TR>
149<TR BGCOLOR="white" CLASS="TableRowColor">
150<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
151<CODE>static&nbsp;<A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A>[]</CODE></FONT></TD>
152<TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditBus.html#getComponents()">getComponents</A></B>()</CODE>
153
154<BR>
155&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an array of all components connected to the bus.</TD>
156</TR>
157<TR BGCOLOR="white" CLASS="TableRowColor">
158<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
159<CODE>static&nbsp;void</CODE></FONT></TD>
160<TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditBus.html#removeFromBus(org.gjt.sp.jedit.EBComponent)">removeFromBus</A></B>(<A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A>&nbsp;comp)</CODE>
161
162<BR>
163&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a component from the bus.</TD>
164</TR>
165<TR BGCOLOR="white" CLASS="TableRowColor">
166<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
167<CODE>static&nbsp;void</CODE></FONT></TD>
168<TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditBus.html#send(org.gjt.sp.jedit.EBMessage)">send</A></B>(<A HREF="../../../../org/gjt/sp/jedit/EBMessage.html" title="class in org.gjt.sp.jedit">EBMessage</A>&nbsp;message)</CODE>
169
170<BR>
171&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sends a message to all components on the bus in turn.</TD>
172</TR>
173</TABLE>
174&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
175<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
176<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
177<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
178</TR>
179<TR BGCOLOR="white" CLASS="TableRowColor">
180<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
181</TR>
182</TABLE>
183&nbsp;
184<P>
185
186<!-- ============ METHOD DETAIL ========== -->
187
188<A NAME="method_detail"><!-- --></A>
189<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
190<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
191<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
192<B>Method Detail</B></FONT></TH>
193</TR>
194</TABLE>
195
196<A NAME="addToBus(org.gjt.sp.jedit.EBComponent)"><!-- --></A><H3>
197addToBus</H3>
198<PRE>
199public static void <B>addToBus</B>(<A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A>&nbsp;comp)</PRE>
200<DL>
201<DD>Adds a component to the bus. It will receive all messages sent
202 on the bus.
203<P>
204<DD><DL>
205<DT><B>Parameters:</B><DD><CODE>comp</CODE> - The component to add</DL>
206</DD>
207</DL>
208<HR>
209
210<A NAME="removeFromBus(org.gjt.sp.jedit.EBComponent)"><!-- --></A><H3>
211removeFromBus</H3>
212<PRE>
213public static void <B>removeFromBus</B>(<A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A>&nbsp;comp)</PRE>
214<DL>
215<DD>Removes a component from the bus.
216<P>
217<DD><DL>
218<DT><B>Parameters:</B><DD><CODE>comp</CODE> - The component to remove</DL>
219</DD>
220</DL>
221<HR>
222
223<A NAME="getComponents()"><!-- --></A><H3>
224getComponents</H3>
225<PRE>
226public static <A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A>[] <B>getComponents</B>()</PRE>
227<DL>
228<DD>Returns an array of all components connected to the bus.
229<P>
230<DD><DL>
231</DL>
232</DD>
233</DL>
234<HR>
235
236<A NAME="send(org.gjt.sp.jedit.EBMessage)"><!-- --></A><H3>
237send</H3>
238<PRE>
239public static void <B>send</B>(<A HREF="../../../../org/gjt/sp/jedit/EBMessage.html" title="class in org.gjt.sp.jedit">EBMessage</A>&nbsp;message)</PRE>
240<DL>
241<DD>Sends a message to all components on the bus in turn.
242<P>
243<DD><DL>
244<DT><B>Parameters:</B><DD><CODE>message</CODE> - The message</DL>
245</DD>
246</DL>
247<!-- ========= END OF CLASS DATA ========= -->
248<HR>
249
250
251<!-- ======= START OF BOTTOM NAVBAR ====== -->
252<A NAME="navbar_bottom"><!-- --></A>
253<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
254<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
255<TR>
256<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
257<A NAME="navbar_bottom_firstrow"><!-- --></A>
258<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
259  <TR ALIGN="center" VALIGN="top">
260  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
261  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
262  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
263  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/EditBus.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
264  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
265  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
266  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
267  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
268  </TR>
269</TABLE>
270</TD>
271<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
272</EM>
273</TD>
274</TR>
275
276<TR>
277<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
278&nbsp;<A HREF="../../../../org/gjt/sp/jedit/EditAction.Wrapper.html" title="class in org.gjt.sp.jedit"><B>PREV CLASS</B></A>&nbsp;
279&nbsp;<A HREF="../../../../org/gjt/sp/jedit/EditPane.html" title="class in org.gjt.sp.jedit"><B>NEXT CLASS</B></A></FONT></TD>
280<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
281  <A HREF="../../../../index.html?org/gjt/sp/jedit/EditBus.html" target="_top"><B>FRAMES</B></A>  &nbsp;
282&nbsp;<A HREF="EditBus.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
283&nbsp;
284<NOSCRIPT>
285  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
286</NOSCRIPT>
287
288
289</FONT></TD>
290</TR>
291<TR>
292<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
293  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
294<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
295DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
296</TR>
297</TABLE>
298<A NAME="skip-navbar_bottom"></A>
299<!-- ======== END OF BOTTOM NAVBAR ======= -->
300
301<HR>
302
303</BODY>
304</HTML>