Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.CompletionProposal


        //TODO: FIXME: this is very fragile as it uses reflection to access the private completion field.
        //Yet this is needed to do mvel filtering based on the method signtures, IF we use the richer JDT completion
        Object field = ReflectionUtils.getField( o,
                                                 "fProposal" );
        if ( field != null && field instanceof CompletionProposal ) {
            CompletionProposal proposal = (CompletionProposal) field;

            String completion = new String( proposal.getCompletion() );

            String propertyOrMethodName = null;

            boolean isSetter = false;
            boolean isAccessor = false;
            if ( settersOnly ) {
                // get the eventual writable property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getWritablePropertyName( completion,
                                                                               proposal.getSignature() );
                //                      if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isSetter = !completion.equals( propertyOrMethodName );

            } else {
                // get the eventual property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getPropertyName( completion,
                                                                       proposal.getSignature() );
                //if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isAccessor = !completion.equals( propertyOrMethodName );
            }
View Full Code Here


        LazyJavaCompletionProposal javaProposal = (LazyJavaCompletionProposal) o;
        //TODO: FIXME: this is very fragile as it uses reflection to access the private completion field.
        //Yet this is needed to do mvel filtering based on the method signtures, IF we use the richer JDT completion
        Object field = ReflectionUtils.getField(o, "fProposal");
        if ( field != null && field instanceof CompletionProposal ) {
            CompletionProposal proposal = (CompletionProposal) field;

            String completion = new String( proposal.getCompletion() );

            String propertyOrMethodName = null;

            boolean isSetter = false;
            boolean isAccessor = false;
            if ( settersOnly ) {
                // get the eventual writable property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getWritablePropertyName( completion,
                                                                               proposal.getSignature() );
                //                      if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isSetter = !completion.equals( propertyOrMethodName );

            } else {
                // get the eventual property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getPropertyName( completion,
                                                                       proposal.getSignature() );
                //if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isAccessor = !completion.equals( propertyOrMethodName );
            }
View Full Code Here

        //TODO: FIXME: this is very fragile as it uses reflection to access the private completion field.
        //Yet this is needed to do mvel filtering based on the method signtures, IF we use the richer JDT completion
        Object field = ReflectionUtils.getField( o,
                                                 "fProposal" );
        if ( field != null && field instanceof CompletionProposal ) {
            CompletionProposal proposal = (CompletionProposal) field;

            String completion = new String( proposal.getCompletion() );

            String propertyOrMethodName = null;

            boolean isSetter = false;
            boolean isAccessor = false;
            if ( settersOnly ) {
                // get the eventual writable property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getWritablePropertyName( completion,
                                                                               proposal.getSignature() );
                //                      if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isSetter = !completion.equals( propertyOrMethodName );

            } else {
                // get the eventual property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getPropertyName( completion,
                                                                       proposal.getSignature() );
                //if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isAccessor = !completion.equals( propertyOrMethodName );
            }
View Full Code Here

          relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); // no access restriction for keywords
          relevance += R_ANNOTATION; // this proposal is most relevant than annotation proposals

          this.noProposal = false;
          if(!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
            CompletionProposal proposal = createProposal(CompletionProposal.KEYWORD, this.actualCompletionPosition);
            proposal.setName(Keywords.INTERFACE);
            proposal.setCompletion(Keywords.INTERFACE);
            proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
            proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);
            proposal.setRelevance(relevance);
            this.requestor.accept(proposal);
            if(DEBUG) {
              this.printDebug(proposal);
            }
          }
View Full Code Here

      relevance += computeRelevanceForQualification(false);
      relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);

      this.noProposal = false;
      if(!this.requestor.isIgnored(CompletionProposal.ANNOTATION_ATTRIBUTE_REF)) {
        CompletionProposal proposal = createProposal(CompletionProposal.ANNOTATION_ATTRIBUTE_REF, this.actualCompletionPosition);
        proposal.setDeclarationSignature(getSignature(method.declaringClass));
        proposal.setSignature(getSignature(method.returnType));
        proposal.setName(method.selector);
        proposal.setCompletion(method.selector);
        proposal.setFlags(method.modifiers);
        proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
        proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);
        proposal.setRelevance(relevance);
        this.requestor.accept(proposal);
        if(DEBUG) {
          this.printDebug(proposal);
        }
      }
