KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > IWidgetTokenKeeperExtension


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  *******************************************************************************/

11 package org.eclipse.jface.text;
12
13 /**
14  * Extension interface for {@link org.eclipse.jface.text.IWidgetTokenKeeper}.
15  * <p>
16  * Replaces the original <code>requestWidgetToken</code> functionality with a
17  * new priority based approach. Adds the concept of focus handling.
18  *
19  * @since 3.0
20  */

21 public interface IWidgetTokenKeeperExtension {
22
23     /**
24      * The given widget token owner requests the widget token from
25      * this token keeper. Returns <code>true</code> if the token is released
26      * by this token keeper. Note, the keeper must not call
27      * <code>releaseWidgetToken(IWidgetTokenKeeper)</code> explicitly.
28      *
29      * <p>The general contract is that the receiver should release the token
30      * if <code>priority</code> exceeds the receiver's priority.</p>
31      *
32      * @param owner the token owner
33      * @param priority the priority of the request
34      * @return <code>true</code> if token has been released <code>false</code> otherwise
35      */

36     boolean requestWidgetToken(IWidgetTokenOwner owner, int priority);
37
38     /**
39      * Requests the receiver to give focus to its popup shell, hover, or similar. There is
40      * no assumption made whether the receiver actually succeeded in taking the focus. The return
41      * value gives a hint whether the receiver tried to take focus.
42      *
43      * @param owner the token owner
44      * @return <code>true</code> if the receiver tried to take focus, <code>false</code> if it did not.
45      */

46     boolean setFocus(IWidgetTokenOwner owner);
47 }
48
Popular Tags