use of com.intellij.refactoring.JavaRefactoringSettings in project intellij-community by JetBrains.
the class GrIntroduceParameterDialog method init.
@Override
protected void init() {
super.init();
JavaRefactoringSettings settings = JavaRefactoringSettings.getInstance();
initReplaceFieldsWithGetters(settings);
myDeclareFinalCheckBox.setSelected(hasFinalModifier());
myDelegateViaOverloadingMethodCheckBox.setVisible(myInfo.getToSearchFor() != null);
setTitle(RefactoringBundle.message("introduce.parameter.title"));
myTable.init(myInfo);
final GrParameter[] parameters = myInfo.getToReplaceIn().getParameters();
toRemoveCBs.forEachEntry(new TObjectIntProcedure<JCheckBox>() {
@Override
public boolean execute(JCheckBox checkbox, int index) {
checkbox.setSelected(true);
final GrParameter param = parameters[index];
final ParameterInfo pinfo = findParamByOldName(param.getName());
if (pinfo != null) {
pinfo.passAsParameter = false;
}
return true;
}
});
updateSignature();
if (myCanIntroduceSimpleParameter) {
mySignaturePanel.setVisible(false);
//action to hide signature panel if we have variants to introduce simple parameter
myTypeComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
mySignaturePanel.setVisible(myTypeComboBox.isClosureSelected());
pack();
}
});
}
final PsiType closureReturnType = inferClosureReturnType();
if (PsiType.VOID.equals(closureReturnType)) {
myForceReturnCheckBox.setEnabled(false);
myForceReturnCheckBox.setSelected(false);
} else {
myForceReturnCheckBox.setSelected(isForceReturn());
}
if (myInfo.getToReplaceIn() instanceof GrClosableBlock) {
myDelegateViaOverloadingMethodCheckBox.setEnabled(false);
myDelegateViaOverloadingMethodCheckBox.setToolTipText("Delegating is not allowed in closure context");
}
pack();
}
use of com.intellij.refactoring.JavaRefactoringSettings in project intellij-community by JetBrains.
the class EncapsulateFieldsDialog method doAction.
protected void doAction() {
if (myTable.isEditing()) {
TableCellEditor editor = myTable.getCellEditor();
if (editor != null) {
editor.stopCellEditing();
}
}
String errorString = validateData();
if (errorString != null) {
// were errors
CommonRefactoringUtil.showErrorMessage(REFACTORING_NAME, errorString, HelpID.ENCAPSULATE_FIELDS, myProject);
return;
}
if (getCheckedRows().length == 0) {
CommonRefactoringUtil.showErrorMessage(REFACTORING_NAME, "Nothing found to encapsulate", HelpID.ENCAPSULATE_FIELDS, myProject);
return;
}
invokeRefactoring(new EncapsulateFieldsProcessor(myProject, this));
JavaRefactoringSettings settings = JavaRefactoringSettings.getInstance();
settings.ENCAPSULATE_FIELDS_USE_ACCESSORS_WHEN_ACCESSIBLE = myCbUseAccessorsWhenAccessible.isSelected();
}
use of com.intellij.refactoring.JavaRefactoringSettings in project intellij-community by JetBrains.
the class TypeCookDialog method doAction.
protected void doAction() {
JavaRefactoringSettings settings = JavaRefactoringSettings.getInstance();
settings.TYPE_COOK_DROP_CASTS = myCbDropCasts.isSelected();
settings.TYPE_COOK_PRESERVE_RAW_ARRAYS = myCbPreserveRawArrays.isSelected();
settings.TYPE_COOK_LEAVE_OBJECT_PARAMETERIZED_TYPES_RAW = myCbLeaveObjectParameterizedTypesRaw.isSelected();
settings.TYPE_COOK_EXHAUSTIVE = myCbExhaustive.isSelected();
settings.TYPE_COOK_COOK_OBJECTS = myCbCookObjects.isSelected();
settings.TYPE_COOK_PRODUCE_WILDCARDS = myCbCookToWildcards.isSelected();
invokeRefactoring(new TypeCookProcessor(getProject(), myElements, getSettings()));
}
use of com.intellij.refactoring.JavaRefactoringSettings in project kotlin by JetBrains.
the class MoveKotlinTopLevelDeclarationsDialog method saveRefactoringSettings.
private void saveRefactoringSettings() {
JavaRefactoringSettings refactoringSettings = JavaRefactoringSettings.getInstance();
refactoringSettings.MOVE_SEARCH_IN_COMMENTS = isSearchInComments();
refactoringSettings.MOVE_SEARCH_FOR_TEXT = isSearchInNonJavaFiles();
refactoringSettings.MOVE_PREVIEW_USAGES = isPreviewUsages();
}
Aggregations