PageRenderTime 38ms CodeModel.GetById 33ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-3-pre5/org/gjt/sp/jedit/msg/ViewUpdate.java

#
Java | 101 lines | 29 code | 13 blank | 59 comment | 2 complexity | b25e375500f5947a66a84f3b534f40d2 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 5367 2006-04-09 04:02:21Z vanza $
 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	/**
 53	 * Active view changed.
 54	 * @since jEdit 4.3pre4
 55	 */
 56	public static final Object ACTIVATED = "VIEW_ACTIVATED";
 57
 58	//{{{ ViewUpdate constructor
 59	/**
 60	 * Creates a new view update message.
 61	 * @param view The view
 62	 * @param what What happened
 63	 */
 64	public ViewUpdate(View view, Object what)
 65	{
 66		super(view);
 67
 68		if(what == null)
 69			throw new NullPointerException("What must be non-null");
 70
 71		this.what = what;
 72	} //}}}
 73
 74	//{{{ getWhat() method
 75	/**
 76	 * Returns what caused this view update.
 77	 */
 78	public Object getWhat()
 79	{
 80		return what;
 81	} //}}}
 82
 83	//{{{ getView() method
 84	/**
 85	 * Returns the view involved.
 86	 */
 87	public View getView()
 88	{
 89		return (View)getSource();
 90	} //}}}
 91
 92	//{{{ paramString() method
 93	public String paramString()
 94	{
 95		return "what=" + what + "," + super.paramString();
 96	} //}}}
 97
 98	//{{{ Private members
 99	private Object what;
100	//}}}
101}