01: /*
02: * EditPaneUpdate.java - Edit pane update message
03: * Copyright (C) 1999, 2000 Slava Pestov
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License
07: * as published by the Free Software Foundation; either version 2
08: * of the License, or any later version.
09: *
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:
20: package org.gjt.sp.jedit.msg;
21:
22: import 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 10801 2007-10-04 09:13:00Z kpouer $
28: *
29: * @since jEdit 2.5pre1
30: */
31: public class EditPaneUpdate extends EBMessage {
32: /**
33: * Edit pane created.
34: */
35: public static final Object CREATED = "CREATED";
36:
37: /**
38: * Edit pane destroyed.
39: */
40: public static final Object DESTROYED = "DESTROYED";
41:
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: /**
49: * Edit pane buffer is about to change. You should see this before BUFFER_CHANGED.
50: * Navigator uses this message to save the cursor position in its history.
51: * Note: this could be an instance of BufferChanging class,
52: * which also contains information about the new buffer that is about to be opened.
53: * @since 4.3pre3
54: */
55: public static final Object BUFFER_CHANGING = "BUFFER_CHANGING";
56:
57: /**
58: * Creates a new edit pane update message.
59: * @param editPane The edit pane
60: * @param what What happened
61: */
62: public EditPaneUpdate(EditPane editPane, Object what) {
63: super (editPane);
64: if (what == null)
65: throw new NullPointerException("What must be non-null");
66:
67: this .what = what;
68: }
69:
70: /**
71: * Returns what caused this edit pane update.
72: */
73: public Object getWhat() {
74: return what;
75: }
76:
77: /**
78: * Returns the edit pane involved.
79: */
80: public EditPane getEditPane() {
81: return (EditPane) getSource();
82: }
83:
84: public String paramString() {
85: return "what=" + what + "," + super .paramString();
86: }
87:
88: // private members
89: private Object what;
90:
91: }
|