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

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

Introduction

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

Prototype

int PUBLIC

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

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  .jav  a 2s.  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);
    }
}