KickJava   Java API By Example, From Geeks To Geeks.

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


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

11
12 package org.eclipse.jface.text;
13
14
15 /**
16  * In order to display information in a temporary window, a widget token must be
17  * acquired. The intent behind this concept is that only one temporary window
18  * should be presented at any moment in time and also to avoid overlapping
19  * temporary windows. This concept is used by the
20  * {@link org.eclipse.jface.text.ITextViewer}.
21  * <p>
22  * In order to provide backward compatibility for clients of
23  * <code>IWidgetTokenOwner</code>, extension interfaces are used as a means
24  * of evolution. The following extension interfaces exist:
25  * <ul>
26  * <li>{@link org.eclipse.jface.text.IWidgetTokenOwnerExtension} since version
27  * 3.0 introducing priorities when requesting a widget token and thus replacing
28  * the non-prioritized scheme.</li>
29  * </ul>
30  *
31  * @see org.eclipse.jface.text.IWidgetTokenOwnerExtension
32  * @since 2.0
33  */

34 public interface IWidgetTokenOwner {
35
36     /**
37      * Requests the widget token from this token owner. Returns
38      * <code>true</code> if the token has been acquired or is already owned by
39      * the requester. This method is non-blocking.
40      * <p>
41      * Replaced by
42      * {@link IWidgetTokenOwnerExtension#requestWidgetToken(IWidgetTokenKeeper, int)}.
43      *
44      * @param requester the token requester
45      * @return <code>true</code> if requester acquires the token,
46      * <code>false</code> otherwise
47      */

48     boolean requestWidgetToken(IWidgetTokenKeeper requester);
49
50     /**
51      * The given token keeper releases the token to this
52      * token owner. If the token has previously not been held
53      * by the given token keeper, nothing happens. This
54      * method is non-blocking.
55      *
56      * @param tokenKeeper the token keeper
57      */

58     void releaseWidgetToken(IWidgetTokenKeeper tokenKeeper);
59 }
60
Popular Tags