KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > java > AnonymousTypeProposalInfo


1 /*******************************************************************************
2  * Copyright (c) 2005 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.ui.text.java;
12
13 import org.eclipse.jdt.core.CompletionProposal;
14 import org.eclipse.jdt.core.IJavaProject;
15 import org.eclipse.jdt.core.IMember;
16 import org.eclipse.jdt.core.JavaModelException;
17
18 import org.eclipse.jdt.internal.corext.template.java.SignatureUtil;
19
20
21 /**
22  * Proposal info that computes the javadoc lazily when it is queried.
23  *
24  * @since 3.1
25  */

26 public final class AnonymousTypeProposalInfo extends MemberProposalInfo {
27
28     /**
29      * Creates a new proposal info.
30      *
31      * @param project the java project to reference when resolving types
32      * @param proposal the proposal to generate information for
33      */

34     public AnonymousTypeProposalInfo(IJavaProject project, CompletionProposal proposal) {
35         super(project, proposal);
36     }
37
38     /**
39      * Resolves the member described by the receiver and returns it if found.
40      * Returns <code>null</code> if no corresponding member can be found.
41      *
42      * @return the resolved member or <code>null</code> if none is found
43      * @throws JavaModelException if accessing the java model fails
44      */

45     protected IMember resolveMember() throws JavaModelException {
46         char[] signature= fProposal.getDeclarationSignature();
47         String JavaDoc typeName= SignatureUtil.stripSignatureToFQN(String.valueOf(signature));
48         return fJavaProject.findType(typeName);
49     }
50 }
51
Popular Tags