@Override protected void saveSettings(@NotNull PsiVariable psiVariable) { super.saveSettings(psiVariable); JavaRefactoringSettings.getInstance().INTRODUCE_FIELD_VISIBILITY = myIntroduceFieldPanel.getFieldVisibility(); myIntroduceFieldPanel.saveFinalState(); }
protected void performIntroduce() { ourLastInitializerPlace = myIntroduceFieldPanel.getInitializerPlace(); final GosuBaseExpressionToFieldHandler.Settings settings = new GosuBaseExpressionToFieldHandler.Settings( getInputName(), getExpr(), getOccurrences(), myIntroduceFieldPanel.isReplaceAllOccurrences(), myStatic, myIntroduceFieldPanel.isDeclareFinal(), myIntroduceFieldPanel.getInitializerPlace(), myIntroduceFieldPanel.getFieldVisibility(), (PsiLocalVariable) getLocalVariable(), getType(), myIntroduceFieldPanel.isDeleteVariable(), myParentClass, false, false); new WriteCommandAction(myProject, getCommandName(), getCommandName()) { @Override protected void run(Result result) throws Throwable { if (getLocalVariable() != null) { final GosuLocalToFieldHandler.IntroduceFieldRunnable fieldRunnable = new GosuLocalToFieldHandler.IntroduceFieldRunnable( false, (PsiLocalVariable) getLocalVariable(), myParentClass, settings, myStatic, myOccurrences); fieldRunnable.run(); } else { final GosuBaseExpressionToFieldHandler.ConvertToFieldRunnable convertToFieldRunnable = new GosuBaseExpressionToFieldHandler.ConvertToFieldRunnable( myExpr, settings, settings.getForcedType(), myOccurrences, myOccurrenceManager, getAnchorElementIfAll(), getAnchorElement(), myEditor, myParentClass); convertToFieldRunnable.run(); } } }.execute(); }