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