mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SSR: remove recursive search option from UI (part of IDEA-210186)
GitOrigin-RevId: 87f4c99bce98b912a5c67b193a4464b9a4f8032e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
497139d8a2
commit
72560d6fb3
+49
-49
@@ -265,51 +265,51 @@ final class JavaPredefinedConfigurations {
|
||||
getMetadataType(), JavaFileType.INSTANCE),
|
||||
|
||||
// J2EE templates
|
||||
createLegacyNonRecursiveConfiguration(SSRBundle.message("predefined.configuration.struts.1.1.actions"), "Struts 1.1 actions",
|
||||
"public class '_StrutsActionClass extends '_ParentClass*:Action {\n" +
|
||||
" public ActionForward '_AnActionMethod:*execute (ActionMapping '_action,\n" +
|
||||
" ActionForm '_form,\n" +
|
||||
" HttpServletRequest '_request,\n" +
|
||||
" HttpServletResponse '_response);\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyNonRecursiveConfiguration(SSRBundle.message("predefined.configuration.entity.ejb"), "entity ejb",
|
||||
"class 'EntityBean implements EntityBean {\n" +
|
||||
" EntityContext '_Context?;\n\n" +
|
||||
" public void setEntityContext(EntityContext '_Context2);\n\n" +
|
||||
" public '_RetType ejbCreate('_CreateType '_CreateDcl*);\n" +
|
||||
" public void ejbActivate();\n\n" +
|
||||
" public void ejbLoad();\n\n" +
|
||||
" public void ejbPassivate();\n\n" +
|
||||
" public void ejbRemove();\n\n" +
|
||||
" public void ejbStore();\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyNonRecursiveConfiguration(SSRBundle.message("predefined.configuration.session.ejb"), "session ejb",
|
||||
"class 'SessionBean implements SessionBean {\n" +
|
||||
" SessionContext '_Context?;\n\n" +
|
||||
" public void '_setSessionContext(SessionContext '_Context2);\n\n" +
|
||||
" public '_RetType ejbCreate('_CreateParameterType '_CreateParameterDcl*);\n" +
|
||||
" public void ejbActivate();\n\n" +
|
||||
" public void ejbPassivate();\n\n" +
|
||||
" public void ejbRemove();\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyNonRecursiveConfiguration(SSRBundle.message("predefined.configuration.ejb.interface"), "ejb interface",
|
||||
"interface 'EjbInterface extends EJBObject {\n" +
|
||||
" '_Type '_Method+('_ParameterType '_Param*);\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyNonRecursiveConfiguration(SSRBundle.message("predefined.configuration.servlets"), "servlets",
|
||||
"public class 'Servlet extends '_ParentClass:*HttpServlet {\n" +
|
||||
" public void '_InitServletMethod?:init ();\n" +
|
||||
" public void '_DestroyServletMethod?:destroy ();\n" +
|
||||
" void '_ServiceMethod?:*service (HttpServletRequest '_request, HttpServletResponse '_response);\n" +
|
||||
" void '_SpecificServiceMethod*:do.* (HttpServletRequest '_request2, HttpServletResponse '_response2); \n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyNonRecursiveConfiguration(SSRBundle.message("predefined.configuration.filters"), "filters",
|
||||
"public class 'Filter implements Filter {\n" +
|
||||
" public void '_DestroyFilterMethod?:*destroy ();\n" +
|
||||
" public void '_InitFilterMethod?:*init ();\n" +
|
||||
" public void '_FilteringMethod:*doFilter (ServletRequest '_request,\n" +
|
||||
" ServletResponse '_response,FilterChain '_chain);\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.struts.1.1.actions"), "Struts 1.1 actions",
|
||||
"public class '_StrutsActionClass extends '_ParentClass*:Action {\n" +
|
||||
" public ActionForward '_AnActionMethod:*execute (ActionMapping '_action,\n" +
|
||||
" ActionForm '_form,\n" +
|
||||
" HttpServletRequest '_request,\n" +
|
||||
" HttpServletResponse '_response);\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.entity.ejb"), "entity ejb",
|
||||
"class 'EntityBean implements EntityBean {\n" +
|
||||
" EntityContext '_Context?;\n\n" +
|
||||
" public void setEntityContext(EntityContext '_Context2);\n\n" +
|
||||
" public '_RetType ejbCreate('_CreateType '_CreateDcl*);\n" +
|
||||
" public void ejbActivate();\n\n" +
|
||||
" public void ejbLoad();\n\n" +
|
||||
" public void ejbPassivate();\n\n" +
|
||||
" public void ejbRemove();\n\n" +
|
||||
" public void ejbStore();\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.session.ejb"), "session ejb",
|
||||
"class 'SessionBean implements SessionBean {\n" +
|
||||
" SessionContext '_Context?;\n\n" +
|
||||
" public void '_setSessionContext(SessionContext '_Context2);\n\n" +
|
||||
" public '_RetType ejbCreate('_CreateParameterType '_CreateParameterDcl*);\n" +
|
||||
" public void ejbActivate();\n\n" +
|
||||
" public void ejbPassivate();\n\n" +
|
||||
" public void ejbRemove();\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.ejb.interface"), "ejb interface",
|
||||
"interface 'EjbInterface extends EJBObject {\n" +
|
||||
" '_Type '_Method+('_ParameterType '_Param*);\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.servlets"), "servlets",
|
||||
"public class 'Servlet extends '_ParentClass:*HttpServlet {\n" +
|
||||
" public void '_InitServletMethod?:init ();\n" +
|
||||
" public void '_DestroyServletMethod?:destroy ();\n" +
|
||||
" void '_ServiceMethod?:*service (HttpServletRequest '_request, HttpServletResponse '_response);\n" +
|
||||
" void '_SpecificServiceMethod*:do.* (HttpServletRequest '_request2, HttpServletResponse '_response2); \n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.filters"), "filters",
|
||||
"public class 'Filter implements Filter {\n" +
|
||||
" public void '_DestroyFilterMethod?:*destroy ();\n" +
|
||||
" public void '_InitFilterMethod?:*init ();\n" +
|
||||
" public void '_FilteringMethod:*doFilter (ServletRequest '_request,\n" +
|
||||
" ServletResponse '_response,FilterChain '_chain);\n" +
|
||||
"}", getJ2EEType(), JavaFileType.INSTANCE, null),
|
||||
|
||||
// Misc types
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.serializable.classes.and.their.serialization.implementation"),
|
||||
@@ -326,10 +326,10 @@ final class JavaPredefinedConfigurations {
|
||||
"class '_Class implements '_Interface:*Cloneable {\n" +
|
||||
" Object 'CloningMethod:*clone ();\n" +
|
||||
"}", getMiscType(), JavaFileType.INSTANCE),
|
||||
createLegacyNonRecursiveConfiguration(SSRBundle.message("predefined.configuration.junit.test.cases"), "junit test cases",
|
||||
"public class 'TestCase extends '_TestCaseClazz:*TestCase {\n" +
|
||||
" public void '_testMethod+:test.* ();\n" +
|
||||
"}", getMiscType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.junit.test.cases"), "junit test cases",
|
||||
"public class 'TestCase extends '_TestCaseClazz:*TestCase {\n" +
|
||||
" public void '_testMethod+:test.* ();\n" +
|
||||
"}", getMiscType(), JavaFileType.INSTANCE, null),
|
||||
createLegacyConfiguration(SSRBundle.message("predefined.configuration.singletons"), "singletons",
|
||||
"class 'Class {\n" +
|
||||
" private 'Class('_ParameterType '_Parameter*) {\n" +
|
||||
|
||||
+1
-25
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.structuralsearch;
|
||||
|
||||
import com.intellij.openapi.fileTypes.LanguageFileType;
|
||||
@@ -83,28 +83,4 @@ public final class PredefinedConfigurationUtil {
|
||||
config.setRefName(refName);
|
||||
return config;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Configuration createNonRecursiveConfiguration(@NotNull @Nls(capitalization = Nls.Capitalization.Sentence) String name,
|
||||
@NotNull @NonNls String refName,
|
||||
@NotNull @NonNls String criteria,
|
||||
@NotNull String category,
|
||||
@NotNull LanguageFileType fileType,
|
||||
@Nullable PatternContext context) {
|
||||
final Configuration config = createConfiguration(name, refName, criteria, category, fileType, context);
|
||||
config.getMatchOptions().setRecursiveSearch(false);
|
||||
return config;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Configuration createLegacyNonRecursiveConfiguration(@NotNull @Nls(capitalization = Nls.Capitalization.Sentence) String name,
|
||||
@NotNull @NonNls String refName,
|
||||
@NotNull @NonNls String criteria,
|
||||
@NotNull String category,
|
||||
@NotNull LanguageFileType fileType,
|
||||
@Nullable PatternContext context) {
|
||||
final Configuration config = createLegacyConfiguration(name, refName, criteria, category, fileType, context);
|
||||
config.getMatchOptions().setRecursiveSearch(false);
|
||||
return config;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-32
@@ -111,7 +111,6 @@ public class StructuralSearchDialog extends DialogWrapper implements DocumentLis
|
||||
@NonNls private static final String SEARCH_DIMENSION_SERVICE_KEY = "#com.intellij.structuralsearch.plugin.ui.StructuralSearchDialog";
|
||||
@NonNls private static final String REPLACE_DIMENSION_SERVICE_KEY = "#com.intellij.structuralsearch.plugin.ui.StructuralReplaceDialog";
|
||||
|
||||
@NonNls private static final String RECURSIVE_STATE = "structural.search.recursive";
|
||||
@NonNls private static final String SHORTEN_FQN_STATE = "structural.search.shorten.fqn";
|
||||
@NonNls private static final String REFORMAT_STATE = "structural.search.reformat";
|
||||
@NonNls private static final String USE_STATIC_IMPORT_STATE = "structural.search.use.static.import";
|
||||
@@ -595,25 +594,6 @@ public class StructuralSearchDialog extends DialogWrapper implements DocumentLis
|
||||
initValidation();
|
||||
}
|
||||
};
|
||||
final CheckboxAction recursive = new CheckboxAction(SSRBundle.message("recursive.matching.checkbox")) {
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
super.update(e);
|
||||
e.getPresentation().setEnabledAndVisible(!myReplace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(@NotNull AnActionEvent e) {
|
||||
return myConfiguration.getMatchOptions().isRecursiveSearch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(@NotNull AnActionEvent e, boolean state) {
|
||||
myConfiguration.getMatchOptions().setRecursiveSearch(state);
|
||||
initValidation();
|
||||
}
|
||||
};
|
||||
final CheckboxAction matchCase = new CheckboxAction(FindBundle.message("find.popup.case.sensitive")) {
|
||||
@Override
|
||||
public boolean isSelected(@NotNull AnActionEvent e) {
|
||||
@@ -746,7 +726,7 @@ public class StructuralSearchDialog extends DialogWrapper implements DocumentLis
|
||||
}
|
||||
};
|
||||
final DefaultActionGroup optionsActionGroup =
|
||||
new DefaultActionGroup(injected, recursive, matchCase, myFileTypeChooser, filterAction, templateActionGroup);
|
||||
new DefaultActionGroup(injected, matchCase, myFileTypeChooser, filterAction, templateActionGroup);
|
||||
myOptionsToolbar = (ActionToolbarImpl)actionManager.createActionToolbar("StructuralSearchDialog", optionsActionGroup, true);
|
||||
myOptionsToolbar.setTargetComponent(mySearchCriteriaEdit);
|
||||
myOptionsToolbar.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);
|
||||
@@ -1176,7 +1156,6 @@ public class StructuralSearchDialog extends DialogWrapper implements DocumentLis
|
||||
}
|
||||
UIUtil.setContent(mySearchCriteriaEdit, matchOptions.getSearchPattern());
|
||||
|
||||
final PropertiesComponent properties = PropertiesComponent.getInstance();
|
||||
if (myReplace) {
|
||||
final Editor replaceEditor = myReplaceCriteriaEdit.getEditor();
|
||||
if (replaceEditor != null) {
|
||||
@@ -1191,11 +1170,6 @@ public class StructuralSearchDialog extends DialogWrapper implements DocumentLis
|
||||
UIUtil.setContent(myReplaceCriteriaEdit, matchOptions.getSearchPattern());
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (configuration instanceof ReplaceConfiguration) {
|
||||
matchOptions.setRecursiveSearch(properties.getBoolean(RECURSIVE_STATE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void saveConfiguration() {
|
||||
@@ -1216,20 +1190,16 @@ public class StructuralSearchDialog extends DialogWrapper implements DocumentLis
|
||||
matchOptions.setDialect(myDialect);
|
||||
matchOptions.setPatternContext(myPatternContext);
|
||||
matchOptions.setSearchPattern(getPattern(mySearchCriteriaEdit));
|
||||
|
||||
matchOptions.setRecursiveSearch(!myReplace);
|
||||
|
||||
final PropertiesComponent properties = PropertiesComponent.getInstance();
|
||||
if (myReplace) {
|
||||
final ReplaceOptions replaceOptions = myConfiguration.getReplaceOptions();
|
||||
replaceOptions.setReplacement(getPattern(myReplaceCriteriaEdit));
|
||||
matchOptions.setRecursiveSearch(false);
|
||||
properties.setValue(SHORTEN_FQN_STATE, replaceOptions.isToShortenFQN());
|
||||
properties.setValue(USE_STATIC_IMPORT_STATE, replaceOptions.isToUseStaticImport());
|
||||
properties.setValue(REFORMAT_STATE, replaceOptions.isToReformatAccordingToStyle());
|
||||
}
|
||||
else {
|
||||
properties.setValue(RECURSIVE_STATE, matchOptions.isRecursiveSearch());
|
||||
}
|
||||
}
|
||||
|
||||
private String getPattern(EditorTextField textField) {
|
||||
|
||||
@@ -16,7 +16,6 @@ create.inspection.from.template.action.text=Create Inspection from Template...
|
||||
new.template.defaultname=Unnamed
|
||||
|
||||
search.in.injected.checkbox=Language in&jections
|
||||
recursive.matching.checkbox=&Recursive
|
||||
reformat.checkbox=&Reformat
|
||||
use.static.import.checkbox=Use static &imports
|
||||
search.target.label=Search &target:
|
||||
|
||||
Reference in New Issue
Block a user