PageRenderTime 152ms CodeModel.GetById 130ms app.highlight 4ms RepoModel.GetById 16ms app.codeStats 1ms

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