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

/jEdit/tags/jedit-4-0-pre3/org/gjt/sp/jedit/msg/ViewUpdate.java

#
Java | 82 lines | 28 code | 11 blank | 43 comment | 2 complexity | 38bbc4b0b754487fe503ef50360c1127 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. * ViewUpdate.java - View update message
  3. * Copyright (C) 1999, 2000 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.msg;
  20. import org.gjt.sp.jedit.textarea.JEditTextArea;
  21. import org.gjt.sp.jedit.*;
  22. /**
  23. * Message sent when a view-related change occurs.
  24. * @author Slava Pestov
  25. * @version $Id: ViewUpdate.java 3791 2001-09-02 05:36:59Z spestov $
  26. *
  27. * @since jEdit 2.2pre6
  28. */
  29. public class ViewUpdate extends EBMessage.NonVetoable
  30. {
  31. /**
  32. * View created.
  33. */
  34. public static final Object CREATED = "CREATED";
  35. /**
  36. * View closed.
  37. */
  38. public static final Object CLOSED = "CLOSED";
  39. /**
  40. * Creates a new view update message.
  41. * @param view The view
  42. * @param what What happened
  43. */
  44. public ViewUpdate(View view, Object what)
  45. {
  46. super(view);
  47. if(what == null)
  48. throw new NullPointerException("What must be non-null");
  49. this.what = what;
  50. }
  51. /**
  52. * Returns what caused this view update.
  53. */
  54. public Object getWhat()
  55. {
  56. return what;
  57. }
  58. /**
  59. * Returns the view involved.
  60. */
  61. public View getView()
  62. {
  63. return (View)getSource();
  64. }
  65. public String paramString()
  66. {
  67. return super.paramString() + ",what=" + what;
  68. }
  69. // private members
  70. private Object what;
  71. }