PageRenderTime 221ms CodeModel.GetById 217ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 66 lines | 23 code | 6 blank | 37 comment | 2 complexity | 59aa4445643e74f5d277a61b253ca391 MD5 | raw file
 1/*
 2 * BufferChanging.java - Buffer changing (specialized Edit Pane update message)
 3 * :tabSize=8:indentSize=8:noTabs=false:
 4 * :folding=explicit:collapseFolds=1:
 5 *
 6 * Copyright (C) 2006 Alan Ezust
 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 java.util.Arrays;
26
27import org.gjt.sp.jedit.Buffer;
28import org.gjt.sp.jedit.EditPane;
29import org.gjt.sp.util.Log;
30
31/** An EBMessage sent by the EditPane just before the buffer changes.
32 * 
33 * jEdit core emits this whenever the EditPane's buffer changes.
34 * 
35 * Known plugins to be using this: BufferLocal, Navigator.
36 * 
37 * @since jEdit 4.3pre4
38 * @version $Id: BufferChanging.java 16342 2009-10-14 10:07:18Z kpouer $
39 */
40public class BufferChanging extends PositionChanging
41{
42	/**
43	 * @param editPane the editPane that sent the message
44	 * @param newBuffer the buffer that will soon be displayed.
45	 */
46	public BufferChanging(EditPane editPane, Buffer newBuffer)
47	{
48		super(editPane, EditPaneUpdate.BUFFER_CHANGING);
49		if (newBuffer == null)
50		{
51			String s = Arrays.toString(Thread.currentThread().getStackTrace());
52			Log.log (Log.ERROR, this, "BufferChanging to null Buffer? Emit PositionChanging instead." + s);
53		}
54		m_buffer = newBuffer;
55	}
56	
57	/**
58	 * @return the new buffer that is about to be displayed
59	 */
60	public Buffer getBuffer()
61	{
62		return m_buffer;
63	}
64
65	private Buffer m_buffer;
66}