Examples of IJavaCompletionProposal


Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

      StyledString displayName = new StyledString("it : " + paramType.getName());
      displayName.append(" - Access the mocked object 'it' of type '"
          + paramType.getName() +"'", QUALIFIER_STYLER);

      IJavaCompletionProposal proposal
      = new JavaCompletionProposal(relpacement, context.getInvocationOffset()-prefix.length(), prefix.length(),
          image, displayName, MockMethodCompletionProposal.MAX_RELEVANCE);
      list.add(proposal );
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

    offset = fTranslation.getJspOffset(offset);
    // cursor position after must be calculated
    int positionAfter = calculatePositionAfter(proposal, newCompletion, offset);
   
    // from java proposal
    IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
    proposal.getDeclarationSignature();
    Image image = javaProposal.getImage();
    String displayString = javaProposal.getDisplayString();
    displayString = getTranslation().fixupMangledName(displayString);
    IContextInformation contextInformation = javaProposal.getContextInformation();
    // don't do this, it's slow
    // String additionalInfo = javaProposal.getAdditionalProposalInfo();
    int relevance = javaProposal.getRelevance();
   
    boolean updateLengthOnValidate = true;
   
    jspProposal = new AutoImportProposal(completion, fImportContainer, newCompletion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
   
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

    offset = fTranslation.getJspOffset(offset);
    // cursor position after must be calculated
    int positionAfter = calculatePositionAfter(proposal, completion, offset);
   
    // from java proposal
    IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
    proposal.getDeclarationSignature();
    Image image = javaProposal.getImage();
    String displayString = javaProposal.getDisplayString();
    displayString = getTranslation().fixupMangledName(displayString);
    IContextInformation contextInformation = javaProposal.getContextInformation();
    // String additionalInfo = javaProposal.getAdditionalProposalInfo();
   
    /* the context information is calculated with respect to the java document
     * thus it needs to be updated in respect of the JSP document.
     */
    if(contextInformation instanceof ProposalContextInformation) {
      ProposalContextInformation proposalInfo = (ProposalContextInformation)contextInformation;
      int contextInfoJSPOffset = fTranslation.getJspOffset(proposalInfo.getContextInformationPosition());
      proposalInfo.setContextInformationPosition(contextInfoJSPOffset);
    }
   
    int relevance = javaProposal.getRelevance();
   
    boolean updateLengthOnValidate = true;
   
    jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
   
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

    offset = fTranslation.getJspOffset(offset);
    // cursor position after must be calculated
    int positionAfter = calculatePositionAfter(proposal, completion, offset);
   
    // from java proposal
    IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
    proposal.getDeclarationSignature();
    Image image = javaProposal.getImage();
    String displayString = javaProposal.getDisplayString();
    displayString = getTranslation().fixupMangledName(displayString);
    IContextInformation contextInformation = javaProposal.getContextInformation();
    // String additionalInfo = javaProposal.getAdditionalProposalInfo();
   
    /* the context information is calculated with respect to the java document
     * thus it needs to be updated in respect of the JSP document.
     */
    if(contextInformation instanceof ProposalContextInformation) {
      ProposalContextInformation proposalInfo = (ProposalContextInformation)contextInformation;
      int contextInfoJSPOffset = fTranslation.getJspOffset(proposalInfo.getContextInformationPosition());
      proposalInfo.setContextInformationPosition(contextInfoJSPOffset);
    }
   
    int relevance = javaProposal.getRelevance();
   
    boolean updateLengthOnValidate = true;
   
    jspProposal = new JSPMethodCompletionProposal(proposal, fTranslation.getJavaProject(), completion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
   
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

    offset = fTranslation.getJspOffset(offset);
    // cursor position after must be calculated
    int positionAfter = calculatePositionAfter(proposal, newCompletion, offset);
   
    // from java proposal
    IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
    proposal.getDeclarationSignature();
    Image image = javaProposal.getImage();
    String displayString = javaProposal.getDisplayString();
    displayString = getTranslation().fixupMangledName(displayString);
    IContextInformation contextInformation = javaProposal.getContextInformation();
    // don't do this, it's slow
    // String additionalInfo = javaProposal.getAdditionalProposalInfo();
    int relevance = javaProposal.getRelevance();
   
    boolean updateLengthOnValidate = true;
   
    jspProposal = new AutoImportProposal(completion, fImportContainer, newCompletion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
   
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

    offset = fTranslation.getJspOffset(offset);
    // cursor position after must be calculated
    int positionAfter = calculatePositionAfter(proposal, completion, offset);
   
    // from java proposal
    IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
    proposal.getDeclarationSignature();
    Image image = javaProposal.getImage();
    String displayString = javaProposal.getDisplayString();
    displayString = getTranslation().fixupMangledName(displayString);
    IContextInformation contextInformation = javaProposal.getContextInformation();
    // String additionalInfo = javaProposal.getAdditionalProposalInfo();
   
    /* the context information is calculated with respect to the java document
     * thus it needs to be updated in respect of the JSP document.
     */
    if(contextInformation instanceof ProposalContextInformation) {
      ProposalContextInformation proposalInfo = (ProposalContextInformation)contextInformation;
      int contextInfoJSPOffset = fTranslation.getJspOffset(proposalInfo.getContextInformationPosition());
      proposalInfo.setContextInformationPosition(contextInfoJSPOffset);
    }
   
    int relevance = javaProposal.getRelevance();
   
    boolean updateLengthOnValidate = true;
   
    jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, null, relevance, updateLengthOnValidate);
   
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

     
      // cursor position after must be calculated
      int positionAfter = offset + completion.length();
       
      // from java proposal
      IJavaCompletionProposal javaProposal = super.createJavaCompletionProposal(proposal);
      Image image = null;
      String longDisplayString = javaProposal.getDisplayString();
      int fistSpaceIndex = longDisplayString.indexOf(' ');
      String shortDisplayString = longDisplayString;
     
      if(fistSpaceIndex != -1) {
        shortDisplayString = longDisplayString.substring(fistSpaceIndex);
      }
       
      String displayString = completion + " " + shortDisplayString; //$NON-NLS-1$
      IContextInformation contextInformation = javaProposal.getContextInformation();
      String additionalInfo = javaProposal.getAdditionalProposalInfo();
      int relevance = javaProposal.getRelevance();
     
      boolean updateLengthOnValidate = true;
     
      jspProposal = new JSPCompletionProposal(completion, offset, length, positionAfter, image, displayString, contextInformation, additionalInfo, relevance, updateLengthOnValidate);
     
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

        // change the name lookup of the completion proposal with woj one
        NameLookup nameLookup = (NameLookup)HookUtil.getPrivateAttributeValue(InternalCompletionProposal.class, "nameLookup", proposal); //$NON-NLS-1$
        if(!HookUtil.setPrivateAttributeValue(InternalCompletionProposal.class, "nameLookup", proposal, new WojNameLookup(nameLookup))) { //$NON-NLS-1$
          WojPlugin.log("exception occured while installing completion"); //$NON-NLS-1$
        }
        IJavaCompletionProposal p = super.createJavaCompletionProposal(proposal);
        return p;
    }
View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

             * Override the java proposal creation to always return null, as we'll keep just what we actually need.
             */
            @SuppressWarnings("restriction")
            @Override
            public IJavaCompletionProposal createJavaCompletionProposal(CompletionProposal proposal) {
                IJavaCompletionProposal javaCompletionProposal = super.createJavaCompletionProposal(proposal);
                if (javaCompletionProposal instanceof AbstractJavaCompletionProposal) {
                    AbstractJavaCompletionProposal prop = (AbstractJavaCompletionProposal) javaCompletionProposal;
                    IJavaElement javaElement = prop.getJavaElement();
                    if (javaElement != null) {

View Full Code Here

Examples of org.eclipse.jdt.ui.text.java.IJavaCompletionProposal

    List<IJavaCompletionProposal> proposals = getProposals(label, invocationOffset);
    assertTrue(proposals.size() == expectedProposalCount);

    if (proposals.size() > 0) {
      assertTrue(expectedString != null);
      IJavaCompletionProposal proposal = proposals.get(0);
      String returnedString = stripString(proposal.getAdditionalProposalInfo());
      checkResults(returnedString, expectedString);
    }

  }
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.