001: /*
002: * BufferUpdate.java - Buffer update message
003: * :tabSize=8:indentSize=8:noTabs=false:
004: * :folding=explicit:collapseFolds=1:
005: *
006: * Copyright (C) 1999, 2001 Slava Pestov
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
021: */
022:
023: package org.gjt.sp.jedit.msg;
024:
025: import org.gjt.sp.jedit.*;
026:
027: /**
028: * Message sent when a buffer-related change occurs.
029: * @author Slava Pestov
030: * @version $Id: BufferUpdate.java 5320 2005-12-27 19:24:10Z ezust $
031: *
032: * @since jEdit 2.2pre6
033: */
034: public class BufferUpdate extends EBMessage {
035: //{{{ Message types
036: /**
037: * Buffer created.
038: */
039: public static final Object CREATED = "CREATED";
040:
041: /**
042: * About to be closed
043: * @since jEdit 4.2pre3
044: */
045: public static final Object CLOSING = "CLOSING";
046: /**
047: * Buffer load started.
048: * @since jEdit 2.6pre1
049: */
050: public static final Object LOAD_STARTED = "LOAD_STARTED";
051:
052: /**
053: * Buffer loaded.
054: */
055: public static final Object LOADED = "LOADED";
056:
057: /**
058: * Buffer closed.
059: */
060: public static final Object CLOSED = "CLOSED";
061:
062: /**
063: * Buffer dirty changed.
064: */
065: public static final Object DIRTY_CHANGED = "DIRTY_CHANGED";
066:
067: /**
068: * Buffer markers changed.
069: */
070: public static final Object MARKERS_CHANGED = "MARKERS_CHANGED";
071:
072: /**
073: * Buffer saving.
074: */
075: public static final Object SAVING = "SAVING";
076:
077: /**
078: * Buffer saved.
079: * @since jEdit 4.0pre4
080: */
081: public static final Object SAVED = "SAVED";
082:
083: /**
084: * Properties changed.
085: * @since jEdit 4.1pre1
086: */
087: public static final Object PROPERTIES_CHANGED = "PROPERTIES_CHANGED";
088:
089: //}}}
090:
091: //{{{ BufferUpdate constructor
092: /**
093: * Creates a new buffer update message.
094: * @param buffer The buffer
095: * @param what What happened
096: */
097: public BufferUpdate(Buffer buffer, View view, Object what) {
098: super (buffer);
099:
100: this .view = view;
101:
102: if (what == null)
103: throw new NullPointerException("What must be non-null");
104:
105: this .what = what;
106: } //}}}
107:
108: //{{{ getWhat() method
109: /**
110: * Returns what caused this buffer update.
111: */
112: public Object getWhat() {
113: return what;
114: } //}}}
115:
116: //{{{ getBuffer() method
117: /**
118: * Returns the buffer involved.
119: */
120: public Buffer getBuffer() {
121: return (Buffer) getSource();
122: } //}}}
123:
124: //{{{ getView() method
125: /**
126: * Returns the view involved, which may be null.
127: */
128: public View getView() {
129: return view;
130: } //}}}
131:
132: //{{{ paramString() method
133: public String paramString() {
134: return "what=" + what + ",view=" + view + ","
135: + super .paramString();
136: } //}}}
137:
138: //{{{ Private members
139: private Object what;
140: private View view;
141: //}}}
142: }
|