X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/ICodeAssist.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/ICodeAssist.java index 5f3c04c..624ad4d 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/ICodeAssist.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/core/ICodeAssist.java @@ -1,13 +1,13 @@ /******************************************************************************* - * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others. + * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 + * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html + * http://www.eclipse.org/legal/cpl-v10.html * * Contributors: * IBM Corporation - initial API and implementation - ******************************************************************************/ + *******************************************************************************/ package net.sourceforge.phpdt.core; /** @@ -20,62 +20,235 @@ package net.sourceforge.phpdt.core; public interface ICodeAssist { /** - * Performs code completion at the given offset position in this compilation unit, - * reporting results to the given completion requestor. The offset - * is the 0-based index of the character, after which code assist is desired. - * An offset of -1 indicates to code assist at the beginning of this - * compilation unit. - * - * @param offset the given offset position - * @param requestor the given completion requestor - * @exception JavaModelException if code assist could not be performed. Reasons include: - * - * @exception IllegalArgumentException if requestor is null + * Performs code completion at the given offset position in this compilation + * unit, reporting results to the given completion requestor. The + * offset is the 0-based index of the character, after which + * code assist is desired. An offset of -1 indicates to code + * assist at the beginning of this compilation unit. + * + * @param offset + * the given offset position + * @param requestor + * the given completion requestor + * + * @exception JavaModelException + * if code assist could not be performed. Reasons include: + * + * + * @exception IllegalArgumentException + * if requestor is null + * @deprecated Use {@link #codeComplete(int, ICompletionRequestor)} instead. + */ + void codeComplete(int offset, ICodeCompletionRequestor requestor) + throws JavaModelException; + + /** + * Performs code completion at the given offset position in this compilation + * unit, reporting results to the given completion requestor. The + * offset is the 0-based index of the character, after which + * code assist is desired. An offset of -1 indicates to code + * assist at the beginning of this compilation unit. + * + * @param offset + * the given offset position + * @param requestor + * the given completion requestor + * @exception JavaModelException + * if code assist could not be performed. Reasons include: + * + * + * @exception IllegalArgumentException + * if requestor is null * @since 2.0 - * */ + */ + // TODO (jerome - once CompletionRequestor is working) @ deprecated Use + // {@link #codeComplete(int, CompletionRequestor)} instead. void codeComplete(int offset, ICompletionRequestor requestor) - throws JavaModelException; + throws JavaModelException; + + /** + * DO NOT USE: This API element was added in anticipation of J2SE + * 1.5 support, which is planned for the next release of Eclipse after 3.0. + * It is currently unimplemented, and the API may change slightly before + * reaching its final form. + *

+ * Performs code completion at the given offset position in this compilation + * unit, reporting results to the given completion requestor. The + * offset is the 0-based index of the character, after which + * code assist is desired. An offset of -1 indicates to code + * assist at the beginning of this compilation unit. + *

+ * + * @param offset + * the given offset position + * @param requestor + * the given completion requestor + * @exception JavaModelException + * if code assist could not be performed. Reasons include: + *

