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