use of com.intellij.structuralsearch.plugin.replace.ui.ReplaceConfiguration in project intellij-community by JetBrains.
the class SSBasedInspectionOptions method performEditAction.
private void performEditAction() {
final Configuration configuration = (Configuration) myTemplatesList.getSelectedValue();
if (configuration == null)
return;
SearchDialog dialog = createDialog(new SearchDialogFactory() {
@Override
public SearchDialog createDialog(SearchContext searchContext) {
if (configuration instanceof SearchConfiguration) {
return new SearchDialog(searchContext, false, false) {
@Override
public Configuration createConfiguration() {
SearchConfiguration newConfiguration = new SearchConfiguration();
copyConfiguration(configuration, newConfiguration);
return newConfiguration;
}
};
} else {
return new ReplaceDialog(searchContext, false, false) {
@Override
public Configuration createConfiguration() {
ReplaceConfiguration newConfiguration = new ReplaceConfiguration();
copyConfiguration(configuration, newConfiguration);
return newConfiguration;
}
};
}
}
});
dialog.setValuesFromConfig(configuration);
dialog.setUseLastConfiguration(true);
if (!dialog.showAndGet()) {
return;
}
final Configuration newConfiguration = dialog.getConfiguration();
final int index = myConfigurations.indexOf(configuration);
myConfigurations.remove(index);
myConfigurations.add(index, newConfiguration);
final SearchContext context = dialog.getSearchContext();
SSBasedInspectionCompiledPatternsCache.removeFromCache(configuration, context.getProject());
configurationsChanged(context);
}
Aggregations