/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
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <!--NewPage-->
- <HTML>
- <HEAD>
- <!-- Generated by javadoc (build 1.5.0_14) on Tue Jul 22 07:13:44 GMT-08:00 2008 -->
- <TITLE>
- EditBus (jEdit API)
- </TITLE>
- <META NAME="keywords" CONTENT="org.gjt.sp.jedit.EditBus class">
- <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
- <NOSCRIPT>
- </NOSCRIPT>
- </HEAD>
- <BODY BGCOLOR="white" >
- <!-- ========= START OF TOP NAVBAR ======= -->
- <A NAME="navbar_top"><!-- --></A>
- <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_top_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EditBus.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/gjt/sp/jedit/EditAction.Wrapper.html" title="class in org.gjt.sp.jedit"><B>PREV CLASS</B></A>
- <A HREF="../../../../org/gjt/sp/jedit/EditPane.html" title="class in org.gjt.sp.jedit"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/gjt/sp/jedit/EditBus.html" target="_top"><B>FRAMES</B></A>
- <A HREF="EditBus.html" target="_top"><B>NO FRAMES</B></A>
-
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_top"></A>
- <!-- ========= END OF TOP NAVBAR ========= -->
- <HR>
- <!-- ======== START OF CLASS DATA ======== -->
- <H2>
- <FONT SIZE="-1">
- org.gjt.sp.jedit</FONT>
- <BR>
- Class EditBus</H2>
- <PRE>
- java.lang.Object
- <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.jedit.EditBus</B>
- </PRE>
- <HR>
- <DL>
- <DT><PRE>public class <B>EditBus</B><DT>extends java.lang.Object</DL>
- </PRE>
- <P>
- jEdit's global event notification mechanism.<p>
- Plugins register with the EditBus to receive messages reflecting
- changes in the application's state, including changes in buffers,
- views and edit panes, changes in the set of properties maintained
- by the application, and the closing of the application.<p>
- The EditBus maintains a list of objects that have requested to receive
- messages. When a message is sent using this class, all registered
- components receive it in turn. Classes for objects that subscribe to
- 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
- 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>
- A plugin core class that extends the
- <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
- <code>Plugin</code> for identification purposes) will automatically be
- added to the EditBus during jEdit's startup routine. Any other
- class - for example, a dockable window that needs to receive
- notification of buffer changes - must perform its own registration by calling
- <A HREF="../../../../org/gjt/sp/jedit/EditBus.html#addToBus(org.gjt.sp.jedit.EBComponent)"><CODE>addToBus(EBComponent)</CODE></A> during its initialization.
- A convenient place to register in a class derived from <code>JComponent</code>
- would be in an implementation of the <code>JComponent</code> method
- <code>addNotify()</code>.<p>
- Message types sent by jEdit can be found in the
- <A HREF="../../../../org/gjt/sp/jedit/msg/package-summary.html"><CODE>org.gjt.sp.jedit.msg</CODE></A> package.<p>
- Plugins can also send their own messages - any object can send a message to
- 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>.
- Most plugins, however, only concern themselves with receiving, not
- sending, messages.
- <P>
- <P>
- <DL>
- <DT><B>Since:</B></DT>
- <DD>jEdit 2.2pre6</DD>
- <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>,
- <A HREF="../../../../org/gjt/sp/jedit/EBMessage.html" title="class in org.gjt.sp.jedit"><CODE>EBMessage</CODE></A></DL>
- <HR>
- <P>
- <!-- ========== METHOD SUMMARY =========== -->
- <A NAME="method_summary"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
- <B>Method Summary</B></FONT></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <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> comp)</CODE>
- <BR>
- Adds a component to the bus.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static <A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A>[]</CODE></FONT></TD>
- <TD><CODE><B><A HREF="../../../../org/gjt/sp/jedit/EditBus.html#getComponents()">getComponents</A></B>()</CODE>
- <BR>
- Returns an array of all components connected to the bus.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <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> comp)</CODE>
- <BR>
- Removes a component from the bus.</TD>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
- <CODE>static void</CODE></FONT></TD>
- <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> message)</CODE>
- <BR>
- Sends a message to all components on the bus in turn.</TD>
- </TR>
- </TABLE>
- <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
- <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
- </TR>
- <TR BGCOLOR="white" CLASS="TableRowColor">
- <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
- </TR>
- </TABLE>
-
- <P>
- <!-- ============ METHOD DETAIL ========== -->
- <A NAME="method_detail"><!-- --></A>
- <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
- <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
- <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
- <B>Method Detail</B></FONT></TH>
- </TR>
- </TABLE>
- <A NAME="addToBus(org.gjt.sp.jedit.EBComponent)"><!-- --></A><H3>
- addToBus</H3>
- <PRE>
- public static void <B>addToBus</B>(<A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A> comp)</PRE>
- <DL>
- <DD>Adds a component to the bus. It will receive all messages sent
- on the bus.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>comp</CODE> - The component to add</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="removeFromBus(org.gjt.sp.jedit.EBComponent)"><!-- --></A><H3>
- removeFromBus</H3>
- <PRE>
- public static void <B>removeFromBus</B>(<A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A> comp)</PRE>
- <DL>
- <DD>Removes a component from the bus.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>comp</CODE> - The component to remove</DL>
- </DD>
- </DL>
- <HR>
- <A NAME="getComponents()"><!-- --></A><H3>
- getComponents</H3>
- <PRE>
- public static <A HREF="../../../../org/gjt/sp/jedit/EBComponent.html" title="interface in org.gjt.sp.jedit">EBComponent</A>[] <B>getComponents</B>()</PRE>
- <DL>
- <DD>Returns an array of all components connected to the bus.
- <P>
- <DD><DL>
- </DL>
- </DD>
- </DL>
- <HR>
- <A NAME="send(org.gjt.sp.jedit.EBMessage)"><!-- --></A><H3>
- send</H3>
- <PRE>
- public static void <B>send</B>(<A HREF="../../../../org/gjt/sp/jedit/EBMessage.html" title="class in org.gjt.sp.jedit">EBMessage</A> message)</PRE>
- <DL>
- <DD>Sends a message to all components on the bus in turn.
- <P>
- <DD><DL>
- <DT><B>Parameters:</B><DD><CODE>message</CODE> - The message</DL>
- </DD>
- </DL>
- <!-- ========= END OF CLASS DATA ========= -->
- <HR>
- <!-- ======= START OF BOTTOM NAVBAR ====== -->
- <A NAME="navbar_bottom"><!-- --></A>
- <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
- <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
- <TR>
- <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
- <A NAME="navbar_bottom_firstrow"><!-- --></A>
- <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
- <TR ALIGN="center" VALIGN="top">
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
- <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/EditBus.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
- <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
- </TR>
- </TABLE>
- </TD>
- <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
- </EM>
- </TD>
- </TR>
- <TR>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../org/gjt/sp/jedit/EditAction.Wrapper.html" title="class in org.gjt.sp.jedit"><B>PREV CLASS</B></A>
- <A HREF="../../../../org/gjt/sp/jedit/EditPane.html" title="class in org.gjt.sp.jedit"><B>NEXT CLASS</B></A></FONT></TD>
- <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
- <A HREF="../../../../index.html?org/gjt/sp/jedit/EditBus.html" target="_top"><B>FRAMES</B></A>
- <A HREF="EditBus.html" target="_top"><B>NO FRAMES</B></A>
-
- <NOSCRIPT>
- <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
- </NOSCRIPT>
- </FONT></TD>
- </TR>
- <TR>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
- <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
- DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
- </TR>
- </TABLE>
- <A NAME="skip-navbar_bottom"></A>
- <!-- ======== END OF BOTTOM NAVBAR ======= -->
- <HR>
- </BODY>
- </HTML>