01: /*
02: * EBPlugin.java - An EditBus plugin
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: import org.gjt.sp.util.Log;
23:
24: /**
25: * Plugins extending this class are automatically added to the EditBus.
26: * Otherwise, this class is identical to the {@link EditPlugin}
27: * class.
28: *
29: * @see org.gjt.sp.jedit.EditBus
30: * @see org.gjt.sp.jedit.EBComponent
31: * @see org.gjt.sp.jedit.EBMessage
32: *
33: * @author Slava Pestov
34: * @version $Id: EBPlugin.java 4669 2003-05-01 02:21:27Z spestov $
35: */
36: public abstract class EBPlugin extends EditPlugin implements
37: EBComponent {
38: /**
39: * Handles a message sent on the EditBus.
40: */
41: // next version: remove this
42: public void handleMessage(EBMessage message) {
43: EditBus.removeFromBus(this );
44: if (seenWarning)
45: return;
46: seenWarning = true;
47: Log.log(Log.WARNING, this , getClassName() + " should extend"
48: + " EditPlugin not EBPlugin since it has an empty"
49: + " handleMessage()");
50: }
51:
52: // protected members
53: protected EBPlugin() {
54: }
55:
56: // private members
57: private boolean seenWarning;
58: }
|