KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > contentassist > ICompletionProposalExtension3


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.contentassist;
12
13 import org.eclipse.jface.text.IDocument;
14 import org.eclipse.jface.text.IInformationControlCreator;
15
16
17 /**
18  * Extends {@link org.eclipse.jface.text.contentassist.ICompletionProposal}
19  * with the following functions:
20  * <ul>
21  * <li>provision of a custom information control creator</li>
22  * <li>provide a custom completion text and offset for prefix completion</li>
23  * </ul>
24  *
25  * @since 3.0
26  */

27 public interface ICompletionProposalExtension3 {
28     /**
29      * Returns the information control creator of this completion proposal.
30      *
31      * @return the information control creator, or <code>null</code> if no custom control creator is available
32      */

33     IInformationControlCreator getInformationControlCreator();
34
35     /**
36      * Returns the string that would be inserted at the position returned from
37      * {@link #getPrefixCompletionStart(IDocument, int)} if this proposal was
38      * applied. If the replacement string cannot be determined,
39      * <code>null</code> may be returned.
40      * <p>
41      * If this interface is not implemented,
42      * {@link ICompletionProposal#getDisplayString()} will be used instead.
43      * </p>
44      *
45      * @param document the document that the receiver applies to
46      * @param completionOffset the offset into <code>document</code> where the
47      * completion takes place
48      * @return the replacement string or <code>null</code> if it cannot be
49      * determined
50      */

51     CharSequence JavaDoc getPrefixCompletionText(IDocument document, int completionOffset);
52
53     /**
54      * Returns the document offset at which the receiver would insert its
55      * proposal.
56      * <p>
57      * If this interface is not implemented, <code>completionOffset</code> will
58      * be used instead.
59      * </p>
60      *
61      * @param document the document that the receiver applies to
62      * @param completionOffset the offset into <code>document</code> where the
63      * completion takes place
64      * @return the offset at which the proposal would insert its proposal
65      */

66     int getPrefixCompletionStart(IDocument document, int completionOffset);
67
68 }
69
Popular Tags