View Full Code Here

    fProposals.add(proposal);
  }


  private Image calculateImage(int modifiers) {
    CompletionProposal p = CompletionProposal.create(CompletionProposal.TYPE_REF, getJSPOffset());
    p.setFlags(modifiers);
   
    //https://bugs.eclipse.org/bugs/show_bug.cgi?id=102206
    char[] sig = new char[]{Signature.C_UNRESOLVED};
    p.setSignature(sig);
   
    ImageDescriptor descriptor = fLabelProvider.createImageDescriptor(p);
    Image image = JSPEditorPluginImageHelper.getInstance().getImage(descriptor);
    return image;
  }
View Full Code Here

        //TODO: FIXME: this is very fragile as it uses reflection to access the private completion field.
        //Yet this is needed to do mvel filtering based on the method signtures, IF we use the richer JDT completion
        Object field = ReflectionUtils.getField( o,
                                                 "fProposal" );
        if ( field != null && field instanceof CompletionProposal ) {
            CompletionProposal proposal = (CompletionProposal) field;

            String completion = new String( proposal.getCompletion() );

            String propertyOrMethodName = null;

            boolean isSetter = false;
            boolean isAccessor = false;
            if ( settersOnly ) {
                // get the eventual writable property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getWritablePropertyName( completion,
                                                                               proposal.getSignature() );
                //                      if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isSetter = !completion.equals( propertyOrMethodName );

            } else {
                // get the eventual property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getPropertyName( completion,
                                                                       proposal.getSignature() );
                //if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isAccessor = !completion.equals( propertyOrMethodName );
            }
View Full Code Here

        //TODO: FIXME: this is very fragile as it uses reflection to access the private completion field.
        //Yet this is needed to do mvel filtering based on the method signtures, IF we use the richer JDT completion
        Object field = ReflectionUtils.getField( o,
                                                 "fProposal" );
        if ( field != null && field instanceof CompletionProposal ) {
            CompletionProposal proposal = (CompletionProposal) field;

            String completion = new String( proposal.getCompletion() );

            String propertyOrMethodName = null;

            boolean isSetter = false;
            boolean isAccessor = false;
            if ( settersOnly ) {
                // get the eventual writable property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getWritablePropertyName( completion,
                                                                               proposal.getSignature() );
                //                      if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isSetter = !completion.equals( propertyOrMethodName );

            } else {
                // get the eventual property name for that method name and signature
                propertyOrMethodName = CompletionUtil.getPropertyName( completion,
                                                                       proposal.getSignature() );
                //if we got a property name that differs from the orginal method name
                //then this is a bean accessor
                isAccessor = !completion.equals( propertyOrMethodName );
            }
View Full Code Here

          relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE); // no access restriction for keywords
          relevance += R_ANNOTATION; // this proposal is most relevant than annotation proposals

          this.noProposal = false;
          if(!this.requestor.isIgnored(CompletionProposal.KEYWORD)) {
            CompletionProposal proposal = createProposal(CompletionProposal.KEYWORD, this.actualCompletionPosition);
            proposal.setName(Keywords.INTERFACE);
            proposal.setCompletion(Keywords.INTERFACE);
            proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
            proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);
            proposal.setRelevance(relevance);
            this.requestor.accept(proposal);
            if(DEBUG) {
              this.printDebug(proposal);
            }
          }
View Full Code Here

      relevance += computeRelevanceForQualification(false);
      relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);

      this.noProposal = false;
      if(!this.requestor.isIgnored(CompletionProposal.ANNOTATION_ATTRIBUTE_REF)) {
        CompletionProposal proposal = createProposal(CompletionProposal.ANNOTATION_ATTRIBUTE_REF, this.actualCompletionPosition);
        proposal.setDeclarationSignature(getSignature(method.declaringClass));
        proposal.setSignature(getSignature(method.returnType));
        proposal.setName(method.selector);
        proposal.setCompletion(method.selector);
        proposal.setFlags(method.modifiers);
        proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);
        proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);
        proposal.setRelevance(relevance);
        this.requestor.accept(proposal);
        if(DEBUG) {
          this.printDebug(proposal);
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.CompletionProposal

Copyright © 2018 www.massapicom. 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.