PageRenderTime 87ms CodeModel.GetById 82ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre3/org/gjt/sp/jedit/msg/ViewUpdate.java

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