KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * BufferUpdate.java - Buffer update message
3  * :tabSize=8:indentSize=8:noTabs=false:
4  * :folding=explicit:collapseFolds=1:
5  *
6  * Copyright (C) 1999, 2001 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
23 package org.gjt.sp.jedit.msg;
24
25 import org.gjt.sp.jedit.*;
26
27 /**
28  * Message sent when a buffer-related change occurs.
29  * @author Slava Pestov
30  * @version $Id: BufferUpdate.java 5320 2005-12-27 19:24:10Z ezust $
31  *
32  * @since jEdit 2.2pre6
33  */

34 public class BufferUpdate extends EBMessage
35 {
36     //{{{ Message types
37
/**
38      * Buffer created.
39      */

40     public static final Object JavaDoc CREATED = "CREATED";
41     
42     /**
43      * About to be closed
44      * @since jEdit 4.2pre3
45      */

46     public static final Object JavaDoc CLOSING = "CLOSING";
47     /**
48      * Buffer load started.
49      * @since jEdit 2.6pre1
50      */

51     public static final Object JavaDoc LOAD_STARTED = "LOAD_STARTED";
52
53     /**
54      * Buffer loaded.
55      */

56     public static final Object JavaDoc LOADED = "LOADED";
57
58     /**
59      * Buffer closed.
60      */

61     public static final Object JavaDoc CLOSED = "CLOSED";
62
63     /**
64      * Buffer dirty changed.
65      */

66     public static final Object JavaDoc DIRTY_CHANGED = "DIRTY_CHANGED";
67
68     /**
69      * Buffer markers changed.
70      */

71     public static final Object JavaDoc MARKERS_CHANGED = "MARKERS_CHANGED";
72
73     /**
74      * Buffer saving.
75      */

76     public static final Object JavaDoc SAVING = "SAVING";
77
78     /**
79      * Buffer saved.
80      * @since jEdit 4.0pre4
81      */

82     public static final Object JavaDoc SAVED = "SAVED";
83
84     /**
85      * Properties changed.
86      * @since jEdit 4.1pre1
87      */

88     public static final Object JavaDoc PROPERTIES_CHANGED = "PROPERTIES_CHANGED";
89     //}}}
90

91     //{{{ BufferUpdate constructor
92
/**
93      * Creates a new buffer update message.
94      * @param buffer The buffer
95      * @param what What happened
96      */

97     public BufferUpdate(Buffer buffer, View view, Object JavaDoc what)
98     {
99         super(buffer);
100
101         this.view = view;
102
103         if(what == null)
104             throw new NullPointerException JavaDoc("What must be non-null");
105
106         this.what = what;
107     } //}}}
108

109     //{{{ getWhat() method
110
/**
111      * Returns what caused this buffer update.
112      */

113     public Object JavaDoc getWhat()
114     {
115         return what;
116     } //}}}
117

118     //{{{ getBuffer() method
119
/**
120      * Returns the buffer involved.
121      */

122     public Buffer getBuffer()
123     {
124         return (Buffer)getSource();
125     } //}}}
126

127     //{{{ getView() method
128
/**
129      * Returns the view involved, which may be null.
130      */

131     public View getView()
132     {
133         return view;
134     } //}}}
135

136     //{{{ paramString() method
137
public String JavaDoc paramString()
138     {
139         return "what=" + what + ",view=" + view + ","
140             + super.paramString();
141     } //}}}
142

143     //{{{ Private members
144
private Object JavaDoc what;
145     private View view;
146     //}}}
147
}
148
Popular Tags