Search in sources :

Example 1 with GenerateConstructorHandler

use of com.intellij.codeInsight.generation.GenerateConstructorHandler in project intellij-community by JetBrains.

the class GenerateConstructorTest method doTest.

private void doTest(boolean preSelect) {
    String name = getTestName(false);
    myFixture.configureByFile("before" + name + ".java");
    new GenerateConstructorHandler() {

        @Override
        protected ClassMember[] chooseMembers(ClassMember[] members, boolean allowEmpty, boolean copyJavadoc, Project project, Editor editor) {
            if (preSelect) {
                List<ClassMember> preselection = GenerateConstructorHandler.preselect(members);
                return preselection.toArray(new ClassMember[preselection.size()]);
            } else {
                return members;
            }
        }
    }.invoke(getProject(), getEditor(), getFile());
    myFixture.checkResultByFile("after" + name + ".java");
}
Also used : Project(com.intellij.openapi.project.Project) List(java.util.List) Editor(com.intellij.openapi.editor.Editor) ClassMember(com.intellij.codeInsight.generation.ClassMember) GenerateConstructorHandler(com.intellij.codeInsight.generation.GenerateConstructorHandler)

Aggregations

ClassMember (com.intellij.codeInsight.generation.ClassMember)1 GenerateConstructorHandler (com.intellij.codeInsight.generation.GenerateConstructorHandler)1 Editor (com.intellij.openapi.editor.Editor)1 Project (com.intellij.openapi.project.Project)1 List (java.util.List)1