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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.ui.text.java;
13 import org.eclipse.jface.text.contentassist.IContextInformation;
15 import org.eclipse.jdt.core.ICompilationUnit;
19 * A Javadoc processor proposes completions and computes
20 * context information for a particular content type.
22 * This interface must be implemented by clients who extend the
23 * <code>org.eclipse.jdt.ui.javadocCompletionProcessor</code> extension-point</p>.
26 * @deprecated As of 3.2, replaced by <code>org.eclipse.jdt.ui.javaCompletionProposalComputer</code> extension-point</p>.
28 public interface IJavadocCompletionProcessor {
31 * Flag used by <code>computeCompletionProposals</code>.
32 * Specifies that only proposals should be returned that match
33 * the case of the prefix in the code (value: <code>1</code>).
35 int RESTRICT_TO_MATCHING_CASE= 1;
39 * Returns information about possible contexts based on the
40 * specified location within the compilation unit.
42 * @param cu the working copy of the compilation unit which
43 * is used to compute the possible contexts
44 * @param offset an offset within the compilation unit for
45 * which context information should be computed
46 * @return an array of context information objects or <code>null</code>
47 * if no context could be found
49 IContextInformation[] computeContextInformation(ICompilationUnit cu, int offset);
53 * Returns the completion proposals based on the specified location
54 * within the compilation unit.
56 * @param cu the working copy of the compilation unit in which the
57 * completion request has been called.
58 * @param offset an offset within the compilation unit for which
59 * completion proposals should be computed
60 * @param length the length of the current selection.
61 * @param flags settings for the code assist. Flags as defined in this interface,
62 * e.g. <code>RESTRICT_TO_MATCHING_CASE</code>.
63 * @return an array of completion proposals or <code>null</code> if
64 * no proposals could be found
66 IJavaCompletionProposal[] computeCompletionProposals(ICompilationUnit cu, int offset, int length, int flags);
70 * Returns the reason why this completion processor was unable
71 * to produce a completion proposals or context information.
73 * @return an error message or <code>null</code> if no error occurred
75 String getErrorMessage();