129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2006 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13
|
131
|
14
|
151
|
15 module dwtx.jface.text.IWidgetTokenOwner;
|
|
16
|
131
|
17 import dwtx.jface.text.IWidgetTokenKeeper; // packageimport
|
|
18
|
129
|
19 import dwt.dwthelper.utils;
|
|
20
|
|
21
|
|
22 /**
|
|
23 * In order to display information in a temporary window, a widget token must be
|
|
24 * acquired. The intent behind this concept is that only one temporary window
|
|
25 * should be presented at any moment in time and also to avoid overlapping
|
|
26 * temporary windows. This concept is used by the
|
|
27 * {@link dwtx.jface.text.ITextViewer}.
|
|
28 * <p>
|
|
29 * In order to provide backward compatibility for clients of
|
|
30 * <code>IWidgetTokenOwner</code>, extension interfaces are used as a means
|
|
31 * of evolution. The following extension interfaces exist:
|
|
32 * <ul>
|
|
33 * <li>{@link dwtx.jface.text.IWidgetTokenOwnerExtension} since version
|
|
34 * 3.0 introducing priorities when requesting a widget token and thus replacing
|
|
35 * the non-prioritized scheme.</li>
|
|
36 * </ul>
|
|
37 *
|
|
38 * @see dwtx.jface.text.IWidgetTokenOwnerExtension
|
|
39 * @since 2.0
|
|
40 */
|
|
41 public interface IWidgetTokenOwner {
|
|
42
|
|
43 /**
|
|
44 * Requests the widget token from this token owner. Returns
|
|
45 * <code>true</code> if the token has been acquired or is already owned by
|
|
46 * the requester. This method is non-blocking.
|
|
47 * <p>
|
|
48 * Replaced by
|
|
49 * {@link IWidgetTokenOwnerExtension#requestWidgetToken(IWidgetTokenKeeper, int)}.
|
|
50 *
|
|
51 * @param requester the token requester
|
|
52 * @return <code>true</code> if requester acquires the token,
|
|
53 * <code>false</code> otherwise
|
|
54 */
|
|
55 bool requestWidgetToken(IWidgetTokenKeeper requester);
|
|
56
|
|
57 /**
|
|
58 * The given token keeper releases the token to this
|
|
59 * token owner. If the token has previously not been held
|
|
60 * by the given token keeper, nothing happens. This
|
|
61 * method is non-blocking.
|
|
62 *
|
|
63 * @param tokenKeeper the token keeper
|
|
64 */
|
|
65 void releaseWidgetToken(IWidgetTokenKeeper tokenKeeper);
|
|
66 }
|