01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.ui.text.java;
11:
12: import org.eclipse.jface.text.contentassist.IContextInformation;
13:
14: import org.eclipse.jdt.core.ICompilationUnit;
15:
16: /**
17: * A Javadoc processor proposes completions and computes
18: * context information for a particular content type.
19: * <p>
20: * This interface must be implemented by clients who extend the
21: * <code>org.eclipse.jdt.ui.javadocCompletionProcessor</code> extension-point</p>.
22: *
23: * @since 2.1
24: * @deprecated As of 3.2, replaced by <code>org.eclipse.jdt.ui.javaCompletionProposalComputer</code> extension-point</p>.
25: */
26: public interface IJavadocCompletionProcessor {
27:
28: /**
29: * Flag used by <code>computeCompletionProposals</code>.
30: * Specifies that only proposals should be returned that match
31: * the case of the prefix in the code (value: <code>1</code>).
32: */
33: int RESTRICT_TO_MATCHING_CASE = 1;
34:
35: /**
36: * Returns information about possible contexts based on the
37: * specified location within the compilation unit.
38: *
39: * @param cu the working copy of the compilation unit which
40: * is used to compute the possible contexts
41: * @param offset an offset within the compilation unit for
42: * which context information should be computed
43: * @return an array of context information objects or <code>null</code>
44: * if no context could be found
45: */
46: IContextInformation[] computeContextInformation(
47: ICompilationUnit cu, int offset);
48:
49: /**
50: * Returns the completion proposals based on the specified location
51: * within the compilation unit.
52: *
53: * @param cu the working copy of the compilation unit in which the
54: * completion request has been called.
55: * @param offset an offset within the compilation unit for which
56: * completion proposals should be computed
57: * @param length the length of the current selection.
58: * @param flags settings for the code assist. Flags as defined in this interface,
59: * e.g. <code>RESTRICT_TO_MATCHING_CASE</code>.
60: * @return an array of completion proposals or <code>null</code> if
61: * no proposals could be found
62: */
63: IJavaCompletionProposal[] computeCompletionProposals(
64: ICompilationUnit cu, int offset, int length, int flags);
65:
66: /**
67: * Returns the reason why this completion processor was unable
68: * to produce a completion proposals or context information.
69: *
70: * @return an error message or <code>null</code> if no error occurred
71: */
72: String getErrorMessage();
73: }
|