Examples of IContentAssistProcessor


Examples of org.eclipse.jface.text.contentassist.IContentAssistProcessor

  @Override
  protected ICompletionProposal[] getCompletionProposals(
      CommandLine commandLine, String project, String file, int offset)
    throws Exception
  {
    IContentAssistProcessor processor =
      getContentAssistProcessor(commandLine, project, file);

    IFile ifile = ProjectUtils.getFile(
        ProjectUtils.getProject(project, true), file);

    IStructuredModel model =
      StructuredModelManager.getModelManager().getModelForRead(ifile);

    if (model != null){
      StructuredTextViewer viewer = new StructuredTextViewer(
          EclimPlugin.getShell(), null, null, false, 0){
        private Point point;
        public Point getSelectedRange()
        {
          return point;
        }
        public void setSelectedRange(int x, int y)
        {
          point = new Point(x, y);
        }
      };
      viewer.setDocument(model.getStructuredDocument());
      // note: non-zero length can break html completion.
      viewer.setSelectedRange(offset, 0);

      ICompletionProposal[] proposals =
        processor.computeCompletionProposals(viewer, offset);
      model.releaseFromRead();
      return proposals;
    }
    return new ICompletionProposal[0];
  }
View Full Code Here

Examples of org.eclipse.jface.text.contentassist.IContentAssistProcessor

   */
  protected ICompletionProposal[] getCompletionProposals(
      CommandLine commandLine, String project, String file, int offset)
    throws Exception
  {
    IContentAssistProcessor processor =
      getContentAssistProcessor(commandLine, project, file);

    ITextViewer viewer = getTextViewer(commandLine, project, file);

    if (processor != null && viewer != null){
      return processor.computeCompletionProposals(viewer, offset);
    }
    return new ICompletionProposal[0];
  }
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.