KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > codeassist > complete > CompletionOnExceptionReference


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 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.internal.codeassist.complete;
12
13 /*
14  * Completion node build by the parser in any case it was intending to
15  * reduce an exception type reference containing the completion identifier.
16  * e.g.
17  *
18  * class X {
19  * void foo() {
20  * try {
21  * bar();
22  * } catch (IOExc[cursor] e) {
23  * }
24  * }
25  * }
26  *
27  * ---> class X {
28  * void foo() {
29  * try {
30  * bar();
31  * } catch (<CompleteOnException:IOExc> e) {
32  * }
33  * }
34  * }
35  *
36  * The source range of the completion node denotes the source range
37  * which should be replaced by the completion.
38  */

39 public class CompletionOnExceptionReference extends CompletionOnSingleTypeReference {
40
41     public CompletionOnExceptionReference(char[] source, long pos) {
42
43         super(source, pos);
44     }
45
46     public StringBuffer JavaDoc printExpression(int indent, StringBuffer JavaDoc output) {
47         
48         return output.append("<CompleteOnException:").append(this.token).append('>'); //$NON-NLS-1$
49
}
50 }
51
Popular Tags