KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * EBPlugin.java - An EditBus plugin
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 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 EBComponent
37 {
38     /**
39      * Handles a message sent on the EditBus.
40      */

41     // next version: remove this
42
public void handleMessage(EBMessage message)
43     {
44         EditBus.removeFromBus(this);
45         if(seenWarning)
46             return;
47         seenWarning = true;
48         Log.log(Log.WARNING,this,getClassName() + " should extend"
49             + " EditPlugin not EBPlugin since it has an empty"
50             + " handleMessage()");
51     }
52
53     // protected members
54
protected EBPlugin() {}
55
56     // private members
57
private boolean seenWarning;
58 }
59
Popular Tags