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.IWidgetTokenKeeperExtension;
|
|
14
|
131
|
15 import dwtx.jface.text.IWidgetTokenOwner; // packageimport
|
|
16
|
129
|
17 import dwt.dwthelper.utils;
|
|
18
|
|
19 /**
|
|
20 * Extension interface for {@link dwtx.jface.text.IWidgetTokenKeeper}.
|
|
21 * <p>
|
|
22 * Replaces the original <code>requestWidgetToken</code> functionality with a
|
|
23 * new priority based approach. Adds the concept of focus handling.
|
|
24 *
|
|
25 * @since 3.0
|
|
26 */
|
|
27 public interface IWidgetTokenKeeperExtension {
|
|
28
|
|
29 /**
|
|
30 * The given widget token owner requests the widget token from
|
|
31 * this token keeper. Returns <code>true</code> if the token is released
|
|
32 * by this token keeper. Note, the keeper must not call
|
|
33 * <code>releaseWidgetToken(IWidgetTokenKeeper)</code> explicitly.
|
|
34 *
|
|
35 * <p>The general contract is that the receiver should release the token
|
|
36 * if <code>priority</code> exceeds the receiver's priority.</p>
|
|
37 *
|
|
38 * @param owner the token owner
|
|
39 * @param priority the priority of the request
|
|
40 * @return <code>true</code> if token has been released <code>false</code> otherwise
|
|
41 */
|
|
42 bool requestWidgetToken(IWidgetTokenOwner owner, int priority);
|
|
43
|
|
44 /**
|
|
45 * Requests the receiver to give focus to its popup shell, hover, or similar. There is
|
|
46 * no assumption made whether the receiver actually succeeded in taking the focus. The return
|
|
47 * value gives a hint whether the receiver tried to take focus.
|
|
48 *
|
|
49 * @param owner the token owner
|
|
50 * @return <code>true</code> if the receiver tried to take focus, <code>false</code> if it did not.
|
|
51 */
|
|
52 bool setFocus(IWidgetTokenOwner owner);
|
|
53 }
|