Examples of MethodContentAssistCalculator


Examples of org.springframework.ide.eclipse.beans.ui.editor.contentassist.MethodContentAssistCalculator

            | FlagsMethodFilter.NOT_CONSTRUCTOR
            | FlagsMethodFilter.PUBLIC);
      }
 

      IContentAssistCalculator calculator = new MethodContentAssistCalculator(filter) {

        @Override
        protected IType calculateType(IContentAssistContext context) {
          return JdtUtils.getJavaType(file.getProject(), className);
        }
      };
     
      IContentAssistProposalRecorder recorder = new DefaultContentAssistProposalRecorder(contentAssistRequest);
      IContentAssistContext context = new DefaultContentAssistContext(contentAssistRequest, "xyz", //FIXME
          prefix);         
     
      calculator.computeProposals(context, recorder); //request, prefix, null, null, null);
    }
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.contentassist.MethodContentAssistCalculator

    else {
      filter = new FlagsMethodFilter(FlagsMethodFilter.NOT_VOID
          | FlagsMethodFilter.NOT_INTERFACE | FlagsMethodFilter.NOT_CONSTRUCTOR);
    }

    IContentAssistCalculator calculator = new MethodContentAssistCalculator(filter) {
     
      @Override
      public void computeProposals(IContentAssistContext context,
          IContentAssistProposalRecorder recorder) {
        super.computeProposals(context, recorder);
       
        IType type = calculateType(context);
        try {
          // Add special valueOf methods for Enum types
          if (type != null && type.isEnum()) {
            IFile contextFile = context.getFile();
            if (contextFile != null && contextFile.exists()) {
              IType enumType = JdtUtils.getJavaType(context.getFile().getProject(), Enum.class.getName());
              Set<String> proposedMethods = new HashSet<String>();
              for (IMethod method : Introspector.findAllMethods(enumType, context
                  .getMatchString(), filter)) {
                if (!proposedMethods.contains(method.getElementName())) {
                  proposedMethods.add(method.getElementName());
                  createMethodProposal(recorder, method);
                }
              }
            }
          }
        }
        catch (JavaModelException e) {
        }
      }

      @Override
      protected IType calculateType(IContentAssistContext context) {
        if (file != null && file.exists()) {
          return JdtUtils.getJavaType(file.getProject(), factoryClassName);
        }
        return null;
      }
    };

    calculator.computeProposals(context, recorder);
  }
View Full Code Here

Examples of org.springframework.ide.eclipse.beans.ui.editor.contentassist.MethodContentAssistCalculator

    registerContentAssistCalculator("property-placeholder", "defaults-ref", beanRef);

    ClassContentAssistCalculator classRef = new ClassContentAssistCalculator();
    registerContentAssistCalculator("interface", classRef);

    MethodContentAssistCalculator methodRef = new RegistrationMethodContentAssistCalculator();
    registerContentAssistCalculator("registration-method", methodRef);
    registerContentAssistCalculator("unregistration-method", methodRef);
   
    ReferenceIdContentAssistCalculator id = new ReferenceIdContentAssistCalculator();
    registerContentAssistCalculator("reference", "id", id);
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.