Beispiel #1
0
 public JavaElementToken(
     String rep,
     String doc,
     String args,
     String parentPackage,
     int type,
     IJavaElement javaElement,
     CompletionProposal completionProposal) {
   super(rep, doc, args, parentPackage, type, null);
   this.javaElement = javaElement;
   this.completionProposalKind = completionProposal.getKind();
   this.completionProposalFlags = completionProposal.getFlags();
   if (HAS_ADDITIONAL_FLAGS) {
     this.completionProposalAdditionalFlags = completionProposal.getAdditionalFlags();
   }
   this.completionPropsoalSignature = completionProposal.getSignature();
 }
 @Override
 public void process(IProcessableProposal proposal) {
   CompletionProposal cProposal = proposal.getCoreProposal().or(NULL_PROPOSAL);
   switch (cProposal.getKind()) {
     case CompletionProposal.METHOD_DECLARATION:
       final String signature = String.valueOf(cProposal.getSignature()).replace('.', '/');
       final String name = String.valueOf(cProposal.getName());
       final String propSignature = (name + signature).replaceAll("<\\.>", "");
       for (final OverridesRecommendation r : recommendations) {
         final String recSignature = r.method.getSignature();
         if (recSignature.equals(propSignature)) {
           final int percentage = (int) rint(r.probability * 100);
           int increment = 100 + percentage << 3;
           String label = percentage + "%";
           ProposalProcessorManager mgr = proposal.getProposalProcessorManager();
           mgr.addProcessor(new SimpleProposalProcessor(increment, label));
         }
       }
   }
 }