+ * + * @exception IllegalArgumentException + * if requestor is null + * @since 3.0 + */ + void codeComplete(int offset, CompletionRequestor requestor) + throws JavaModelException; + /** - * Performs code selection on the given selected text in this compilation unit, - * reporting results to the given selection requestor. The offset - * is the 0-based index of the first selected character. The length - * is the number of selected characters. - * - * @param offset the given offset position - * @param length the number of selected characters - * - * @exception JavaModelException if code resolve could not be performed. Reasons include: - *
  • This Java element does not exist (ELEMENT_DOES_NOT_EXIST)
  • - *
  • The range specified is not within this element's - * source range (INDEX_OUT_OF_BOUNDS) - * - * + * Performs code completion at the given offset position in this compilation + * unit, reporting results to the given completion requestor. The + * offset is the 0-based index of the character, after which + * code assist is desired. An offset of -1 indicates to code + * assist at the beginning of this compilation unit. It considers types in + * the working copies with the given owner first. In other words, the + * owner's working copies will take precedence over their original + * compilation units in the workspace. + *

    + * Note that if a working copy is empty, it will be as if the original + * compilation unit had been deleted. + *

    + * + * @param offset + * the given offset position + * @param requestor + * the given completion requestor + * @param owner + * the owner of working copies that take precedence over their + * original compilation units + * @exception JavaModelException + * if code assist could not be performed. Reasons include: + * + * + * @exception IllegalArgumentException + * if requestor is null + * @since 3.0 + */ + // TODO (jerome - once CompletionRequestor is working) @ deprecated Use + // {@link #codeComplete(int, CompletionRequestor, WorkingCopyOwner)} + // instead. + void codeComplete(int offset, ICompletionRequestor requestor, + WorkingCopyOwner owner) throws JavaModelException; + + /** + * DO NOT USE: This API element was added in anticipation of J2SE + * 1.5 support, which is planned for the next release of Eclipse after 3.0. + * It is currently unimplemented, and the API may change slightly before + * reaching its final form. + *

    + * Performs code completion at the given offset position in this compilation + * unit, reporting results to the given completion requestor. The + * offset is the 0-based index of the character, after which + * code assist is desired. An offset of -1 indicates to code + * assist at the beginning of this compilation unit. It considers types in + * the working copies with the given owner first. In other words, the + * owner's working copies will take precedence over their original + * compilation units in the workspace. + *

    + * Note that if a working copy is empty, it will be as if the original + * compilation unit had been deleted. + *

    + * + * @param offset + * the given offset position + * @param requestor + * the given completion requestor + * @param owner + * the owner of working copies that take precedence over their + * original compilation units + * @exception JavaModelException + * if code assist could not be performed. Reasons include: + * + * + * @exception IllegalArgumentException + * if requestor is null + * @since 3.0 + */ + void codeComplete(int offset, CompletionRequestor requestor, + WorkingCopyOwner owner) throws JavaModelException; + + /** + * Returns the Java elements correspondiing to the given selected text in + * this compilation unit. The offset is the 0-based index of + * the first selected character. The length is the number of + * selected characters. + * + * @param offset + * the given offset position + * @param length + * the number of selected characters + * @return the Java elements correspondiing to the given selected text + * + * @exception JavaModelException + * if code resolve could not be performed. Reasons include: + *
  • This Java element does not exist + * (ELEMENT_DOES_NOT_EXIST)
  • + *
  • The range specified is not within this element's + * source range (INDEX_OUT_OF_BOUNDS) + * + * */ IJavaElement[] codeSelect(int offset, int length) throws JavaModelException; /** - * Performs code completion at the given offset position in this compilation unit, - * reporting results to the given completion requestor. The offset - * is the 0-based index of the character, after which code assist is desired. - * An offset of -1 indicates to code assist at the beginning of this - * compilation unit. - * - * @param offset the given offset position - * @param requestor the given completion requestor - * - * @exception JavaModelException if code assist could not be performed. Reasons include: - * - * @exception IllegalArgumentException if requestor is null - * @deprecated - use codeComplete(int, ICompletionRequestor) instead + * Returns the Java elements correspondiing to the given selected text in + * this compilation unit. The offset is the 0-based index of + * the first selected character. The length is the number of + * selected characters. It considers types in the working copies with the + * given owner first. In other words, the owner's working copies will take + * precedence over their original compilation units in the workspace. + *

    + * Note that if a working copy is empty, it will be as if the original + * compilation unit had been deleted. + *

    + * + * @param offset + * the given offset position + * @param length + * the number of selected characters + * @param owner + * the owner of working copies that take precedence over their + * original compilation units + * @return the Java elements correspondiing to the given selected text + * + * @exception JavaModelException + * if code resolve could not be performed. Reasons include: + *
  • This Java element does not exist + * (ELEMENT_DOES_NOT_EXIST)
  • + *
  • The range specified is not within this element's + * source range (INDEX_OUT_OF_BOUNDS) + * + * @since 3.0 */ -// void codeComplete(int offset, ICodeCompletionRequestor requestor) -// throws JavaModelException; -} \ No newline at end of file + IJavaElement[] codeSelect(int offset, int length, WorkingCopyOwner owner) + throws JavaModelException; +}