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