1 11 package org.eclipse.jdt.internal.ui.text.java; 12 13 import org.eclipse.core.runtime.Assert; 14 15 import org.eclipse.jdt.core.CompletionProposal; 16 import org.eclipse.jdt.core.IJavaElement; 17 import org.eclipse.jdt.core.IJavaProject; 18 import org.eclipse.jdt.core.IMember; 19 import org.eclipse.jdt.core.JavaModelException; 20 21 26 public abstract class MemberProposalInfo extends ProposalInfo { 27 28 protected final IJavaProject fJavaProject; 29 protected final CompletionProposal fProposal; 30 31 32 private boolean fJavaElementResolved= false; 33 34 40 public MemberProposalInfo(IJavaProject project, CompletionProposal proposal) { 41 Assert.isNotNull(project); 42 Assert.isNotNull(proposal); 43 fJavaProject= project; 44 fProposal= proposal; 45 } 46 47 53 public IJavaElement getJavaElement() throws JavaModelException { 54 if (!fJavaElementResolved) { 55 fJavaElementResolved= true; 56 fElement= resolveMember(); 57 } 58 return fElement; 59 } 60 61 68 protected abstract IMember resolveMember() throws JavaModelException; 69 70 71 } 72 | Popular Tags |