129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2008 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 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.information.IInformationPresenter;
|
|
14
|
|
15 import dwt.dwthelper.utils;
|
|
16
|
|
17 import dwtx.jface.text.ITextViewer;
|
|
18
|
|
19
|
|
20 /**
|
|
21 * An information presenter shows information available at the text viewer's
|
|
22 * current document position. An <code>IInformationPresenter</code> is a
|
|
23 * {@link dwtx.jface.text.ITextViewer} add-on.
|
|
24 * <p>
|
|
25 * An information presenters has a list of {@link dwtx.jface.text.information.IInformationProvider} objects
|
|
26 * each of which is registered for a particular document content type.
|
|
27 * The presenter uses the strategy objects to retrieve the information to present.
|
|
28 * </p>
|
|
29 * <p>
|
|
30 * In order to provide backward compatibility for clients of <code>IInformationPresenter</code>, extension
|
|
31 * interfaces are used to provide a means of evolution. The following extension interfaces exist:
|
|
32 * <ul>
|
|
33 * <li>{@link IInformationPresenterExtension} since version 3.0 introducing
|
|
34 * the ability to handle documents with multiple partitions</li>
|
|
35 * </ul>
|
|
36 * </p>
|
|
37 * <p>
|
|
38 * The interface can be implemented by clients. By default, clients use
|
|
39 * {@link dwtx.jface.text.information.InformationPresenter} as the standard implementer of this interface.
|
|
40 * </p>
|
|
41 *
|
|
42 * @see dwtx.jface.text.information.IInformationPresenterExtension
|
|
43 * @see dwtx.jface.text.ITextViewer
|
|
44 * @see dwtx.jface.text.information.IInformationProvider
|
|
45 * @since 2.0
|
|
46 */
|
|
47 public interface IInformationPresenter {
|
|
48
|
|
49 /**
|
|
50 * Installs the information presenter on the given text viewer. After this method has been
|
|
51 * finished, the presenter is operational, i.e. the method {@link #showInformation()}
|
|
52 * can be called until {@link #uninstall()} is called.
|
|
53 *
|
|
54 * @param textViewer the viewer on which the presenter is installed
|
|
55 */
|
|
56 void install(ITextViewer textViewer);
|
|
57
|
|
58 /**
|
|
59 * Removes the information presenter from the text viewer it has previously been
|
|
60 * installed on.
|
|
61 */
|
|
62 void uninstall();
|
|
63
|
|
64 /**
|
|
65 * Shows information related to the cursor position of the text viewer
|
|
66 * this information presenter is installed on.
|
|
67 */
|
|
68 void showInformation();
|
|
69
|
|
70 /**
|
|
71 * Returns the information provider to be used for the given content type.
|
|
72 *
|
|
73 * @param contentType the type of the content for which information will be requested
|
|
74 * @return an information provider or <code>null</code> if none exists for the specified content type
|
|
75 */
|
|
76 IInformationProvider getInformationProvider(String contentType);
|
|
77 }
|