@Override public IJavaProject getProject() { return javaContext.getProject(); };
/** * Returns the method formatter preferences. * * @return the formatter settings */ @Override protected final FormatterPrefs getFormatterPrefs() { if (fFormatterPrefs == null) fFormatterPrefs= new FormatterPrefs(fInvocationContext.getProject()); return fFormatterPrefs; }
/** * Returns the method formatter preferences. * * @return the formatter settings */ @Override protected final FormatterPrefs getFormatterPrefs() { if (fFormatterPrefs == null) fFormatterPrefs= new FormatterPrefs(fInvocationContext.getProject()); return fFormatterPrefs; }
/** * Returns the method formatter preferences. * * @return the formatter settings */ protected final FormatterPrefs getFormatterPrefs() { if (fFormatterPrefs == null) fFormatterPrefs= new FormatterPrefs(fInvocationContext.getProject()); return fFormatterPrefs; }
@Override protected ProposalInfo computeProposalInfo() { IJavaProject project= fInvocationContext.getProject(); if (project != null) return new MethodProposalInfo(project, fProposal); return super.computeProposalInfo(); }
protected ProposalInfo computeProposalInfo() { IJavaProject project= fInvocationContext.getProject(); if (project != null) return new MethodProposalInfo(project, fProposal); return super.computeProposalInfo(); }
@Override protected ProposalInfo computeProposalInfo() { IJavaProject project= fInvocationContext.getProject(); if (project != null) return new MethodProposalInfo(project, fProposal); return super.computeProposalInfo(); }
@Override protected ProposalInfo computeProposalInfo() { IJavaProject project; if (fCompilationUnit != null) project= fCompilationUnit.getJavaProject(); else project= fInvocationContext.getProject(); if (project != null) { return new PackageProposalInfo(project, fProposal); } return super.computeProposalInfo(); }
@Override protected ProposalInfo computeProposalInfo() { IJavaProject project; if (fCompilationUnit != null) project= fCompilationUnit.getJavaProject(); else project= fInvocationContext.getProject(); if (project != null) return new TypeProposalInfo(project, fProposal); return super.computeProposalInfo(); }
@Override protected ProposalInfo computeProposalInfo() { IJavaProject project; if (fCompilationUnit != null) project= fCompilationUnit.getJavaProject(); else project= fInvocationContext.getProject(); if (project != null) { return new ModuleProposalInfo(project, fProposal); } return super.computeProposalInfo(); } }
public ProcessableAnonymousTypeCompletionProposal(CompletionProposal coreProposal, JavaCompletionProposal uiProposal, JavaContentAssistInvocationContext context) throws JavaModelException { super(context.getProject(), context.getCompilationUnit(), context, coreProposal.getReplaceStart(), uiProposal .getReplacementLength(), String.valueOf(coreProposal.getCompletion()), uiProposal .getStyledDisplayString(), String.valueOf(coreProposal.getDeclarationSignature()), (IType) context .getProject().findElement(String.valueOf(coreProposal.getDeclarationKey()), null), uiProposal .getRelevance()); this.coreProposal = coreProposal; }
@Override protected ProposalInfo computeProposalInfo() { IJavaProject project; if (fCompilationUnit != null) project= fCompilationUnit.getJavaProject(); else project= fInvocationContext.getProject(); if (project != null) return new TypeProposalInfo(project, fProposal); return super.computeProposalInfo(); }
@Override protected ProposalInfo computeProposalInfo() { IJavaProject project; if (fCompilationUnit != null) project= fCompilationUnit.getJavaProject(); else project= fInvocationContext.getProject(); if (project != null) { return new PackageProposalInfo(project, fProposal); } return super.computeProposalInfo(); }
@Override protected ProposalInfo getProposalInfo() { ProposalInfo info = super.getProposalInfo(); if (info == null) { final IJavaProject project = fInvocationContext.getProject(); info = new AnonymousTypeProposalInfo(project, coreProposal); setProposalInfo(info); } return info; }
@Override public List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) { JavaContentAssistInvocationContext jcontext = null; if (context instanceof JavaContentAssistInvocationContext) { jcontext = (JavaContentAssistInvocationContext) context; IJavaProject project = jcontext.getProject(); if (Util.isApiProject(project)) { CompletionContext corecontext = jcontext.getCoreContext(); if (corecontext.isInJavadoc()) { return computeJavadocProposals(jcontext, corecontext); } } } return Collections.EMPTY_LIST; }
@Override protected ProposalInfo getProposalInfo() { ProposalInfo info = super.getProposalInfo(); if (info == null) { final IJavaProject project = subwordsContext.getContext().getProject(); final CompletionProposal proposal = subwordsContext.getProposal(); info = new AnonymousTypeProposalInfo(project, proposal); setProposalInfo(info); } return info; }
public ProcessableOverrideCompletionProposal(CompletionProposal coreProposal, JavaCompletionProposal uiProposal, JavaContentAssistInvocationContext context) { super(context.getProject(), context.getCompilationUnit(), String.valueOf(coreProposal.getName()), computeParamTypes(coreProposal), coreProposal.getReplaceStart(), uiProposal.getReplacementLength(), uiProposal.getStyledDisplayString(), String.valueOf(coreProposal.getCompletion())); this.coreProposal = coreProposal; final Image image = uiProposal.getImage(); setImage(image); setRelevance(uiProposal.getRelevance()); }
public static SwAnonymousTypeCompletionProposal createAnonymousTypeCompletionProposal( final SubwordsProposalContext subwordsContext) throws JavaModelException { final JavaContentAssistInvocationContext context = subwordsContext.getContext(); final CompletionProposal proposal = subwordsContext.getProposal(); final JavaCompletionProposal jdtProposal = subwordsContext.getJdtProposal(); final IJavaProject project = context.getProject(); final String declarationSignature = String.valueOf(proposal.getDeclarationSignature()); final String declarationKey = String.valueOf(proposal.getDeclarationKey()); final String completionText = String.valueOf(proposal.getCompletion()); return new SwAnonymousTypeCompletionProposal(project, context.getCompilationUnit(), context, proposal.getReplaceStart(), jdtProposal.getReplacementLength(), completionText, jdtProposal.getStyledDisplayString(), declarationSignature, (IType) project.findElement(declarationKey, null), jdtProposal.getRelevance(), subwordsContext); }
private IJavaCompletionProposal createTypeProposal(int relevance, String fullyQualifiedType, JavaContentAssistInvocationContext context) throws JavaModelException { IType type= context.getCompilationUnit().getJavaProject().findType(fullyQualifiedType); if (type == null) return null; CompletionProposal proposal= CompletionProposal.create(CompletionProposal.TYPE_REF, context.getInvocationOffset()); proposal.setCompletion(fullyQualifiedType.toCharArray()); proposal.setDeclarationSignature(type.getPackageFragment().getElementName().toCharArray()); proposal.setFlags(type.getFlags()); proposal.setRelevance(relevance); proposal.setReplaceRange(context.getInvocationOffset(), context.getInvocationOffset()); proposal.setSignature(Signature.createTypeSignature(fullyQualifiedType, true).toCharArray()); if (shouldProposeGenerics(context.getProject())) return new LazyGenericTypeProposal(proposal, context); else return new LazyJavaTypeCompletionProposal(proposal, context); }
private IJavaCompletionProposal createTypeProposal(int relevance, String fullyQualifiedType, JavaContentAssistInvocationContext context) throws JavaModelException { IType type= context.getCompilationUnit().getJavaProject().findType(fullyQualifiedType); if (type == null) return null; CompletionProposal proposal= CompletionProposal.create(CompletionProposal.TYPE_REF, context.getInvocationOffset()); proposal.setCompletion(fullyQualifiedType.toCharArray()); proposal.setDeclarationSignature(type.getPackageFragment().getElementName().toCharArray()); proposal.setFlags(type.getFlags()); proposal.setRelevance(relevance); proposal.setReplaceRange(context.getInvocationOffset(), context.getInvocationOffset()); proposal.setSignature(Signature.createTypeSignature(fullyQualifiedType, true).toCharArray()); if (shouldProposeGenerics(context.getProject())) return new LazyGenericTypeProposal(proposal, context); else return new LazyJavaTypeCompletionProposal(proposal, context); }