KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > sp > jedit > msg > EditPaneUpdate


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
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 5518 2006-07-03 17:24:07Z ezust $
28  *
29  * @since jEdit 2.5pre1
30  */

31 public class EditPaneUpdate extends EBMessage
32 {
33     /**
34      * Edit pane created.
35      */

36     public static final Object JavaDoc CREATED = "CREATED";
37
38     /**
39      * Edit pane destroyed.
40      */

41     public static final Object JavaDoc DESTROYED = "DESTROYED";
42
43     /**
44      * Edit pane buffer changed.
45      */

46     public static final Object JavaDoc BUFFER_CHANGED = "BUFFER_CHANGED";
47
48     /**
49      * Edit pane buffer about to change. Note: this could be an instance of BufferChanging class,
50      * which also contains information about the new buffer that is about to be opened.
51      * @since 4.3pre3
52      */

53     public static final Object JavaDoc BUFFER_CHANGING = "BUFFER_CHANGING";
54     
55     /**
56      * Creates a new edit pane update message.
57      * @param editPane The edit pane
58      * @param what What happened
59      */

60     public EditPaneUpdate(EditPane editPane, Object JavaDoc what)
61     {
62         super(editPane);
63         if(what == null)
64             throw new NullPointerException JavaDoc("What must be non-null");
65
66         this.what = what;
67     }
68
69     /**
70      * Returns what caused this edit pane update.
71      */

72     public Object JavaDoc getWhat()
73     {
74         return what;
75     }
76
77     /**
78      * Returns the edit pane involved.
79      */

80     public EditPane getEditPane()
81     {
82         return (EditPane)getSource();
83     }
84
85     public String JavaDoc paramString()
86     {
87         return "what=" + what + "," + super.paramString();
88     }
89     
90     // private members
91
private Object JavaDoc what;
92
93 }
94
Popular Tags