Search in sources :

Example 1 with IntroduceOccurrencesChooser

use of org.jetbrains.plugins.groovy.refactoring.introduce.IntroduceOccurrencesChooser in project intellij-community by JetBrains.

the class GrIntroduceParameterHandler method showDialogOrStartInplace.

//method to hack in tests
protected void showDialogOrStartInplace(@NotNull final IntroduceParameterInfo info, @NotNull final Editor editor) {
    if (isInplace(info, editor)) {
        final GrIntroduceContext context = createContext(info, editor);
        Map<OccurrencesChooser.ReplaceChoice, List<Object>> occurrencesMap = GrIntroduceHandlerBase.fillChoice(context);
        new IntroduceOccurrencesChooser(editor).showChooser(new Pass<OccurrencesChooser.ReplaceChoice>() {

            @Override
            public void pass(OccurrencesChooser.ReplaceChoice choice) {
                startInplace(info, context, choice);
            }
        }, occurrencesMap);
    } else {
        showDialog(info);
    }
}
Also used : GrIntroduceContext(org.jetbrains.plugins.groovy.refactoring.introduce.GrIntroduceContext) IntroduceOccurrencesChooser(org.jetbrains.plugins.groovy.refactoring.introduce.IntroduceOccurrencesChooser) ArrayList(java.util.ArrayList) List(java.util.List) IntroduceOccurrencesChooser(org.jetbrains.plugins.groovy.refactoring.introduce.IntroduceOccurrencesChooser) OccurrencesChooser(com.intellij.refactoring.introduce.inplace.OccurrencesChooser)

Aggregations

OccurrencesChooser (com.intellij.refactoring.introduce.inplace.OccurrencesChooser)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 GrIntroduceContext (org.jetbrains.plugins.groovy.refactoring.introduce.GrIntroduceContext)1 IntroduceOccurrencesChooser (org.jetbrains.plugins.groovy.refactoring.introduce.IntroduceOccurrencesChooser)1