KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > sp > jedit > EBComponent


1 /*
2  * EBComponent.java - An EditBus component
3  * Copyright (C) 1999 Slava Pestov
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */

19
20 package org.gjt.sp.jedit;
21
22 /**
23  * A component on the EditBus. Every plugin class that uses the EditBus for
24  * receiving messages must implement this interface.
25  *
26  * @see org.gjt.sp.jedit.EBMessage
27  *
28  * @author Slava Pestov
29  * @author John Gellene (API documentation)
30  * @version $Id: EBComponent.java 4476 2003-02-11 02:55:57Z spestov $
31  *
32  * @since jEdit 2.2pre6
33  */

34 public interface EBComponent
35 {
36     /**
37      * Handles a message sent on the EditBus.
38      *
39      * This method must specify the type of responses the plugin will have
40      * for various subclasses of the {@link EBMessage} class. Typically
41      * this is done with one or more <code>if</code> blocks that test
42      * whether the message is an instance of a derived message class in
43      * which the component has an interest. For example:
44      *
45      * <pre> if(msg instanceof BufferUpdate) {
46          * // a buffer's state has changed!
47          * }
48          * else if(msg instanceof ViewUpdate) {
49          * // a view's state has changed!
50          * }
51          * // ... and so on</pre>
52      *
53      * @param message The message
54      */

55     void handleMessage(EBMessage message);
56 }
57
Popular Tags