129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2005 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 module dwtx.jface.text.IWidgetTokenOwnerExtension;
|
|
14
|
|
15 import dwt.dwthelper.utils;
|
|
16
|
|
17 /**
|
|
18 * Extension interface for {@link dwtx.jface.text.IWidgetTokenOwner}.
|
|
19 * <p>
|
|
20 * Replaces the original <code>requestWidgetToken</code> functionality with a
|
|
21 * new priority based approach.
|
|
22 *
|
|
23 * @since 3.0
|
|
24 */
|
|
25 public interface IWidgetTokenOwnerExtension {
|
|
26
|
|
27 /**
|
|
28 * Requests the widget token from this token owner. Returns
|
|
29 * <code>true</code> if the token has been acquired or is
|
|
30 * already owned by the requester. This method is non-blocking.
|
|
31 *
|
|
32 * <p><code>priority</code> is forwarded to any existing token keeper
|
|
33 * to give it an estimate on whether the request has higher priority than
|
|
34 * the current keeper's. There is, however, no guarantee that another keeper
|
|
35 * will release the token even if it has a high priority.</p>
|
|
36 *
|
|
37 * @param requester the token requester
|
|
38 * @param priority the priority of the request
|
|
39 * @return <code>true</code> if requester acquires the token,
|
|
40 * <code>false</code> otherwise
|
|
41 */
|
|
42 bool requestWidgetToken(IWidgetTokenKeeper requester, int priority);
|
|
43 }
|