PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/EBPlugin.java

#
Java | 58 lines | 17 code | 5 blank | 36 comment | 1 complexity | 20f3e5ee18a98320e089e0215160feee 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
  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. package org.gjt.sp.jedit;
  20. import org.gjt.sp.util.Log;
  21. /**
  22. * Plugins extending this class are automatically added to the EditBus.
  23. * Otherwise, this class is identical to the {@link EditPlugin}
  24. * class.
  25. *
  26. * @see org.gjt.sp.jedit.EditBus
  27. * @see org.gjt.sp.jedit.EBComponent
  28. * @see org.gjt.sp.jedit.EBMessage
  29. *
  30. * @author Slava Pestov
  31. * @version $Id: EBPlugin.java 12504 2008-04-22 23:12:43Z ezust $
  32. */
  33. public abstract class EBPlugin extends EditPlugin implements EBComponent
  34. {
  35. /**
  36. * Handles a message sent on the EditBus.
  37. */
  38. // next version: remove this
  39. public void handleMessage(EBMessage message)
  40. {
  41. EditBus.removeFromBus(this);
  42. if(seenWarning)
  43. return;
  44. seenWarning = true;
  45. Log.log(Log.WARNING,this,getClassName() + " should extend"
  46. + " EditPlugin not EBPlugin since it has an empty"
  47. + " handleMessage()");
  48. }
  49. // protected members
  50. protected EBPlugin() {}
  51. // private members
  52. private boolean seenWarning;
  53. }