Example usage for org.springframework.ide.eclipse.core.java FlagsMethodFilter NOT_CONSTRUCTOR

List of usage examples for org.springframework.ide.eclipse.core.java FlagsMethodFilter NOT_CONSTRUCTOR

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.core.java FlagsMethodFilter NOT_CONSTRUCTOR.

Prototype

int NOT_CONSTRUCTOR

To view the source code for org.springframework.ide.eclipse.core.java FlagsMethodFilter NOT_CONSTRUCTOR.

Click Source Link

Usage

From source file:org.dozer.eclipse.plugin.sourcepage.contentassist.DozerContentAssistProcessor.java

private void addGetterSetterMethodProposals(ContentAssistRequest contentAssistRequest, String prefix,
        final String className, boolean onlySetter) {
    if (BeansEditorUtils.getFile(contentAssistRequest) instanceof IFile) {
        final IFile file = BeansEditorUtils.getFile(contentAssistRequest);

        IMethodFilter filter = null;//from  www .  ja v a2  s . c o  m
        if (onlySetter) {
            filter = new FlagsMethodFilter(FlagsMethodFilter.NOT_INTERFACE | FlagsMethodFilter.NOT_CONSTRUCTOR
                    | FlagsMethodFilter.PUBLIC, 1);

        } else {
            filter = new FlagsMethodFilter(FlagsMethodFilter.NOT_VOID | FlagsMethodFilter.NOT_INTERFACE
                    | 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);
    }
}