PageRenderTime 42ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 101 lines | 29 code | 13 blank | 59 comment | 2 complexity | b25e375500f5947a66a84f3b534f40d2 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 5367 2006-04-09 04:02:21Z vanza $
  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. /**
  47. * Active view changed.
  48. * @since jEdit 4.3pre4
  49. */
  50. public static final Object ACTIVATED = "VIEW_ACTIVATED";
  51. //{{{ ViewUpdate constructor
  52. /**
  53. * Creates a new view update message.
  54. * @param view The view
  55. * @param what What happened
  56. */
  57. public ViewUpdate(View view, Object what)
  58. {
  59. super(view);
  60. if(what == null)
  61. throw new NullPointerException("What must be non-null");
  62. this.what = what;
  63. } //}}}
  64. //{{{ getWhat() method
  65. /**
  66. * Returns what caused this view update.
  67. */
  68. public Object getWhat()
  69. {
  70. return what;
  71. } //}}}
  72. //{{{ getView() method
  73. /**
  74. * Returns the view involved.
  75. */
  76. public View getView()
  77. {
  78. return (View)getSource();
  79. } //}}}
  80. //{{{ paramString() method
  81. public String paramString()
  82. {
  83. return "what=" + what + "," + super.paramString();
  84. } //}}}
  85. //{{{ Private members
  86. private Object what;
  87. //}}}
  88. }