Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.ICompilationUnit.codeComplete()


        ICompilationUnit unit = new WorkingCopyOwner() {
        }.newWorkingCopy(name, entries, null, new NullProgressMonitor());
        unit.getBuffer().setContents(contents);
        CompletionProposalCollector collector = createCollector(filterCompletionName, ret, unit);

        unit.codeComplete(completionOffset, collector); //fill the completions while searching it
        return ret;
    }

    @Override
    public boolean equals(Object obj) {
View Full Code Here


  {
    ICompilationUnit src = JavaUtils.getCompilationUnit(project, file);

    CompletionProposalCollector collector =
      new CompletionProposalCollector(src);
    src.codeComplete(offset, collector);

    IJavaCompletionProposal[] proposals =
      collector.getJavaCompletionProposals();
    ArrayList<CodeCompleteResult> results = new ArrayList<CodeCompleteResult>();
    for(IJavaCompletionProposal proposal : proposals){
View Full Code Here

      CompletionProposalCollector collector = new CompletionProposalCollector(project);
      ICompilationUnit unit = FieldAssistUtils.getTemporaryCompilationUnit(project);
      contents = contents.substring(0, position);
      String source = "package " + contents;
      FieldAssistUtils.setContentsToCU(unit, source);
      unit.codeComplete(source.length(), collector, DefaultWorkingCopyOwner.PRIMARY);
      IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
      List<IContentProposal> result = new ArrayList<IContentProposal>();
     
      for(int j=0;j<proposals.length;j++){
        if(proposals[j].getImage()!=null){
View Full Code Here

      }
     
      String source = "public class _xxx { public static void hoge(){ " + contents + "}}";
     
      FieldAssistUtils.setContentsToCU(unit, source);
      unit.codeComplete(source.length() - 2, collector, DefaultWorkingCopyOwner.PRIMARY);
      IJavaCompletionProposal[] proposals = collector.getJavaCompletionProposals();
      List<IContentProposal> result = new ArrayList<IContentProposal>();
     
      for(int j = 0; j < proposals.length; j++){
        if(proposals[j].getImage()!=null){
View Full Code Here

        }
        String source = sourceStart + CLASS_SOURCE_END;
        setContents(unit, source);
 
        BeansJavaCompletionProposalCollector collector = new BeansJavaCompletionProposalCollector(unit, flags);
        unit.codeComplete(sourceStart.length(), collector, DefaultWorkingCopyOwner.PRIMARY);
 
        IJavaCompletionProposal[] props = collector.getJavaCompletionProposals();
 
        ICompletionProposal[] proposals = order(props);
        for (ICompletionProposal comProposal : proposals) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.