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