PageRenderTime 159ms CodeModel.GetById 150ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

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