PageRenderTime 76ms CodeModel.GetById 71ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 87 lines | 29 code | 12 blank | 46 comment | 2 complexity | 1bdbddecdec35e6a138a3434fc228596 MD5 | raw file
 1/*
 2 * EditPaneUpdate.java - Edit pane 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 an edit pane-related change occurs.
27 * @author Slava Pestov
28 * @version $Id: EditPaneUpdate.java 3791 2001-09-02 05:36:59Z spestov $
29 *
30 * @since jEdit 2.5pre1
31 */
32public class EditPaneUpdate extends EBMessage.NonVetoable
33{
34	/**
35	 * Edit pane created.
36	 */
37	public static final Object CREATED = "CREATED";
38
39	/**
40	 * Edit pane destroyed.
41	 */
42	public static final Object DESTROYED = "DESTROYED";
43
44	/**
45	 * Edit pane buffer changed.
46	 */
47	public static final Object BUFFER_CHANGED = "BUFFER_CHANGED";
48
49	/**
50	 * Creates a new edit pane update message.
51	 * @param editPane The edit pane
52	 * @param what What happened
53	 */
54	public EditPaneUpdate(EditPane editPane, Object what)
55	{
56		super(editPane);
57
58		if(what == null)
59			throw new NullPointerException("What must be non-null");
60
61		this.what = what;
62	}
63
64	/**
65	 * Returns what caused this edit pane update.
66	 */
67	public Object getWhat()
68	{
69		return what;
70	}
71
72	/**
73	 * Returns the edit pane involved.
74	 */
75	public EditPane getEditPane()
76	{
77		return (EditPane)getSource();
78	}
79
80	public String paramString()
81	{
82		return super.paramString() + ",what=" + what;
83	}
84
85	// private members
86	private Object what;
87}