PageRenderTime 63ms CodeModel.GetById 55ms app.highlight 4ms RepoModel.GetById 3ms app.codeStats 0ms

/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/msg/EditPaneUpdate.java

#
Java | 101 lines | 31 code | 12 blank | 58 comment | 2 complexity | b8a9024ca45c017f1a990ccd4b7b0df4 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.*;
 23
 24/**
 25 * Message sent when an edit pane-related change occurs. 
 26 * @author Slava Pestov
 27 * @version $Id: EditPaneUpdate.java 14916 2009-04-12 15:49:33Z ezust $
 28 *
 29 * @since jEdit 2.5pre1
 30 */
 31public class EditPaneUpdate extends EBMessage
 32{
 33	/**
 34	 * Edit pane created.
 35	 */
 36	public static final Object CREATED = "CREATED";
 37
 38	/**
 39	 * Edit pane destroyed.
 40	 */
 41	public static final Object DESTROYED = "DESTROYED";
 42	/**
 43	 * The current buffer in the EditPane has changed to show a different buffer. This
 44	 * happens when an action results in a call to EditPane.setBuffer().
 45	 */
 46	public static final Object BUFFER_CHANGED = "BUFFER_CHANGED";
 47	/**
 48	 * Edit pane caret position is about to change in a major way
 49	 */
 50	public static final Object POSITION_CHANGING = "POSITION_CHANGING";
 51	/**
 52	 * Edit pane buffer is about to change. You should see this before BUFFER_CHANGED.
 53	 * @since 4.3pre3
 54	 */
 55	public static final Object BUFFER_CHANGING = "BUFFER_CHANGING";
 56
 57	/**
 58	 * The bufferSet scope of the EditPane was changed.
 59	 * @since 4.3pre15
 60	 */
 61	public static final Object BUFFERSET_CHANGED = "BUFFERSET_CHANGED";
 62	
 63	/**
 64	 * Creates a new edit pane update message.
 65	 * @param editPane The edit pane
 66	 * @param what What happened
 67	 */
 68	public EditPaneUpdate(EditPane editPane, Object what)
 69	{
 70		super(editPane);
 71		if(what == null)
 72			throw new NullPointerException("What must be non-null");
 73
 74		this.what = what;
 75	}
 76
 77	/**
 78	 * Returns what caused this edit pane update.
 79	 */
 80	public Object getWhat()
 81	{
 82		return what;
 83	}
 84
 85	/**
 86	 * Returns the edit pane involved.
 87	 */
 88	public EditPane getEditPane()
 89	{
 90		return (EditPane)getSource();
 91	}
 92
 93	public String paramString()
 94	{
 95		return "what=" + what + "," + super.paramString();
 96	}
 97	
 98	// private members
 99	private Object what;
100
101}