01: /*******************************************************************************
02: * Copyright (c) 2005 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.internal.ui.text.java;
11:
12: import org.eclipse.jdt.core.CompletionProposal;
13: import org.eclipse.jdt.core.IJavaProject;
14: import org.eclipse.jdt.core.IMember;
15: import org.eclipse.jdt.core.JavaModelException;
16:
17: import org.eclipse.jdt.internal.corext.template.java.SignatureUtil;
18:
19: /**
20: * Proposal info that computes the javadoc lazily when it is queried.
21: *
22: * @since 3.1
23: */
24: public final class AnonymousTypeProposalInfo extends MemberProposalInfo {
25:
26: /**
27: * Creates a new proposal info.
28: *
29: * @param project the java project to reference when resolving types
30: * @param proposal the proposal to generate information for
31: */
32: public AnonymousTypeProposalInfo(IJavaProject project,
33: CompletionProposal proposal) {
34: super (project, proposal);
35: }
36:
37: /**
38: * Resolves the member described by the receiver and returns it if found.
39: * Returns <code>null</code> if no corresponding member can be found.
40: *
41: * @return the resolved member or <code>null</code> if none is found
42: * @throws JavaModelException if accessing the java model fails
43: */
44: protected IMember resolveMember() throws JavaModelException {
45: char[] signature = fProposal.getDeclarationSignature();
46: String typeName = SignatureUtil.stripSignatureToFQN(String
47: .valueOf(signature));
48: return fJavaProject.findType(typeName);
49: }
50: }
|