001: /*
002: * Copyright (C) 2004 NNL Technology AB
003: * Visit www.infonode.net for information about InfoNode(R)
004: * products and how to contact NNL Technology AB.
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
019: * MA 02111-1307, USA.
020: */
021:
022: // $Id: DockingWindowListener.java,v 1.19 2005/12/04 13:46:05 jesper Exp $
023: package net.infonode.docking;
024:
025: /**
026: * <p>
027: * A listener for {@link DockingWindow} events. All events are propagated upwards in the window tree, so
028: * a listener will receive events for the window that it was added to and all descendants of that window.
029: * </p>
030: *
031: * <p>
032: * Note: New methods might be added to this interface in the future. To ensure future compatibility inherit from
033: * {@link DockingWindowAdapter} instead of directly implementing this interface.
034: * </p>
035: *
036: * @author $Author: jesper $
037: * @version $Revision: 1.19 $
038: * @since IDW 1.1.0
039: */
040: public interface DockingWindowListener {
041: /**
042: * Called when a window has been added.
043: *
044: * @param addedToWindow the parent window that the window was added to
045: * @param addedWindow the window that was added
046: * @since IDW 1.3.0
047: */
048: void windowAdded(DockingWindow addedToWindow,
049: DockingWindow addedWindow);
050:
051: /**
052: * Called when a window has been removed.
053: *
054: * @param removedFromWindow the parent window that the window was removed from
055: * @param removedWindow the window that was removed
056: * @since IDW 1.3.0
057: */
058: void windowRemoved(DockingWindow removedFromWindow,
059: DockingWindow removedWindow);
060:
061: /**
062: * Called when a window is shown, for example when it is selected in a TabWindow.
063: *
064: * @param window the window that was shown
065: * @since IDW 1.3.0
066: */
067: void windowShown(DockingWindow window);
068:
069: /**
070: * Called when a window is hidden, for example when it is deselected in a TabWindow.
071: *
072: * @param window the window that was hidden
073: * @since IDW 1.3.0
074: */
075: void windowHidden(DockingWindow window);
076:
077: /**
078: * Called when the focus moves from one view to another view.
079: *
080: * @param previouslyFocusedView the view that had focus before the focus moved, null means no view had focus
081: * @param focusedView the view that got focus, null means no view got focus
082: * @since IDW 1.3.0
083: */
084: void viewFocusChanged(View previouslyFocusedView, View focusedView);
085:
086: /**
087: * <p>
088: * Called before the window that this listener is added to, or a child window of that window, is closed.
089: * </p>
090: *
091: * <p>
092: * Note that this method is only called when {@link DockingWindow#closeWithAbort()} is called explicitly, not
093: * when a window is implicitly closed as a result of another method call. Throwing an {@link OperationAbortedException}
094: * will cause the close operation to be aborted.
095: * </p>
096: *
097: * @param window the window that is closing
098: * @throws OperationAbortedException if this exception is thrown the close operation will be aborted
099: */
100: void windowClosing(DockingWindow window)
101: throws OperationAbortedException;
102:
103: /**
104: * <p>
105: * Called after the window that this listener is added to, or a child window of that window, has been closed.
106: * </p>
107: *
108: * <p>
109: * Note that this method is only called when {@link DockingWindow#close()} or {@link DockingWindow#closeWithAbort()}
110: * is called explicitly, not when a window is implicitly closed as a result of another method call.
111: * </p>
112: *
113: * @param window the window that has been closed
114: */
115: void windowClosed(DockingWindow window);
116:
117: /**
118: * <p>
119: * Called before the window that this listener is added to, or a child window of that window, is undocked.
120: * </p>
121: *
122: * <p>
123: * Note that this method is only called when {@link DockingWindow#undockWithAbort(java.awt.Point)} is called explicitly, not
124: * when a window is implicitly undocked as a result of another method call. Throwing an {@link OperationAbortedException}
125: * will cause the undock operation to be aborted.
126: * </p>
127: *
128: * @param window the window that is undocking
129: * @throws OperationAbortedException if this exception is thrown the undock operation will be aborted
130: * @since IDW 1.4.0
131: */
132: void windowUndocking(DockingWindow window)
133: throws OperationAbortedException;
134:
135: /**
136: * <p>
137: * Called after the window that this listener is added to, or a child window of that window, has been undocked.
138: * </p>
139: *
140: * <p>
141: * This method is called when a window is undocked using {@link DockingWindow#undock(java.awt.Point)},
142: * {@link DockingWindow#undockWithAbort(java.awt.Point)} or is added to a window that is undocked.
143: * </p>
144: *
145: * @param window the window that has been undocked
146: * @since IDW 1.4.0
147: */
148: void windowUndocked(DockingWindow window);
149:
150: /**
151: * <p>
152: * Called before the window that this listener is added to, or a child window of that window, is docked.
153: * </p>
154: *
155: * <p>
156: * <strong>Note:</strong> that this method is only called when {@link DockingWindow#dockWithAbort()} is called explicitly, not
157: * when a window is implicitly docked as a result of another method call. Throwing an {@link OperationAbortedException}
158: * will cause the dock operation to be aborted.
159: * </p>
160: *
161: * @param window the window that is docking
162: * @throws OperationAbortedException if this exception is thrown the dock operation will be aborted i.e. no views in the
163: * window will be docked
164: * @since IDW 1.4.0
165: */
166: void windowDocking(DockingWindow window)
167: throws OperationAbortedException;
168:
169: /**
170: * <p>
171: * Called when a view has been docked in the root window.
172: * </p>
173: *
174: * <p>
175: * <strong>Note:</strong> If a window containing more than one view was docked then this method will be called for each
176: * view after all views have been docked.
177: * </p>
178: *
179: * @param window the view that has been docked
180: * @since IDW 1.4.0
181: */
182: void windowDocked(DockingWindow window);
183:
184: /**
185: * <p>
186: * Called before the window that this listener is added to, or a child window of that window, is minimized.
187: * </p>
188: *
189: * <p>
190: * <strong>Note:</strong> that this method is only called when {@link DockingWindow#minimizeWithAbort()} is called
191: * explicitly, not when a window is implicitly docked as a result of another method call. Throwing an
192: * {@link OperationAbortedException} will cause the minimize operation to be aborted.
193: * </p>
194: *
195: * @param window the window that is minimizing
196: * @throws OperationAbortedException if this exception is thrown the minimize operation will be aborted
197: * @since IDW 1.4.0
198: */
199: void windowMinimizing(DockingWindow window)
200: throws OperationAbortedException;
201:
202: /**
203: * Called after the window that this listener is added to, or a child window of that window, has been minimized.
204: *
205: * @param window the window that has been minimized
206: * @since IDW 1.4.0
207: */
208: void windowMinimized(DockingWindow window);
209:
210: /**
211: * <p>
212: * Called before the window that this listener is added to, or a child window of that window, is maximized.
213: * </p>
214: *
215: * <p>
216: * <strong>Note:</strong> that this method is only called when {@link DockingWindow#maximizeWithAbort()} is called
217: * explicitly, not when a window is implicitly docked as a result of another method call. Throwing an
218: * {@link OperationAbortedException} will cause the maximize operation to be aborted.
219: * </p>
220: *
221: * @param window the window that is maximizing
222: * @throws OperationAbortedException if this exception is thrown the maximize operation will be aborted
223: * @since IDW 1.4.0
224: */
225: void windowMaximizing(DockingWindow window)
226: throws OperationAbortedException;
227:
228: /**
229: * Called after the window that this listener is added to, or a child window of that window, has been maximized.
230: *
231: * @param window the window that has been maximized
232: * @since IDW 1.4.0
233: */
234: void windowMaximized(DockingWindow window);
235:
236: /**
237: * <p>
238: * Called before the window that this listener is added to, or a child window of that window, is restored.
239: * </p>
240: *
241: * <p>
242: * <strong>Note:</strong> that this method is only called when {@link DockingWindow#restoreWithAbort()} is called
243: * explicitly, not when a window is implicitly restored as a result of another method call. Throwing an
244: * {@link OperationAbortedException} will cause the restore operation to be aborted.
245: * </p>
246: *
247: * @param window the window that is restoring
248: * @throws OperationAbortedException if this exception is thrown the restore operation will be aborted
249: * @since IDW 1.4.0
250: */
251: void windowRestoring(DockingWindow window)
252: throws OperationAbortedException;
253:
254: /**
255: * <p>
256: * Called after the window that this listener is added to, or a child window of that window, has been restored.
257: * </p>
258: *
259: * <p>
260: * Note that this method is only called when {@link DockingWindow#restore()}
261: * is called explicitly, not when a window is implicitly restored as a result of another method call.
262: * </p>
263: *
264: * @param window the window that has been restored
265: * @since IDW 1.4.0
266: */
267: void windowRestored(DockingWindow window);
268: }
|