Mercurial > projects > dwt2
comparison org.eclipse.jface.text/src/org/eclipse/jface/text/information/IInformationPresenter.d @ 12:bc29606a740c
Added dwt-addons in original directory structure of eclipse.org
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 14 Mar 2009 18:23:29 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:43904fec5dca | 12:bc29606a740c |
---|---|
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 org.eclipse.jface.text.information.IInformationPresenter; | |
14 | |
15 import org.eclipse.jface.text.information.InformationPresenter; // packageimport | |
16 import org.eclipse.jface.text.information.IInformationProvider; // packageimport | |
17 import org.eclipse.jface.text.information.IInformationProviderExtension; // packageimport | |
18 import org.eclipse.jface.text.information.IInformationPresenterExtension; // packageimport | |
19 import org.eclipse.jface.text.information.IInformationProviderExtension2; // packageimport | |
20 | |
21 | |
22 import java.lang.all; | |
23 | |
24 import org.eclipse.jface.text.ITextViewer; | |
25 | |
26 | |
27 /** | |
28 * An information presenter shows information available at the text viewer's | |
29 * current document position. An <code>IInformationPresenter</code> is a | |
30 * {@link org.eclipse.jface.text.ITextViewer} add-on. | |
31 * <p> | |
32 * An information presenters has a list of {@link org.eclipse.jface.text.information.IInformationProvider} objects | |
33 * each of which is registered for a particular document content type. | |
34 * The presenter uses the strategy objects to retrieve the information to present. | |
35 * </p> | |
36 * <p> | |
37 * In order to provide backward compatibility for clients of <code>IInformationPresenter</code>, extension | |
38 * interfaces are used to provide a means of evolution. The following extension interfaces exist: | |
39 * <ul> | |
40 * <li>{@link IInformationPresenterExtension} since version 3.0 introducing | |
41 * the ability to handle documents with multiple partitions</li> | |
42 * </ul> | |
43 * </p> | |
44 * <p> | |
45 * The interface can be implemented by clients. By default, clients use | |
46 * {@link org.eclipse.jface.text.information.InformationPresenter} as the standard implementer of this interface. | |
47 * </p> | |
48 * | |
49 * @see org.eclipse.jface.text.information.IInformationPresenterExtension | |
50 * @see org.eclipse.jface.text.ITextViewer | |
51 * @see org.eclipse.jface.text.information.IInformationProvider | |
52 * @since 2.0 | |
53 */ | |
54 public interface IInformationPresenter { | |
55 | |
56 /** | |
57 * Installs the information presenter on the given text viewer. After this method has been | |
58 * finished, the presenter is operational, i.e. the method {@link #showInformation()} | |
59 * can be called until {@link #uninstall()} is called. | |
60 * | |
61 * @param textViewer the viewer on which the presenter is installed | |
62 */ | |
63 void install(ITextViewer textViewer); | |
64 | |
65 /** | |
66 * Removes the information presenter from the text viewer it has previously been | |
67 * installed on. | |
68 */ | |
69 void uninstall(); | |
70 | |
71 /** | |
72 * Shows information related to the cursor position of the text viewer | |
73 * this information presenter is installed on. | |
74 */ | |
75 void showInformation(); | |
76 | |
77 /** | |
78 * Returns the information provider to be used for the given content type. | |
79 * | |
80 * @param contentType the type of the content for which information will be requested | |
81 * @return an information provider or <code>null</code> if none exists for the specified content type | |
82 */ | |
83 IInformationProvider getInformationProvider(String contentType); | |
84 } |