001: /*
002: * DockableWindowUpdate.java - Dockable window update message
003: * :tabSize=8:indentSize=8:noTabs=false:
004: * :folding=explicit:collapseFolds=1:
005: *
006: * Copyright (C) 2003 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.gui.DockableWindowManager;
026: import org.gjt.sp.jedit.*;
027:
028: /**
029: * Message sent when dockable window state changes.
030: * @author Slava Pestov
031: * @version $Id: DockableWindowUpdate.java 5004 2004-03-28 00:07:27Z spestov $
032: *
033: * @since jEdit 4.2pre1
034: */
035: public class DockableWindowUpdate extends EBMessage {
036: //{{{ Message types
037: /**
038: * Properties changed. Fired instead of global
039: * <code>PropertiesChanged</code> for improved performance.
040: * @since jEdit 4.2pre1
041: */
042: public static final Object PROPERTIES_CHANGED = "PROPERTIES_CHANGED";
043:
044: /**
045: * Dockable activated. This is sent when the dockable is made visible.
046: * @since jEdit 4.2pre1
047: */
048: public static final Object ACTIVATED = "ACTIVATED";
049:
050: /**
051: * Dockable deactivated. This is sent when the dockable is hidden.
052: * @since jEdit 4.2pre1
053: */
054: public static final Object DEACTIVATED = "DEACTIVATED";
055:
056: //}}}
057:
058: //{{{ DockableWindowUpdate constructor
059: /**
060: * Creates a new dockable window update message.
061: * @param wm The dockable window manager
062: * @param what What happened
063: * @param dockable The dockable window in question
064: */
065: public DockableWindowUpdate(DockableWindowManager wm, Object what,
066: String dockable) {
067: super (wm);
068:
069: if (what == null)
070: throw new NullPointerException("What must be non-null");
071:
072: this .what = what;
073: this .dockable = dockable;
074: } //}}}
075:
076: //{{{ getWhat() method
077: /**
078: * Returns what caused this dockable update.
079: */
080: public Object getWhat() {
081: return what;
082: } //}}}
083:
084: //{{{ getDockable() method
085: /**
086: * Returns the dockable in question, or null if the message type is
087: * <code>PROPERTIES_CHANGED</code>.
088: */
089: public String getDockable() {
090: return dockable;
091: } //}}}
092:
093: //{{{ paramString() method
094: public String paramString() {
095: return "what=" + what + ",dockable=" + dockable + ","
096: + super .paramString();
097: } //}}}
098:
099: //{{{ Private members
100: private Object what;
101: private String dockable;
102: //}}}
103: }
|