01: /*
02: * ViewUpdate.java - View update message
03: * :tabSize=8:indentSize=8:noTabs=false:
04: * :folding=explicit:collapseFolds=1:
05: *
06: * Copyright (C) 1999, 2000, 2001, 2002 Slava Pestov
07: *
08: * This program is free software; you can redistribute it and/or
09: * 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:
23: package org.gjt.sp.jedit.msg;
24:
25: import org.gjt.sp.jedit.*;
26:
27: /**
28: * Message sent when a view-related change occurs.
29: * @author Slava Pestov
30: * @version $Id: ViewUpdate.java 5367 2006-04-09 04:02:21Z vanza $
31: *
32: * @since jEdit 2.2pre6
33: */
34: public class ViewUpdate extends EBMessage {
35: /**
36: * View created.
37: */
38: public static final Object CREATED = "CREATED";
39:
40: /**
41: * View closed.
42: */
43: public static final Object CLOSED = "CLOSED";
44:
45: /**
46: * Active edit pane changed.
47: * @since jEdit 4.1pre1
48: */
49: public static final Object EDIT_PANE_CHANGED = "EDIT_PANE_CHANGED";
50:
51: /**
52: * Active view changed.
53: * @since jEdit 4.3pre4
54: */
55: public static final Object ACTIVATED = "VIEW_ACTIVATED";
56:
57: //{{{ ViewUpdate constructor
58: /**
59: * Creates a new view update message.
60: * @param view The view
61: * @param what What happened
62: */
63: public ViewUpdate(View view, Object what) {
64: super (view);
65:
66: if (what == null)
67: throw new NullPointerException("What must be non-null");
68:
69: this .what = what;
70: } //}}}
71:
72: //{{{ getWhat() method
73: /**
74: * Returns what caused this view update.
75: */
76: public Object getWhat() {
77: return what;
78: } //}}}
79:
80: //{{{ getView() method
81: /**
82: * Returns the view involved.
83: */
84: public View getView() {
85: return (View) getSource();
86: } //}}}
87:
88: //{{{ paramString() method
89: public String paramString() {
90: return "what=" + what + "," + super .paramString();
91: } //}}}
92:
93: //{{{ Private members
94: private Object what;
95: //}}}
96: }
|