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.IWidgetTokenKeeper}.
14: * <p>
15: * Replaces the original <code>requestWidgetToken</code> functionality with a
16: * new priority based approach. Adds the concept of focus handling.
17: *
18: * @since 3.0
19: */
20: public interface IWidgetTokenKeeperExtension {
21:
22: /**
23: * The given widget token owner requests the widget token from
24: * this token keeper. Returns <code>true</code> if the token is released
25: * by this token keeper. Note, the keeper must not call
26: * <code>releaseWidgetToken(IWidgetTokenKeeper)</code> explicitly.
27: *
28: * <p>The general contract is that the receiver should release the token
29: * if <code>priority</code> exceeds the receiver's priority.</p>
30: *
31: * @param owner the token owner
32: * @param priority the priority of the request
33: * @return <code>true</code> if token has been released <code>false</code> otherwise
34: */
35: boolean requestWidgetToken(IWidgetTokenOwner owner, int priority);
36:
37: /**
38: * Requests the receiver to give focus to its popup shell, hover, or similar. There is
39: * no assumption made whether the receiver actually succeeded in taking the focus. The return
40: * value gives a hint whether the receiver tried to take focus.
41: *
42: * @param owner the token owner
43: * @return <code>true</code> if the receiver tried to take focus, <code>false</code> if it did not.
44: */
45: boolean setFocus(IWidgetTokenOwner owner);
46: }
|