KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
15  * Extension interface for {@link org.eclipse.jface.text.ITextViewer}.
16  * Introduces the concept of text presentation listeners and improves focus
17  * handling among widget token keepers.
18  * <p>
19  * A {@link org.eclipse.jface.text.ITextPresentationListener}is a listener that
20  * is informed by the viewer that a text presentation is about to be applied.
21  * During this callback the listener is allowed to modify the presentation. Text
22  * presentation listeners are thus a mean to participate in the process of text
23  * presentation creation.
24  *
25  * @since 3.0
26  */

27 public interface ITextViewerExtension4 {
28
29     /**
30      * Instructs the receiver to request the {@link IWidgetTokenKeeper}
31      * currently holding the widget token to take the keyboard focus.
32      *
33      * @return <code>true</code> if there was any
34      * <code>IWidgetTokenKeeper</code> that was asked to take the
35      * focus, <code>false</code> otherwise
36      */

37     boolean moveFocusToWidgetToken();
38
39     /**
40      * Adds the given text presentation listener to this text viewer.
41      * This call has no effect if the listener is already registered
42      * with this text viewer.
43      *
44      * @param listener the text presentation listener
45      */

46     void addTextPresentationListener(ITextPresentationListener listener);
47
48     /**
49      * Removes the given text presentation listener from this text viewer.
50      * This call has no effect if the listener is not registered with this
51      * text viewer.
52      *
53      * @param listener the text presentation listener
54      */

55     void removeTextPresentationListener(ITextPresentationListener listener);
56 }
57
Popular Tags