comparison org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/IContentAssistant.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, 2007 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.IContentAssistant;
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.CompletionProposal; // packageimport
19 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension5; // packageimport
20 import org.eclipse.jface.text.contentassist.IContextInformationValidator; // packageimport
21 import org.eclipse.jface.text.contentassist.IContentAssistListener; // packageimport
22 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension6; // packageimport
23 import org.eclipse.jface.text.contentassist.ICompletionListener; // packageimport
24 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2; // packageimport
25 import org.eclipse.jface.text.contentassist.IContentAssistantExtension4; // packageimport
26 import org.eclipse.jface.text.contentassist.ContextInformation; // packageimport
27 import org.eclipse.jface.text.contentassist.ICompletionProposalExtension3; // packageimport
28 import org.eclipse.jface.text.contentassist.ContextInformationValidator; // packageimport
29 import org.eclipse.jface.text.contentassist.ICompletionProposal; // 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 import org.eclipse.jface.text.ITextViewer;
52
53
54 /**
55 * An <code>IContentAssistant</code> provides support on interactive content completion.
56 * The content assistant is a {@link org.eclipse.jface.text.ITextViewer} add-on. Its
57 * purpose is to propose, display, and insert completions of the content
58 * of the text viewer's document at the viewer's cursor position. In addition
59 * to handle completions, a content assistant can also be requested to provide
60 * context information. Context information is shown in a tool tip like popup.
61 * As it is not always possible to determine the exact context at a given
62 * document offset, a content assistant displays the possible contexts and requests
63 * the user to choose the one whose information should be displayed.
64 * <p>
65 * A content assistant has a list of {@link org.eclipse.jface.text.contentassist.IContentAssistProcessor}
66 * objects each of which is registered for a particular document content
67 * type. The content assistant uses the processors to react on the request
68 * of completing documents or presenting context information.
69 * </p>
70 * <p>
71 * In order to provide backward compatibility for clients of <code>IContentAssistant</code>, extension
72 * interfaces are used to provide a means of evolution. The following extension interfaces exist:
73 * <ul>
74 * <li>{@link org.eclipse.jface.text.contentassist.IContentAssistantExtension} since version 3.0 introducing
75 * the following functions:
76 * <ul>
77 * <li>handle documents with multiple partitions</li>
78 * <li>insertion of common completion prefixes</li>
79 * </ul>
80 * </li>
81 * <li>{@link org.eclipse.jface.text.contentassist.IContentAssistantExtension2} since version 3.2 introducing
82 * the following functions:
83 * <ul>
84 * <li>repeated invocation (cycling) mode</li>
85 * <li>completion listeners</li>
86 * <li>a local status line for the completion popup</li>
87 * <li>control over the behavior when no proposals are available</li>
88 * </ul>
89 * </li>
90 * <li>{@link org.eclipse.jface.text.contentassist.IContentAssistantExtension3} since version 3.2 introducing
91 * the following function:
92 * <ul>
93 * <li>a key-sequence to listen for in repeated invocation mode</li>
94 * </ul>
95 * </li>
96 * <li>{@link org.eclipse.jface.text.contentassist.IContentAssistantExtension4} since version 3.4 introducing
97 * the following function:
98 * <ul>
99 * <li>allows to get a handler for the given command identifier</li>
100 * </ul>
101 * </li>
102 * </ul>
103 * </p>
104 * <p>
105 * The interface can be implemented by clients. By default, clients use
106 * {@link org.eclipse.jface.text.contentassist.ContentAssistant} as the standard
107 * implementer of this interface.
108 * </p>
109 *
110 * @see org.eclipse.jface.text.ITextViewer
111 * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor
112 */
113 public interface IContentAssistant {
114
115 //------ proposal popup orientation styles ------------
116 /** The context info list will overlay the list of completion proposals. */
117 public const static int PROPOSAL_OVERLAY= 10;
118 /** The completion proposal list will be removed before the context info list will be shown. */
119 public const static int PROPOSAL_REMOVE= 11;
120 /** The context info list will be presented without hiding or overlapping the completion proposal list. */
121 public const static int PROPOSAL_STACKED= 12;
122
123 //------ context info box orientation styles ----------
124 /** Context info will be shown above the location it has been requested for without hiding the location. */
125 public const static int CONTEXT_INFO_ABOVE= 20;
126 /** Context info will be shown below the location it has been requested for without hiding the location. */
127 public const static int CONTEXT_INFO_BELOW= 21;
128
129
130 /**
131 * Installs content assist support on the given text viewer.
132 *
133 * @param textViewer the text viewer on which content assist will work
134 */
135 void install(ITextViewer textViewer);
136
137 /**
138 * Uninstalls content assist support from the text viewer it has
139 * previously be installed on.
140 */
141 void uninstall();
142
143 /**
144 * Shows all possible completions of the content at the viewer's cursor position.
145 *
146 * @return an optional error message if no proposals can be computed
147 */
148 String showPossibleCompletions();
149
150 /**
151 * Shows context information for the content at the viewer's cursor position.
152 *
153 * @return an optional error message if no context information can be computed
154 */
155 String showContextInformation();
156
157 /**
158 * Returns the content assist processor to be used for the given content type.
159 *
160 * @param contentType the type of the content for which this
161 * content assistant is to be requested
162 * @return an instance content assist processor or
163 * <code>null</code> if none exists for the specified content type
164 */
165 IContentAssistProcessor getContentAssistProcessor(String contentType);
166 }