/jEdit/tags/jedit-4-1-pre5/org/gjt/sp/jedit/msg/ViewUpdate.java

# · Java · 96 lines · 29 code · 12 blank · 55 comment · 2 complexity · e86ff48e49abc054b70997264878284f MD5 · raw file

  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.textarea.JEditTextArea;
  24. import org.gjt.sp.jedit.*;
  25. /**
  26. * Message sent when a view-related change occurs.
  27. * @author Slava Pestov
  28. * @version $Id: ViewUpdate.java 4152 2002-05-14 07:55:49Z spestov $
  29. *
  30. * @since jEdit 2.2pre6
  31. */
  32. public class ViewUpdate extends EBMessage
  33. {
  34. /**
  35. * View created.
  36. */
  37. public static final Object CREATED = "CREATED";
  38. /**
  39. * View closed.
  40. */
  41. public static final Object CLOSED = "CLOSED";
  42. /**
  43. * Active edit pane changed.
  44. * @since jEdit 4.1pre1
  45. */
  46. public static final Object EDIT_PANE_CHANGED = "EDIT_PANE_CHANGED";
  47. //{{{ ViewUpdate constructor
  48. /**
  49. * Creates a new view update message.
  50. * @param view The view
  51. * @param what What happened
  52. */
  53. public ViewUpdate(View view, Object what)
  54. {
  55. super(view);
  56. if(what == null)
  57. throw new NullPointerException("What must be non-null");
  58. this.what = what;
  59. } //}}}
  60. //{{{ getWhat() method
  61. /**
  62. * Returns what caused this view update.
  63. */
  64. public Object getWhat()
  65. {
  66. return what;
  67. } //}}}
  68. //{{{ getView() method
  69. /**
  70. * Returns the view involved.
  71. */
  72. public View getView()
  73. {
  74. return (View)getSource();
  75. } //}}}
  76. //{{{ paramString() method
  77. public String paramString()
  78. {
  79. return "what=" + what + "," + super.paramString();
  80. } //}}}
  81. //{{{ Private members
  82. private Object what;
  83. //}}}
  84. }