01: /*
02: * EBComponent.java - An EditBus component
03: * Copyright (C) 1999 Slava Pestov
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License
07: * as published by the Free Software Foundation; either version 2
08: * of the License, or any later version.
09: *
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 10799 2007-10-04 09:08:34Z kpouer $
31: *
32: * @since jEdit 2.2pre6
33: */
34: public interface EBComponent {
35: /**
36: * Handles a message sent on the EditBus.
37: *
38: * This method must specify the type of responses the plugin will have
39: * for various subclasses of the {@link EBMessage} class. Typically
40: * this is done with one or more <code>if</code> blocks that test
41: * whether the message is an instance of a derived message class in
42: * which the component has an interest. For example:
43: *
44: * <pre> if(msg instanceof BufferUpdate) {
45: * // a buffer's state has changed!
46: * }
47: * else if(msg instanceof ViewUpdate) {
48: * // a view's state has changed!
49: * }
50: * // ... and so on</pre>
51: *
52: * @param message The message
53: */
54: void handleMessage(EBMessage message);
55: }
|