PageRenderTime 32ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/org/gjt/sp/jedit/msg/ViewUpdate.java

#
Java | 95 lines | 28 code | 12 blank | 55 comment | 2 complexity | eb2e87c3f3f1febb5216e808167f4930 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. * :tabSize=8:indentSize=8:noTabs=false:
  4. * :folding=explicit:collapseFolds=1:
  5. *
  6. * Copyright (C) 1999, 2000, 2001, 2002 Slava Pestov
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version 2
  11. * of the License, or any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. */
  22. package org.gjt.sp.jedit.msg;
  23. import org.gjt.sp.jedit.*;
  24. /**
  25. * Message sent when a view-related change occurs.
  26. * @author Slava Pestov
  27. * @version $Id: ViewUpdate.java 4428 2003-01-12 03:08:25Z spestov $
  28. *
  29. * @since jEdit 2.2pre6
  30. */
  31. public class ViewUpdate extends EBMessage
  32. {
  33. /**
  34. * View created.
  35. */
  36. public static final Object CREATED = "CREATED";
  37. /**
  38. * View closed.
  39. */
  40. public static final Object CLOSED = "CLOSED";
  41. /**
  42. * Active edit pane changed.
  43. * @since jEdit 4.1pre1
  44. */
  45. public static final Object EDIT_PANE_CHANGED = "EDIT_PANE_CHANGED";
  46. //{{{ ViewUpdate constructor
  47. /**
  48. * Creates a new view update message.
  49. * @param view The view
  50. * @param what What happened
  51. */
  52. public ViewUpdate(View view, Object what)
  53. {
  54. super(view);
  55. if(what == null)
  56. throw new NullPointerException("What must be non-null");
  57. this.what = what;
  58. } //}}}
  59. //{{{ getWhat() method
  60. /**
  61. * Returns what caused this view update.
  62. */
  63. public Object getWhat()
  64. {
  65. return what;
  66. } //}}}
  67. //{{{ getView() method
  68. /**
  69. * Returns the view involved.
  70. */
  71. public View getView()
  72. {
  73. return (View)getSource();
  74. } //}}}
  75. //{{{ paramString() method
  76. public String paramString()
  77. {
  78. return "what=" + what + "," + super.paramString();
  79. } //}}}
  80. //{{{ Private members
  81. private Object what;
  82. //}}}
  83. }