use of com.intellij.refactoring.introduceField.LocalToFieldHandler in project intellij-community by JetBrains.
the class IntroduceFieldWitSetUpInitializationTest method doTest.
private void doTest() throws Exception {
configureByFile("/refactoring/introduceField/before" + getTestName(false) + ".java");
final PsiLocalVariable local = PsiTreeUtil.getParentOfType(getFile().findElementAt(getEditor().getCaretModel().getOffset()), PsiLocalVariable.class);
new LocalToFieldHandler(getProject(), false) {
@Override
protected BaseExpressionToFieldHandler.Settings showRefactoringDialog(final PsiClass aClass, final PsiLocalVariable local, final PsiExpression[] occurences, final boolean isStatic) {
return new BaseExpressionToFieldHandler.Settings("i", null, occurences, true, false, false, BaseExpressionToFieldHandler.InitializationPlace.IN_SETUP_METHOD, PsiModifier.PRIVATE, local, local.getType(), true, (BaseExpressionToFieldHandler.TargetDestination) null, false, false);
}
}.convertLocalToField(local, myEditor);
checkResultByFile("/refactoring/introduceField/after" + getTestName(false) + ".java");
}
Aggregations