KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > ui > text > java > IJavaCompletionProposalComputer


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.jdt.ui.text.java;
12
13 import java.util.List JavaDoc;
14
15 import org.eclipse.core.runtime.IProgressMonitor;
16
17 import org.eclipse.jface.text.contentassist.ICompletionProposal;
18 import org.eclipse.jface.text.contentassist.IContextInformation;
19
20 /**
21  * Computes completions and context information displayed by the Java editor content assistant.
22  * Contributions to the <tt>org.eclipse.jdt.ui.javaCompletionProposalComputer</tt> extension point
23  * must implement this interface.
24  *
25  * @since 3.2
26  */

27 public interface IJavaCompletionProposalComputer {
28     /**
29      * Informs the computer that a content assist session has started. This call will always be
30      * followed by a {@link #sessionEnded()} call, but not necessarily by calls to
31      * {@linkplain #computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) computeCompletionProposals}
32      * or
33      * {@linkplain #computeContextInformation(ContentAssistInvocationContext, IProgressMonitor) computeContextInformation}.
34      */

35     void sessionStarted();
36
37     /**
38      * Returns a list of completion proposals valid at the given invocation context.
39      *
40      * @param context the context of the content assist invocation
41      * @param monitor a progress monitor to report progress. The monitor is private to this
42      * invocation, i.e. there is no need for the receiver to spawn a sub monitor.
43      * @return a list of completion proposals (element type: {@link ICompletionProposal})
44      */

45     List JavaDoc computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor);
46
47     /**
48      * Returns context information objects valid at the given invocation context.
49      *
50      * @param context the context of the content assist invocation
51      * @param monitor a progress monitor to report progress. The monitor is private to this
52      * invocation, i.e. there is no need for the receiver to spawn a sub monitor.
53      * @return a list of context information objects (element type: {@link IContextInformation})
54      */

55     List JavaDoc computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor);
56
57     /**
58      * Returns the reason why this computer was unable to produce any completion proposals or
59      * context information.
60      *
61      * @return an error message or <code>null</code> if no error occurred
62      */

63     String JavaDoc getErrorMessage();
64
65     /**
66      * Informs the computer that a content assist session has ended. This call will always be after
67      * any calls to
68      * {@linkplain #computeCompletionProposals(ContentAssistInvocationContext, IProgressMonitor) computeCompletionProposals}
69      * and
70      * {@linkplain #computeContextInformation(ContentAssistInvocationContext, IProgressMonitor) computeContextInformation}.
71      */

72     void sessionEnded();
73 }
74
Popular Tags