Mercurial > projects > dwt2
comparison org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/ICompletionProposal.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.contentassist.ICompletionProposal; | |
14 | |
15 import org.eclipse.jface.text.contentassist.ContentAssistEvent; // packageimport | |
16 import org.eclipse.jface.text.contentassist.Helper; // packageimport | |
17 import org.eclipse.jface.text.contentassist.PopupCloser; // packageimport | |
18 import org.eclipse.jface.text.contentassist.IContentAssistant; // packageimport | |
19 import org.eclipse.jface.text.contentassist.CompletionProposal; // packageimport | |
20 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5; // packageimport | |
21 import org.eclipse.jface.text.contentassist.IContextInformationValidator; // packageimport | |
22 import org.eclipse.jface.text.contentassist.IContentAssistListener; // packageimport | |
23 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension6; // packageimport | |
24 import org.eclipse.jface.text.contentassist.ICompletionListener; // packageimport | |
25 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2; // packageimport | |
26 import org.eclipse.jface.text.contentassist.IContentAssistantExtension4; // packageimport | |
27 import org.eclipse.jface.text.contentassist.ContextInformation; // packageimport | |
28 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3; // packageimport | |
29 import org.eclipse.jface.text.contentassist.ContextInformationValidator; // packageimport | |
30 import org.eclipse.jface.text.contentassist.IContentAssistProcessor; // packageimport | |
31 import org.eclipse.jface.text.contentassist.AdditionalInfoController; // packageimport | |
32 import org.eclipse.jface.text.contentassist.IContextInformationPresenter; // packageimport | |
33 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension4; // packageimport | |
34 import org.eclipse.jface.text.contentassist.ICompletionListenerExtension; // packageimport | |
35 import org.eclipse.jface.text.contentassist.ContextInformationPopup; // packageimport | |
36 import org.eclipse.jface.text.contentassist.IContextInformationExtension; // packageimport | |
37 import org.eclipse.jface.text.contentassist.IContentAssistantExtension2; // packageimport | |
38 import org.eclipse.jface.text.contentassist.ContentAssistSubjectControlAdapter; // packageimport | |
39 import org.eclipse.jface.text.contentassist.CompletionProposalPopup; // packageimport | |
40 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension; // packageimport | |
41 import org.eclipse.jface.text.contentassist.IContextInformation; // packageimport | |
42 import org.eclipse.jface.text.contentassist.IContentAssistantExtension3; // packageimport | |
43 import org.eclipse.jface.text.contentassist.ContentAssistant; // packageimport | |
44 import org.eclipse.jface.text.contentassist.IContentAssistantExtension; // packageimport | |
45 import org.eclipse.jface.text.contentassist.JFaceTextMessages; // packageimport | |
46 | |
47 | |
48 import java.lang.all; | |
49 import java.util.Set; | |
50 | |
51 | |
52 | |
53 import org.eclipse.swt.graphics.Image; | |
54 import org.eclipse.swt.graphics.Point; | |
55 import org.eclipse.jface.text.IDocument; | |
56 | |
57 | |
58 /** | |
59 * The interface of completion proposals generated by content assist processors. | |
60 * A completion proposal contains information used to present the proposed completion | |
61 * to the user, to insert the completion should the user select it, and to present | |
62 * context information for the chosen completion once it has been inserted. | |
63 * <p> | |
64 * In order to provide backward compatibility for clients of <code>ICompletionProposal</code>, extension | |
65 * interfaces are used to provide a means of evolution. The following extension interfaces exist: | |
66 * <ul> | |
67 * <li>{@link org.eclipse.jface.text.contentassist.ICompletionProposalExtension} since version 2.0 introducing | |
68 * the following functions: | |
69 * <ul> | |
70 * <li>handling of trigger characters other than ENTER</li> | |
71 * <li>completion proposal validation for a given offset</li> | |
72 * <li>context information can be freely positioned</li> | |
73 * </ul> | |
74 * </li> | |
75 * <li>{@link org.eclipse.jface.text.contentassist.ICompletionProposalExtension2} since version 2.1 introducing | |
76 * the following functions: | |
77 * <ul> | |
78 * <li>handling of trigger characters with modifiers</li> | |
79 * <li>visual indication for selection of a proposal</li> | |
80 * </ul> | |
81 * </li> | |
82 * <li>{@link org.eclipse.jface.text.contentassist.ICompletionProposalExtension3} since version 3.0 introducing | |
83 * the following functions: | |
84 * <ul> | |
85 * <li>provision of a custom information control creator</li> | |
86 * <li>provide a custom completion text and offset for prefix completion</li> | |
87 * </ul> | |
88 * </li> | |
89 * <li>{@link org.eclipse.jface.text.contentassist.ICompletionProposalExtension4} since version 3.1 introducing | |
90 * the following functions: | |
91 * <ul> | |
92 * <li>specify whether a proposal is automatically insertable</li> | |
93 * </ul> | |
94 * </li> | |
95 * <li>{@link org.eclipse.jface.text.contentassist.ICompletionProposalExtension5} since version 3.2 introducing | |
96 * the following function: | |
97 * <ul> | |
98 * <li>Allow background computation of the additional info</li> | |
99 * </ul> | |
100 * </li> | |
101 * <li>{@link org.eclipse.jface.text.contentassist.ICompletionProposalExtension6} since version 3.4 introducing | |
102 * the following function: | |
103 * <ul> | |
104 * <li>Allow styled ranges in the display string.</li> | |
105 * </ul> | |
106 * </li> | |
107 * </ul> | |
108 * </p> | |
109 * <p> | |
110 * This interface can be implemented by clients. By default, clients use | |
111 * {@link org.eclipse.jface.text.contentassist.CompletionProposal} as the | |
112 * standard implementer of this interface. | |
113 * </p> | |
114 * | |
115 * @see IContentAssistProcessor | |
116 */ | |
117 public interface ICompletionProposal { | |
118 | |
119 /** | |
120 * Inserts the proposed completion into the given document. | |
121 * | |
122 * @param document the document into which to insert the proposed completion | |
123 */ | |
124 void apply(IDocument document); | |
125 | |
126 /** | |
127 * Returns the new selection after the proposal has been applied to | |
128 * the given document in absolute document coordinates. If it returns | |
129 * <code>null</code>, no new selection is set. | |
130 * | |
131 * A document change can trigger other document changes, which have | |
132 * to be taken into account when calculating the new selection. Typically, | |
133 * this would be done by installing a document listener or by using a | |
134 * document position during {@link #apply(IDocument)}. | |
135 * | |
136 * @param document the document into which the proposed completion has been inserted | |
137 * @return the new selection in absolute document coordinates | |
138 */ | |
139 Point getSelection(IDocument document); | |
140 | |
141 /** | |
142 * Returns optional additional information about the proposal. The additional information will | |
143 * be presented to assist the user in deciding if the selected proposal is the desired choice. | |
144 * <p> | |
145 * If {@link ICompletionProposalExtension5} is implemented, this method should not be called any | |
146 * longer. This method may be deprecated in a future release. | |
147 * </p> | |
148 * | |
149 * @return the additional information or <code>null</code> | |
150 */ | |
151 String getAdditionalProposalInfo(); | |
152 | |
153 /** | |
154 * Returns the string to be displayed in the list of completion proposals. | |
155 * | |
156 * @return the string to be displayed | |
157 */ | |
158 String getDisplayString(); | |
159 | |
160 /** | |
161 * Returns the image to be displayed in the list of completion proposals. | |
162 * The image would typically be shown to the left of the display string. | |
163 * | |
164 * @return the image to be shown or <code>null</code> if no image is desired | |
165 */ | |
166 Image getImage(); | |
167 | |
168 /** | |
169 * Returns optional context information associated with this proposal. | |
170 * The context information will automatically be shown if the proposal | |
171 * has been applied. | |
172 * | |
173 * @return the context information for this proposal or <code>null</code> | |
174 */ | |
175 IContextInformation getContextInformation(); | |
176 } |