Examples of ICompletionProposal


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

     * The match is based on the first token based on a space split
     */
    public static boolean containsProposal(final Collection proposals,
                                           String newProposal) {
        for ( Iterator iter = proposals.iterator(); iter.hasNext(); ) {
            ICompletionProposal prop = (ICompletionProposal) iter.next();
            String displayString = prop.getDisplayString();
            String[] existings = displayString.split( " " );
            if ( existings.length == 0 ) {
                continue;
            }

View Full Code Here

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

    String proposalText = displayString + space() + EQUAL + space();
    Object value = defaultValueOf(optionSource);
    if (value != null) {
      proposalText = proposalText + value;
    }
    ICompletionProposal proposal = createCompletionProposal(proposalText, displayString, imageForOption(), context);
    if (value == EMPTY_STRING && proposal instanceof ConfigurableCompletionProposal) {
      // set cursor between the proposal's quotes
      ConfigurableCompletionProposal configurable = (ConfigurableCompletionProposal) proposal;
      configurable.setCursorPosition(proposalText.length() - 1);
    }
View Full Code Here

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

    createAndAccept(EMPTY_STRING, 1, context, acceptor);
  }

  private void createAndAccept(CompoundElement display, int cursorPosition, ContentAssistContext context,
      ICompletionProposalAcceptor acceptor) {
    ICompletionProposal proposal = createCompletionProposal(display, context);
    if (proposal instanceof ConfigurableCompletionProposal) {
      ConfigurableCompletionProposal configurable = (ConfigurableCompletionProposal) proposal;
      configurable.setCursorPosition(cursorPosition);
    }
    acceptor.accept(proposal);
View Full Code Here

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

    String lastSegment = name.getLastSegment();
    if (!isEmpty(displayFormat)) {
      lastSegment = String.format(displayFormat, lastSegment);
    }
    String display = String.format("%s - %s", lastSegment, name.toString());
    ICompletionProposal proposal = createCompletionProposal(proposalText, display, image, context);
    acceptor.accept(proposal);
  }
View Full Code Here

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

    acceptor.accept(proposal);
  }

  private void proposeAndAccept(String proposalText, Image image, ContentAssistContext context,
      ICompletionProposalAcceptor acceptor) {
    ICompletionProposal proposal = createCompletionProposal(proposalText, proposalText, image, context);
    acceptor.accept(proposal);
  }
View Full Code Here

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

    final IModelElement element = editor.getInputModelElement();
    final IScriptProject scriptProject = element.getScriptProject();
    List proposals = null;
    for (int i = 0; i < annotations.length; i++) {
      final Annotation annotation = annotations[i];
      ICompletionProposal proposal = null;
      if (annotation instanceof MarkerAnnotation) {
        MarkerAnnotation mAnnot = (MarkerAnnotation) annotation;
        IMarker marker = mAnnot.getMarker();
        if (isFixable(marker)) {
          final String pkgName = CorrectionEngine.getProblemArguments(marker)[0];
View Full Code Here

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

   * @param prop the list of ICompletionProposal
   */
  public static void sortCompilationProposal(List prop){
    Collections.sort(prop,new Comparator(){
      public int compare(Object o1,Object o2){
        ICompletionProposal c1 = (ICompletionProposal)o1;
        ICompletionProposal c2 = (ICompletionProposal)o2;
        return c1.getDisplayString().compareTo(c2.getDisplayString());
      }
    });
  }
View Full Code Here

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

    List importProposals = new ArrayList();
    ICompletionProposal[] proposals = getJSPJavaCompletionProposals(viewer, documentPosition);
    for (int i = 0; i < proposals.length; i++) {
      if (proposals[i] instanceof JSPCompletionProposal) {

        ICompletionProposal importProposal = adjustImportProposal((JSPCompletionProposal) proposals[i]);
        importProposals.add(importProposal);
      }
    }
    return (ICompletionProposal[]) importProposals.toArray(new ICompletionProposal[importProposals.size()]);
  }
View Full Code Here

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

  private ICompletionProposal[] getJSPJavaBeanProposals(ITextViewer viewer, int documentPosition) {
    ICompletionProposal[] regularJSPResults = getJSPJavaCompletionProposals(viewer, documentPosition);
    Vector filteredProposals = new Vector();
    ICompletionProposal[] finalResults = EMPTY_PROPOSAL_SET;
    for (int i = 0; i < regularJSPResults.length; i++) {
      ICompletionProposal test = regularJSPResults[i];

      System.out.println("proposal > " + test.getDisplayString()); //$NON-NLS-1$
      System.out.println("relevance > " + ((CustomCompletionProposal) test).getRelevance()); //$NON-NLS-1$

      if (isRelevanceAllowed(((CustomCompletionProposal) test).getRelevance())) {
        filteredProposals.add(test);
      }
View Full Code Here

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

    fJavaCompletionProposal = javaCompletionProposal;
  }
 
  public String getAdditionalProposalInfo() {
    String additionalInfo = super.getAdditionalProposalInfo();
    ICompletionProposal javaProposal = getJavaCompletionProposal();
    if(javaProposal != null)
      additionalInfo = javaProposal.getAdditionalProposalInfo();
   
    return additionalInfo;
  }
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.