LAB-62 get rid of static *Bundle usages: more private static fields

replace `private static String X = *Bundle.message(...)` with
```protected static String getX() {
    return *Bundle.message(...)
}
```

GitOrigin-RevId: 5de111f477a214e87d22226974c3fdf0e10fcbb0
This commit is contained in:
Dmitry.Krasilschikov
2019-12-26 14:36:47 +02:00
committed by intellij-monorepo-bot
parent 95264a965d
commit f0a9c5f83b
19 changed files with 507 additions and 307 deletions

View File

@@ -45,11 +45,7 @@ public final class VisibilityInspection extends GlobalJavaBatchInspectionTool {
public boolean SUGGEST_PRIVATE_FOR_INNERS;
public boolean SUGGEST_FOR_CONSTANTS = true;
private final Map<String, Boolean> myExtensions = new TreeMap<>();
private static final String DISPLAY_NAME = InspectionsBundle.message("inspection.visibility.display.name");
@NonNls public static final String SHORT_NAME = "WeakerAccess";
private static final String CAN_BE_PRIVATE = InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PRIVATE));
private static final String CAN_BE_PACKAGE_LOCAL = InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PACKAGE_LOCAL));
private static final String CAN_BE_PROTECTED = InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PROTECTED));
private class OptionsPanel extends JPanel {
private final JCheckBox myPackageLocalForMembersCheckbox;
@@ -247,16 +243,16 @@ public final class VisibilityInspection extends GlobalJavaBatchInspectionTool {
final String message;
String quickFixName = "Make " + ElementDescriptionUtil.getElementDescription(element, UsageViewTypeLocation.INSTANCE) + " ";
if (access.equals(PsiModifier.PRIVATE)) {
message = CAN_BE_PRIVATE;
message = getCAN_BE_PRIVATE();
quickFixName += VisibilityUtil.toPresentableText(PsiModifier.PRIVATE);
}
else {
if (access.equals(PsiModifier.PACKAGE_LOCAL)) {
message = CAN_BE_PACKAGE_LOCAL;
message = getCAN_BE_PACKAGE_LOCAL();
quickFixName += VisibilityUtil.toPresentableText(PsiModifier.PACKAGE_LOCAL);
}
else {
message = CAN_BE_PROTECTED;
message = getCAN_BE_PROTECTED();
quickFixName += VisibilityUtil.toPresentableText(PsiModifier.PROTECTED);
}
}
@@ -694,4 +690,16 @@ public final class VisibilityInspection extends GlobalJavaBatchInspectionTool {
}
}
}
private static String getCAN_BE_PRIVATE() {
return InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PRIVATE));
}
private static String getCAN_BE_PACKAGE_LOCAL() {
return InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PACKAGE_LOCAL));
}
private static String getCAN_BE_PROTECTED() {
return InspectionsBundle.message("inspection.visibility.compose.suggestion", VisibilityUtil.toPresentableText(PsiModifier.PROTECTED));
}
}

View File

@@ -29,10 +29,6 @@ import javax.swing.*;
import java.awt.*;
public class JavaAutoImportOptions implements AutoImportOptionsProvider {
private static final String INSERT_IMPORTS_ALWAYS = ApplicationBundle.message("combobox.insert.imports.all");
private static final String INSERT_IMPORTS_ASK = ApplicationBundle.message("combobox.insert.imports.ask");
private static final String INSERT_IMPORTS_NONE = ApplicationBundle.message("combobox.insert.imports.none");
private JComboBox<String> mySmartPasteCombo;
private JCheckBox myCbShowImportPopup;
private JPanel myWholePanel;
@@ -46,9 +42,9 @@ public class JavaAutoImportOptions implements AutoImportOptionsProvider {
public JavaAutoImportOptions(Project project) {
myProject = project;
mySmartPasteCombo.addItem(INSERT_IMPORTS_ALWAYS);
mySmartPasteCombo.addItem(INSERT_IMPORTS_ASK);
mySmartPasteCombo.addItem(INSERT_IMPORTS_NONE);
mySmartPasteCombo.addItem(getINSERT_IMPORTS_ALWAYS());
mySmartPasteCombo.addItem(getINSERT_IMPORTS_ASK());
mySmartPasteCombo.addItem(getINSERT_IMPORTS_NONE());
myExcludePackagesTable = new ExcludeTable(project);
myExcludeFromImportAndCompletionPanel.add(myExcludePackagesTable.getComponent(), BorderLayout.CENTER);
@@ -65,15 +61,15 @@ public class JavaAutoImportOptions implements AutoImportOptionsProvider {
switch (codeInsightSettings.ADD_IMPORTS_ON_PASTE) {
case CodeInsightSettings.YES:
mySmartPasteCombo.setSelectedItem(INSERT_IMPORTS_ALWAYS);
mySmartPasteCombo.setSelectedItem(getINSERT_IMPORTS_ALWAYS());
break;
case CodeInsightSettings.NO:
mySmartPasteCombo.setSelectedItem(INSERT_IMPORTS_NONE);
mySmartPasteCombo.setSelectedItem(getINSERT_IMPORTS_NONE());
break;
case CodeInsightSettings.ASK:
mySmartPasteCombo.setSelectedItem(INSERT_IMPORTS_ASK);
mySmartPasteCombo.setSelectedItem(getINSERT_IMPORTS_ASK());
break;
}
@@ -127,10 +123,10 @@ public class JavaAutoImportOptions implements AutoImportOptionsProvider {
private int getSmartPasteValue() {
Object selectedItem = mySmartPasteCombo.getSelectedItem();
if (INSERT_IMPORTS_ALWAYS.equals(selectedItem)) {
if (getINSERT_IMPORTS_ALWAYS().equals(selectedItem)) {
return CodeInsightSettings.YES;
}
else if (INSERT_IMPORTS_NONE.equals(selectedItem)) {
else if (getINSERT_IMPORTS_NONE().equals(selectedItem)) {
return CodeInsightSettings.NO;
}
else {
@@ -141,4 +137,16 @@ public class JavaAutoImportOptions implements AutoImportOptionsProvider {
private static boolean isModified(JToggleButton checkBox, boolean value) {
return checkBox.isSelected() != value;
}
private static String getINSERT_IMPORTS_ALWAYS() {
return ApplicationBundle.message("combobox.insert.imports.all");
}
private static String getINSERT_IMPORTS_ASK() {
return ApplicationBundle.message("combobox.insert.imports.ask");
}
private static String getINSERT_IMPORTS_NONE() {
return ApplicationBundle.message("combobox.insert.imports.none");
}
}

View File

@@ -939,18 +939,16 @@ public final class ExternalAnnotationsManagerImpl extends ReadableExternalAnnota
private static class MyExternalPromptDialog extends OptionsMessageDialog {
private final Project myProject;
private static final String ADD_IN_CODE = ProjectBundle.message("external.annotations.in.code.option");
private static final String MESSAGE = ProjectBundle.message("external.annotations.suggestion.message");
MyExternalPromptDialog(final Project project) {
super(project, MESSAGE, ProjectBundle.message("external.annotation.prompt"), Messages.getQuestionIcon());
super(project, getMESSAGE(), ProjectBundle.message("external.annotation.prompt"), Messages.getQuestionIcon());
myProject = project;
init();
}
@Override
protected String getOkActionName() {
return ADD_IN_CODE;
return getADD_IN_CODE();
}
@Override
@@ -963,7 +961,7 @@ public final class ExternalAnnotationsManagerImpl extends ReadableExternalAnnota
@NotNull
protected Action[] createActions() {
final Action okAction = getOKAction();
assignMnemonic(ADD_IN_CODE, okAction);
assignMnemonic(getADD_IN_CODE(), okAction);
final String externalName = ProjectBundle.message("external.annotations.external.option");
return new Action[]{okAction, new AbstractAction(externalName) {
{
@@ -994,7 +992,7 @@ public final class ExternalAnnotationsManagerImpl extends ReadableExternalAnnota
@Override
protected JComponent createNorthPanel() {
final JPanel northPanel = (JPanel)super.createNorthPanel();
northPanel.add(new JLabel(MESSAGE), BorderLayout.CENTER);
northPanel.add(new JLabel(getMESSAGE()), BorderLayout.CENTER);
return northPanel;
}
@@ -1002,6 +1000,14 @@ public final class ExternalAnnotationsManagerImpl extends ReadableExternalAnnota
protected boolean shouldSaveOptionsOnCancel() {
return true;
}
private static String getADD_IN_CODE() {
return ProjectBundle.message("external.annotations.in.code.option");
}
private static String getMESSAGE() {
return ProjectBundle.message("external.annotations.suggestion.message");
}
}
private class MyDocumentListener implements DocumentListener {

View File

@@ -11,227 +11,239 @@ import static com.intellij.structuralsearch.PredefinedConfigurationUtil.createSe
* @author Bas Leijdekkers
*/
class JavaPredefinedConfigurations {
private static final String EXPRESSION_TYPE = SSRBundle.message("expressions.category");
private static final String INTERESTING_TYPE = SSRBundle.message("interesting.category");
private static final String J2EE_TYPE = SSRBundle.message("j2ee.category");
private static final String OPERATOR_TYPE = SSRBundle.message("operators.category");
private static final String CLASS_TYPE = SSRBundle.message("class.category");
private static final String METADATA_TYPE = SSRBundle.message("metadata.category");
private static final String MISC_TYPE = SSRBundle.message("misc.category");
private static final String GENERICS_TYPE = SSRBundle.message("generics.category");
public static Configuration[] createPredefinedTemplates() {
return new Configuration[] {
// Expression patterns
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.method.calls"), "'_Instance?.'MethodCall('_Parameter*)", EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.new.expressions"), "new 'Constructor('_Argument*)", EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.lambdas"), "('_Parameter*) -> {}", EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.field.selections"),"'_Instance?.'Field",EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.array.access"),"'_Array['_Index]",EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.assignments"),"'_Inst = '_Expr",EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.casts"),"('_Type)'_Expr",EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.instanceof"),"'_Expr instanceof '_Type",EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.string.literals"),"\"'_String\"",EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.all.expressions.of.some.type"),"'_Expression:[exprtype( SomeType )]",EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.sample.method.invokation.with.constant.argument"),"Integer.parseInt('_a:[script( \"com.intellij.psi.util.PsiUtil.isConstantExpression(__context__)\" )])",EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.method.references"), "'_Qualifier::'Method", EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.string.concatenations"), "[exprtype( java\\.lang\\.String )]'_a + '_b{10,}", EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.deprecated.method.calls"), "'_Instance?.'MethodCall:[ref( deprecated methods )]('_Parameter*)", EXPRESSION_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.method.calls"), "'_Instance?.'MethodCall('_Parameter*)",
getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.new.expressions"), "new 'Constructor('_Argument*)",
getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.lambdas"), "('_Parameter*) -> {}", getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.field.selections"), "'_Instance?.'Field", getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.array.access"), "'_Array['_Index]", getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.assignments"), "'_Inst = '_Expr", getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.casts"), "('_Type)'_Expr", getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.instanceof"), "'_Expr instanceof '_Type", getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.string.literals"), "\"'_String\"", getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.all.expressions.of.some.type"), "'_Expression:[exprtype( SomeType )]",
getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.sample.method.invokation.with.constant.argument"), "Integer.parseInt('_a:[script( \"com.intellij.psi.util.PsiUtil.isConstantExpression(__context__)\" )])",
getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.method.references"), "'_Qualifier::'Method",
getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.string.concatenations"), "[exprtype( java\\.lang\\.String )]'_a + '_b{10,}",
getEXPRESSION_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.deprecated.method.calls"), "'_Instance?.'MethodCall:[ref( deprecated methods )]('_Parameter*)",
getEXPRESSION_TYPE()),
// Operators
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.block.dcls"),"{\n '_Type 'Var+ = '_Init?;\n '_BlockStatements*;\n}",OPERATOR_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.trys"),"try {\n '_TryStatement+;\n} catch('_ExceptionType '_Exception) {\n '_CatchStatement*;\n}",OPERATOR_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.ifs"),"if ('_Condition) {\n '_ThenStatement*;\n} else {\n '_ElseStatement*;\n}",OPERATOR_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.switches"),"switch('_Condition) {\n '_Statement*;\n}",OPERATOR_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.foreaches"), "for ('_Type '_Variable : '_Expression) {\n '_Statement*;\n}", OPERATOR_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.logging.without.if"), "[!within( statement in if )]LOG.debug('_Argument*);", OPERATOR_TYPE),
createSearchTemplateInfo("statement in if", "if('_condition) { 'statement*; }", OPERATOR_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.assert.without.description"), "assert '_condition : '_description{0};", OPERATOR_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.block.dcls"), "{\n '_Type 'Var+ = '_Init?;\n '_BlockStatements*;\n}",
getOPERATOR_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.trys"), "try {\n '_TryStatement+;\n} catch('_ExceptionType '_Exception) {\n '_CatchStatement*;\n}",
getOPERATOR_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.ifs"), "if ('_Condition) {\n '_ThenStatement*;\n} else {\n '_ElseStatement*;\n}",
getOPERATOR_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.switches"), "switch('_Condition) {\n '_Statement*;\n}",
getOPERATOR_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.foreaches"), "for ('_Type '_Variable : '_Expression) {\n '_Statement*;\n}",
getOPERATOR_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.logging.without.if"), "[!within( statement in if )]LOG.debug('_Argument*);",
getOPERATOR_TYPE()),
createSearchTemplateInfo("statement in if", "if('_condition) { 'statement*; }", getOPERATOR_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.assert.without.description"), "assert '_condition : '_description{0};",
getOPERATOR_TYPE()),
// Class based
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.methods.of.the.class"),
"'_ReturnType? '_Method('_ParameterType '_Parameter*);",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.deprecated.methods"),
"@Deprecated\n'_ReturnType '_Method('_ParameterType '_Parameter*);",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.fields.of.the.class"),
"class '_Class { \n '_FieldType 'Field+ = '_Init?;\n}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.all.methods.of.the.class.within.hierarchy"),
"class '_ { \n '_ReturnType 'Method+:* ('_ParameterType '_Parameter*);\n}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.all.fields.of.the.class"),
"class '_Class { \n '_FieldType 'Field+:* = '_Init?;\n}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.instance.fields.of.the.class"),
"class '_Class { \n @Modifier(\"Instance\") '_FieldType 'Field+ = '_Init?;\n}",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.packagelocal.fields.of.the.class"),
"@Modifier(\"packageLocal\") '_FieldType 'Field = '_Init?;",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.constructors.of.the.class"),
"'Class('_ParameterType '_Parameter*) {\n '_Statement*;\n}",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.classes"),
"class 'Class:[script( \"!__context__.interface && !__context__.enum\" )] {}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.classes.interfaces.enums"),
"class 'ClassInterfaceEnum {}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.direct.subclasses"),
"class 'Class extends '_Parent {}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.implementors.of.interface.within.hierarchy"),
"class 'Class implements '_Interface:* {}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.interfaces"),
"interface 'Interface {}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.inner.classes"),
"class '_ {\n class 'InnerClass+ {}\n}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.all.inner.classes.within.hierarchy"),
"class '_Class {\n class 'InnerClass+:* {}\n}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.anonymous.classes"),
"new 'AnonymousClass() {}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.class.implements.two.interfaces"),
"class 'A implements '_Interface1:[regex( *java\\.lang\\.Cloneable )], '_Interface2:*java\\.io\\.Serializable {\n" +"}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.class.static.blocks"),
"static {\n '_Statement*;\n}",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.class.instance.initialization.blocks"),
"@Modifier(\"Instance\") {\n '_Statement*;\n}",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.class.any.initialization.blocks"),
"{\n '_Statement*;\n}",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.enums"),
"enum 'Enum {}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.class.with.parameterless.constructors"),
"class 'Class {\n '_Method{0,0}('_ParameterType '_Parameter+);\n}",
CLASS_TYPE
getCLASS_TYPE()
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.static.fields.without.final"),
"static '_Type 'Variable+:[ script( \"!__context__.hasModifierProperty(\"final\")\" ) ] = '_Init?;",
CLASS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
getCLASS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT
),
createSearchTemplateInfo(
SSRBundle.message("predefined.configuration.interfaces.having.no.descendants"),
"interface 'A:[script( \"com.intellij.psi.search.searches.ClassInheritorsSearch.search(__context__).findFirst() == null\" )] {}",
CLASS_TYPE
getCLASS_TYPE()
),
// Generics
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.generic.classes"),"class 'GenericClass<'_TypeParameter+> {} ", GENERICS_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.generic.methods"),"<'_TypeParameter+> '_Type '_Method('_ParameterType '_Parameter*);", GENERICS_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.typed.symbol"),"'Symbol <'_GenericArgument+>", GENERICS_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.generic.casts"),"( '_Type <'_GenericArgument+> ) '_Expr", GENERICS_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.type.var.substitutions.in.intanceof.with.generic.types"),"'_Expr instanceof '_Type <'Substitutions+> ", GENERICS_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.variables.of.generic.types"),"'_Type <'_GenericArgument+> 'Var = '_Init?;", GENERICS_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.diamond.operators"), "new 'Class<>('_Argument*)", GENERICS_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.generic.classes"), "class 'GenericClass<'_TypeParameter+> {} ",
getGENERICS_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.generic.methods"), "<'_TypeParameter+> '_Type '_Method('_ParameterType '_Parameter*);",
getGENERICS_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.typed.symbol"), "'Symbol <'_GenericArgument+>",
getGENERICS_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.generic.casts"), "( '_Type <'_GenericArgument+> ) '_Expr",
getGENERICS_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.type.var.substitutions.in.intanceof.with.generic.types"), "'_Expr instanceof '_Type <'Substitutions+> ",
getGENERICS_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.variables.of.generic.types"), "'_Type <'_GenericArgument+> 'Var = '_Init?;",
getGENERICS_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.diamond.operators"), "new 'Class<>('_Argument*)",
getGENERICS_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.method.returns.bounded.wildcard"),
"[script( \"!Method.hasModifierProperty(com.intellij.psi.PsiModifier.ABSTRACT)\" )]'_Type<? extends '_Bound> 'Method('_ParameterType '_Parameter*);",
GENERICS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
getGENERICS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.generic.constructors"), "<'_TypeParameter+> 'Class('_ParameterType '_Parameter*) {\n '_Statement*;\n}",
GENERICS_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
getGENERICS_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
// Add comments and metadata
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.comments"),"/* 'CommentContent */", METADATA_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.comments"), "/* 'CommentContent */", getMETADATA_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.javadoc.annotated.class"),
"/**\n" +
" * '_Comment\n" +
" * @'_Tag* '_TagValue*\n" +
" */\n" +
"class '_Class {\n}", METADATA_TYPE),
"class '_Class {\n}", getMETADATA_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.javadoc.annotated.methods"),
"/**\n" +
" * '_Comment\n" +
" * @'_Tag* '_TagValue*\n" +
" */\n" +
"'_Type? '_Method('_ParameterType '_Parameter*);",
METADATA_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
getMETADATA_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.javadoc.annotated.fields"),
"/**\n" +
" * '_Comment\n" +
" * @'_Tag* '_TagValue*\n" +
" */\n" +
"'_Type+ 'Field+ = '_Init*;",
METADATA_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.javadoc.tags"),"/** @'Tag+ '_TagValue* */", METADATA_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.xdoclet.metadata"),"/** @'Tag \n '_Property+\n*/", METADATA_TYPE),
getMETADATA_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.javadoc.tags"), "/** @'Tag+ '_TagValue* */", getMETADATA_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.xdoclet.metadata"), "/** @'Tag \n '_Property+\n*/",
getMETADATA_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.annotations"), "@'_Annotation", METADATA_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.annotations"), "@'_Annotation", getMETADATA_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.annotated.class"),
"@'_Annotation\n" +
"class 'Class {}", METADATA_TYPE),
"class 'Class {}", getMETADATA_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.annotated.fields"),
"@'_Annotation+\n" +
"'_FieldType 'Field+ = '_Init?;\n",
METADATA_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
getMETADATA_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.annotated.methods"),
"@'_Annotation+\n'_MethodType '_Method('_ParameterType '_Parameter*);",
METADATA_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
getMETADATA_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.not.annotated.methods"),
"@'_Annotation{0,0}\n'_MethodType '_Method('_ParameterType '_Parameter*);",
METADATA_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
getMETADATA_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.annotation.declarations"),
"@interface 'Interface {}", METADATA_TYPE),
"@interface 'Interface {}", getMETADATA_TYPE()),
// J2EE templates
createSearchTemplateInfoSimple(SSRBundle.message("predefined.configuration.struts.1.1.actions"),"public class '_StrutsActionClass extends '_ParentClass*:Action {\n" +
@@ -239,7 +251,7 @@ class JavaPredefinedConfigurations {
" ActionForm '_form,\n" +
" HttpServletRequest '_request,\n" +
" HttpServletResponse '_response);\n" +
"}",J2EE_TYPE),
"}", getJ2EE_TYPE()),
createSearchTemplateInfoSimple(SSRBundle.message("predefined.configuration.entity.ejb"),"class 'EntityBean implements EntityBean {\n" +
" EntityContext '_Context?;\n\n" +
" public void setEntityContext(EntityContext '_Context2);\n\n" +
@@ -249,7 +261,7 @@ class JavaPredefinedConfigurations {
" public void ejbPassivate();\n\n" +
" public void ejbRemove();\n\n" +
" public void ejbStore();\n" +
"}", J2EE_TYPE),
"}", getJ2EE_TYPE()),
createSearchTemplateInfoSimple(SSRBundle.message("predefined.configuration.session.ejb"),"class 'SessionBean implements SessionBean {\n" +
" SessionContext '_Context?;\n\n" +
" public void '_setSessionContext(SessionContext '_Context2);\n\n" +
@@ -257,22 +269,22 @@ class JavaPredefinedConfigurations {
" public void ejbActivate();\n\n" +
" public void ejbPassivate();\n\n" +
" public void ejbRemove();\n" +
"}", J2EE_TYPE),
"}", getJ2EE_TYPE()),
createSearchTemplateInfoSimple(SSRBundle.message("predefined.configuration.ejb.interface"),"interface 'EjbInterface extends EJBObject {\n" +
" '_Type '_Method+('_ParameterType '_Param*);\n" +
"}", J2EE_TYPE),
"}", getJ2EE_TYPE()),
createSearchTemplateInfoSimple(SSRBundle.message("predefined.configuration.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" +
"}", J2EE_TYPE),
"}", getJ2EE_TYPE()),
createSearchTemplateInfoSimple(SSRBundle.message("predefined.configuration.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" +
"}", J2EE_TYPE),
"}", getJ2EE_TYPE()),
// Misc types
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.serializable.classes.and.their.serialization.implementation"),
@@ -283,15 +295,15 @@ class JavaPredefinedConfigurations {
" private void '_SerializationReadHandler?:readObject (ObjectInputStream '_stream2) throws IOException, ClassNotFoundException;\n" +
" Object '_SpecialSerializationReadHandler?:readResolve () throws ObjectStreamException;\n" +
" Object '_SpecialSerializationWriteHandler?:writeReplace () throws ObjectStreamException;\n" +
"}", MISC_TYPE),
"}", getMISC_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.cloneable.implementations"),
"class '_Class implements '_Interface:*Cloneable {\n" +
" Object 'CloningMethod:*clone ();\n" +
"}", MISC_TYPE),
"}", getMISC_TYPE()),
createSearchTemplateInfoSimple(SSRBundle.message("predefined.configuration.]junit.test.cases"),
"public class 'TestCase extends '_TestCaseClazz:*TestCase {\n" +
" public void '_testMethod+:test.* ();\n" +
"}", MISC_TYPE),
"}", getMISC_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.singletons"),
"class 'Class {\n" +
" private 'Class('_ParameterType '_Parameter*) {\n" +
@@ -302,7 +314,7 @@ class JavaPredefinedConfigurations {
" '_SomeStatement*;\n" +
" return '_Instance;\n" +
" }\n"+
"}", MISC_TYPE),
"}", getMISC_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.similar.methods.structure"),
"'_RetType '_Method('_ParameterType '_Parameter*) throws 'ExceptionType {\n" +
" try {\n" +
@@ -311,37 +323,46 @@ class JavaPredefinedConfigurations {
" '_CatchStatement*;\n" +
" throw new 'ExceptionType('_ExceptionConstructorArgs*);\n" +
" }\n" +
"}", MISC_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
"}", getMISC_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.bean.info.classes"),
"class 'A implements '_:*java\\.beans\\.BeanInfo {\n" +
"}", MISC_TYPE),
"}", getMISC_TYPE()),
// interesting types
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.symbol"), "'Symbol", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.symbol"), "'Symbol", getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.fields.variables.read"),
"'Symbol:[ script( \"import com.intellij.psi.*\n" +
"import static com.intellij.psi.util.PsiUtil.*\n" +
"Symbol instanceof PsiReferenceExpression && isAccessedForReading(Symbol)\" ) ]", INTERESTING_TYPE),
"Symbol instanceof PsiReferenceExpression && isAccessedForReading(Symbol)\" ) ]", getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.fields_variables.with.given.name.pattern.updated"),
"'Symbol:[regex( name ) && script( \"import com.intellij.psi.*\n" +
"import static com.intellij.psi.util.PsiUtil.*\n" +
"Symbol instanceof PsiExpression && isAccessedForWriting(Symbol) ||\n" +
" Symbol instanceof PsiVariable && Symbol.getInitializer() != null\" )]", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.usage.of.derived.type.in.cast"),"('CastType:*[regex( Base )]) '_Expr", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.boxing.in.declarations"),"'_Type:Object|Integer|Boolean|Long|Character|Short|Byte 'Var = '_Value:[exprtype( int|boolean|long|char|short|byte )];", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.unboxing.in.declarations"),"'_Type:int|boolean|long|char|short|byte 'Var = '_Value:[exprtype( Integer|Boolean|Long|Character|Short|Byte )];", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.boxing.in.method.calls"),"'_Instance?.'Call('_BeforeParam*,'_Param:[ exprtype( int|boolean|long|char|short|byte ) && formal( Object|Integer|Boolean|Long|Character|Short|Byte )],'_AfterParam*)", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.unboxing.in.method.calls"), "'_Instance?.'Call('_BeforeParam*,'_Param:[ formal( int|boolean|long|char|short|byte ) && exprtype( Integer|Boolean|Long|Character|Short|Byte )],'_AfterParam*)", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.any.boxing"), "'_expression:[ exprtype( int|boolean|long|char|short|byte ) && formal( Object|Integer|Boolean|Long|Character|Short|Byte )]", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.any.unboxing"), "'_expression:[ formal( int|boolean|long|char|short|byte ) && exprtype( Integer|Boolean|Long|Character|Short|Byte )]", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.try.without.resources"), "try ('_ResourceType '_resource{0,0} = '_init; '_expression{0,0}) {\n '_TryStatement*;\n} catch('_ExceptionType '_Exception{0,0}) {\n '_CatchStatement*;\n}", INTERESTING_TYPE),
" Symbol instanceof PsiVariable && Symbol.getInitializer() != null\" )]", getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.usage.of.derived.type.in.cast"), "('CastType:*[regex( Base )]) '_Expr",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.boxing.in.declarations"), "'_Type:Object|Integer|Boolean|Long|Character|Short|Byte 'Var = '_Value:[exprtype( int|boolean|long|char|short|byte )];",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.unboxing.in.declarations"), "'_Type:int|boolean|long|char|short|byte 'Var = '_Value:[exprtype( Integer|Boolean|Long|Character|Short|Byte )];",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.boxing.in.method.calls"), "'_Instance?.'Call('_BeforeParam*,'_Param:[ exprtype( int|boolean|long|char|short|byte ) && formal( Object|Integer|Boolean|Long|Character|Short|Byte )],'_AfterParam*)",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.unboxing.in.method.calls"), "'_Instance?.'Call('_BeforeParam*,'_Param:[ formal( int|boolean|long|char|short|byte ) && exprtype( Integer|Boolean|Long|Character|Short|Byte )],'_AfterParam*)",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.any.boxing"), "'_expression:[ exprtype( int|boolean|long|char|short|byte ) && formal( Object|Integer|Boolean|Long|Character|Short|Byte )]",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.any.unboxing"), "'_expression:[ formal( int|boolean|long|char|short|byte ) && exprtype( Integer|Boolean|Long|Character|Short|Byte )]",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.try.without.resources"), "try ('_ResourceType '_resource{0,0} = '_init; '_expression{0,0}) {\n '_TryStatement*;\n} catch('_ExceptionType '_Exception{0,0}) {\n '_CatchStatement*;\n}",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.switch.with.branches"), "[ script( \"import com.intellij.psi.*;\n" +
"import com.intellij.psi.util.*;\n" +
"PsiTreeUtil.getChildrenOfType(__context__.body, PsiSwitchLabelStatementBase.class).length < 5\" ) ]switch ('_expression) {\n}", INTERESTING_TYPE),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.labeled.break"), "break '_label;", INTERESTING_TYPE),
"PsiTreeUtil.getChildrenOfType(__context__.body, PsiSwitchLabelStatementBase.class).length < 5\" ) ]switch ('_expression) {\n}",
getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.labeled.break"), "break '_label;", getINTERESTING_TYPE()),
createSearchTemplateInfo(SSRBundle.message("predefined.configuration.methods.with.final.parameters"),
"'_ReturnType? '_Method('_BeforeType '_BeforeParameter*, final '_ParameterType '_Parameter, '_AfterType '_AfterParameter*);",
INTERESTING_TYPE, StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
getINTERESTING_TYPE(), StdFileTypes.JAVA, JavaStructuralSearchProfile.MEMBER_CONTEXT),
//createSearchTemplateInfo("methods called","'_?.'_:[ref('Method)] ('_*)", INTERESTING_TYPE),
//createSearchTemplateInfo("fields selected","'_?.'_:[ref('Field)] ", INTERESTING_TYPE),
//createSearchTemplateInfo("symbols used","'_:[ref('Symbol)] ", INTERESTING_TYPE),
@@ -350,4 +371,36 @@ class JavaPredefinedConfigurations {
createSearchTemplateInfo("xml attribute references java class", "<'_tag 'attribute=\"'_value:[ref( classes, interfaces & enums )]\"/>", SSRBundle.message("xml_html.category"), StdFileTypes.XML),
};
}
private static String getEXPRESSION_TYPE() {
return SSRBundle.message("expressions.category");
}
private static String getINTERESTING_TYPE() {
return SSRBundle.message("interesting.category");
}
private static String getJ2EE_TYPE() {
return SSRBundle.message("j2ee.category");
}
private static String getOPERATOR_TYPE() {
return SSRBundle.message("operators.category");
}
private static String getCLASS_TYPE() {
return SSRBundle.message("class.category");
}
private static String getMETADATA_TYPE() {
return SSRBundle.message("metadata.category");
}
private static String getMISC_TYPE() {
return SSRBundle.message("misc.category");
}
private static String getGENERICS_TYPE() {
return SSRBundle.message("generics.category");
}
}

View File

@@ -23,7 +23,6 @@ import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider;
import com.intellij.ui.OptionGroup;
import com.intellij.ui.components.fields.IntegerField;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -36,9 +35,6 @@ import static com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider.Setti
@SuppressWarnings({"deprecation", "DeprecatedIsStillUsed"})
public class IndentOptionsEditor extends OptionGroup implements CodeStyleSettingsCustomizable {
private static final String INDENT_LABEL = ApplicationBundle.message("editbox.indent.indent");
private static final String TAB_SIZE_LABEL = ApplicationBundle.message("editbox.indent.tab.size");
@Deprecated
protected JTextField myIndentField;
@@ -84,14 +80,14 @@ public class IndentOptionsEditor extends OptionGroup implements CodeStyleSetting
}
protected void addIndentField() {
myIndentField = createIndentTextField(INDENT_LABEL, MIN_INDENT_SIZE, MAX_INDENT_SIZE, DEFAULT_INDENT_SIZE);
myIndentLabel = new JLabel(INDENT_LABEL);
myIndentField = createIndentTextField(getINDENT_LABEL(), MIN_INDENT_SIZE, MAX_INDENT_SIZE, DEFAULT_INDENT_SIZE);
myIndentLabel = new JLabel(getINDENT_LABEL());
add(myIndentLabel, myIndentField);
}
protected void addTabSizeField() {
myTabSizeField = createIndentTextField(TAB_SIZE_LABEL, MIN_TAB_SIZE, MAX_TAB_SIZE, DEFAULT_TAB_SIZE);
myTabSizeLabel = new JLabel(TAB_SIZE_LABEL);
myTabSizeField = createIndentTextField(getTAB_SIZE_LABEL(), MIN_TAB_SIZE, MAX_TAB_SIZE, DEFAULT_TAB_SIZE);
myTabSizeLabel = new JLabel(getTAB_SIZE_LABEL());
add(myTabSizeLabel, myTabSizeField);
}
@@ -223,4 +219,11 @@ public class IndentOptionsEditor extends OptionGroup implements CodeStyleSetting
myCbUseTab.setVisible(visible);
}
private static String getINDENT_LABEL() {
return ApplicationBundle.message("editbox.indent.indent");
}
private static String getTAB_SIZE_LABEL() {
return ApplicationBundle.message("editbox.indent.tab.size");
}
}

View File

@@ -64,11 +64,6 @@ import java.util.regex.PatternSyntaxException;
public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
@SuppressWarnings("UnusedDeclaration")
private static final Logger LOG = Logger.getInstance(GeneralCodeStylePanel.class);
private static final String SYSTEM_DEPENDANT_STRING = ApplicationBundle.message("combobox.crlf.system.dependent");
private static final String UNIX_STRING = ApplicationBundle.message("combobox.crlf.unix");
private static final String WINDOWS_STRING = ApplicationBundle.message("combobox.crlf.windows");
private static final String MACINTOSH_STRING = ApplicationBundle.message("combobox.crlf.mac");
private final List<GeneralCodeStyleOptionsProvider> myAdditionalOptions;
private IntegerField myRightMarginField;
@@ -100,13 +95,13 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
super(settings);
//noinspection unchecked
myLineSeparatorCombo.addItem(SYSTEM_DEPENDANT_STRING);
myLineSeparatorCombo.addItem(getSYSTEM_DEPENDANT_STRING());
//noinspection unchecked
myLineSeparatorCombo.addItem(UNIX_STRING);
myLineSeparatorCombo.addItem(getUNIX_STRING());
//noinspection unchecked
myLineSeparatorCombo.addItem(WINDOWS_STRING);
myLineSeparatorCombo.addItem(getWINDOWS_STRING());
//noinspection unchecked
myLineSeparatorCombo.addItem(MACINTOSH_STRING);
myLineSeparatorCombo.addItem(getMACINTOSH_STRING());
addPanelToWatch(myPanel);
myRightMarginField.setDefaultValue(settings.getDefaultRightMargin());
@@ -226,13 +221,13 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
@Nullable
private String getSelectedLineSeparator() {
if (UNIX_STRING.equals(myLineSeparatorCombo.getSelectedItem())) {
if (getUNIX_STRING().equals(myLineSeparatorCombo.getSelectedItem())) {
return "\n";
}
if (MACINTOSH_STRING.equals(myLineSeparatorCombo.getSelectedItem())) {
if (getMACINTOSH_STRING().equals(myLineSeparatorCombo.getSelectedItem())) {
return "\r";
}
if (WINDOWS_STRING.equals(myLineSeparatorCombo.getSelectedItem())) {
if (getWINDOWS_STRING().equals(myLineSeparatorCombo.getSelectedItem())) {
return "\r\n";
}
return null;
@@ -286,16 +281,16 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
String lineSeparator = settings.LINE_SEPARATOR;
if ("\n".equals(lineSeparator)) {
myLineSeparatorCombo.setSelectedItem(UNIX_STRING);
myLineSeparatorCombo.setSelectedItem(getUNIX_STRING());
}
else if ("\r\n".equals(lineSeparator)) {
myLineSeparatorCombo.setSelectedItem(WINDOWS_STRING);
myLineSeparatorCombo.setSelectedItem(getWINDOWS_STRING());
}
else if ("\r".equals(lineSeparator)) {
myLineSeparatorCombo.setSelectedItem(MACINTOSH_STRING);
myLineSeparatorCombo.setSelectedItem(getMACINTOSH_STRING());
}
else {
myLineSeparatorCombo.setSelectedItem(SYSTEM_DEPENDANT_STRING);
myLineSeparatorCombo.setSelectedItem(getSYSTEM_DEPENDANT_STRING());
}
myRightMarginField.setValue(settings.getDefaultRightMargin());
@@ -361,4 +356,20 @@ public class GeneralCodeStylePanel extends CodeStyleAbstractPanel {
}
super.dispose();
}
private static String getSYSTEM_DEPENDANT_STRING() {
return ApplicationBundle.message("combobox.crlf.system.dependent");
}
private static String getUNIX_STRING() {
return ApplicationBundle.message("combobox.crlf.unix");
}
private static String getWINDOWS_STRING() {
return ApplicationBundle.message("combobox.crlf.windows");
}
private static String getMACINTOSH_STRING() {
return ApplicationBundle.message("combobox.crlf.mac");
}
}

View File

@@ -58,10 +58,6 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
public static final String ID = "preferences.editor";
private JPanel myBehaviourPanel;
private static final String STRIP_CHANGED = ApplicationBundle.message("combobox.strip.modified.lines");
private static final String STRIP_ALL = ApplicationBundle.message("combobox.strip.all");
private static final String STRIP_NONE = ApplicationBundle.message("combobox.strip.none");
private JComboBox<String> myStripTrailingSpacesCombo;
@@ -94,7 +90,6 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
private JComboBox<EditorCaretStopPolicyItem.LineBoundary> myLineBoundaryCaretStopComboBox;
private JPanel myCheckBoxPanel;
private static final String ACTIVE_COLOR_SCHEME = ApplicationBundle.message("combobox.richcopy.color.scheme.active");
private static final UINumericRange RECENT_FILES_RANGE = new UINumericRange(50, 1, 500);
private static final UINumericRange RECENT_LOCATIONS_RANGE = new UINumericRange(10, 1, 100);
@@ -104,14 +99,14 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
public EditorOptionsPanel() {
mySoftWrapFileMasks.getEmptyText().setText(ApplicationBundle.message("soft.wraps.file.masks.empty.text"));
myStripTrailingSpacesCombo.addItem(STRIP_CHANGED);
myStripTrailingSpacesCombo.addItem(STRIP_ALL);
myStripTrailingSpacesCombo.addItem(STRIP_NONE);
myStripTrailingSpacesCombo.addItem(getSTRIP_CHANGED());
myStripTrailingSpacesCombo.addItem(getSTRIP_ALL());
myStripTrailingSpacesCombo.addItem(getSTRIP_NONE());
myStripTrailingSpacesCombo.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
myCbKeepTrailingSpacesOnCaretLine.setEnabled(!STRIP_NONE.equals(myStripTrailingSpacesCombo.getSelectedItem()));
myCbKeepTrailingSpacesOnCaretLine.setEnabled(!getSTRIP_NONE().equals(myStripTrailingSpacesCombo.getSelectedItem()));
}
});
@@ -125,7 +120,7 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
myHighlightSettingsPanel.add(myErrorHighlightingPanel.getPanel(), BorderLayout.CENTER);
myRichCopyColorSchemeComboBox.setRenderer(SimpleListCellRenderer.create("", value ->
RichCopySettings.ACTIVE_GLOBAL_SCHEME_MARKER.equals(value) ? ACTIVE_COLOR_SCHEME :
RichCopySettings.ACTIVE_GLOBAL_SCHEME_MARKER.equals(value) ? getACTIVE_COLOR_SCHEME() :
EditorColorsScheme.DEFAULT_SCHEME_NAME.equals(value) ? EditorColorsScheme.DEFAULT_SCHEME_ALIAS : value));
initCaretStopComboBox(myWordBoundaryCaretStopComboBox, EditorCaretStopPolicyItem.WordBoundary.values());
@@ -179,13 +174,13 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
String stripTrailingSpaces = editorSettings.getStripTrailingSpaces();
if(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE.equals(stripTrailingSpaces)) {
myStripTrailingSpacesCombo.setSelectedItem(STRIP_NONE);
myStripTrailingSpacesCombo.setSelectedItem(getSTRIP_NONE());
}
else if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_CHANGED.equals(stripTrailingSpaces)) {
myStripTrailingSpacesCombo.setSelectedItem(STRIP_CHANGED);
myStripTrailingSpacesCombo.setSelectedItem(getSTRIP_CHANGED());
}
else if (EditorSettingsExternalizable.STRIP_TRAILING_SPACES_WHOLE.equals(stripTrailingSpaces)) {
myStripTrailingSpacesCombo.setSelectedItem(STRIP_ALL);
myStripTrailingSpacesCombo.setSelectedItem(getSTRIP_ALL());
}
myCbKeepTrailingSpacesOnCaretLine.setSelected(editorSettings.isKeepTrailingSpacesOnCaretLine());
@@ -250,10 +245,10 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
// Strip trailing spaces on save
if(STRIP_NONE.equals(myStripTrailingSpacesCombo.getSelectedItem())) {
if(getSTRIP_NONE().equals(myStripTrailingSpacesCombo.getSelectedItem())) {
editorSettings.setStripTrailingSpaces(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE);
}
else if(STRIP_CHANGED.equals(myStripTrailingSpacesCombo.getSelectedItem())){
else if(getSTRIP_CHANGED().equals(myStripTrailingSpacesCombo.getSelectedItem())){
editorSettings.setStripTrailingSpaces(EditorSettingsExternalizable.STRIP_TRAILING_SPACES_CHANGED);
}
else {
@@ -456,10 +451,10 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
@EditorSettingsExternalizable.StripTrailingSpaces
private String getStripTrailingSpacesValue() {
Object selectedItem = myStripTrailingSpacesCombo.getSelectedItem();
if(STRIP_NONE.equals(selectedItem)) {
if(getSTRIP_NONE().equals(selectedItem)) {
return EditorSettingsExternalizable.STRIP_TRAILING_SPACES_NONE;
}
if(STRIP_CHANGED.equals(selectedItem)){
if(getSTRIP_CHANGED().equals(selectedItem)){
return EditorSettingsExternalizable.STRIP_TRAILING_SPACES_CHANGED;
}
return EditorSettingsExternalizable.STRIP_TRAILING_SPACES_WHOLE;
@@ -517,4 +512,20 @@ public class EditorOptionsPanel extends CompositeConfigurable<ErrorOptionsProvid
public JComponent createComponent() {
return myBehaviourPanel;
}
private static String getSTRIP_CHANGED() {
return ApplicationBundle.message("combobox.strip.modified.lines");
}
private static String getSTRIP_ALL() {
return ApplicationBundle.message("combobox.strip.all");
}
private static String getSTRIP_NONE() {
return ApplicationBundle.message("combobox.strip.none");
}
private static String getACTIVE_COLOR_SCHEME() {
return ApplicationBundle.message("combobox.richcopy.color.scheme.active");
}
}

View File

@@ -67,10 +67,6 @@ public class LiveTemplateSettingsEditor extends JPanel {
private JButton myEditVariablesButton;
private static final String SPACE = CodeInsightBundle.message("template.shortcut.space");
private static final String TAB = CodeInsightBundle.message("template.shortcut.tab");
private static final String ENTER = CodeInsightBundle.message("template.shortcut.enter");
private static final String NONE = CodeInsightBundle.message("template.shortcut.none");
private final Map<TemplateOptionalProcessor, Boolean> myOptions;
private final TemplateContext myContext;
private JBPopup myContextPopup;
@@ -222,7 +218,7 @@ public class LiveTemplateSettingsEditor extends JPanel {
gbConstraints.gridx = 1;
gbConstraints.insets = JBUI.insetsLeft(4);
myExpandByCombo = new ComboBox<>(new String[]{myDefaultShortcutItem, SPACE, TAB, ENTER, NONE});
myExpandByCombo = new ComboBox<>(new String[]{myDefaultShortcutItem, getSPACE(), getTAB(), getENTER(), getNONE()});
myExpandByCombo.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(@NotNull ItemEvent e) {
@@ -230,13 +226,13 @@ public class LiveTemplateSettingsEditor extends JPanel {
if(myDefaultShortcutItem.equals(selectedItem)) {
myTemplate.setShortcutChar(TemplateSettings.DEFAULT_CHAR);
}
else if(TAB.equals(selectedItem)) {
else if(getTAB().equals(selectedItem)) {
myTemplate.setShortcutChar(TemplateSettings.TAB_CHAR);
}
else if(ENTER.equals(selectedItem)) {
else if(getENTER().equals(selectedItem)) {
myTemplate.setShortcutChar(TemplateSettings.ENTER_CHAR);
}
else if (SPACE.equals(selectedItem)) {
else if (getSPACE().equals(selectedItem)) {
myTemplate.setShortcutChar(TemplateSettings.SPACE_CHAR);
}
else {
@@ -488,16 +484,16 @@ public class LiveTemplateSettingsEditor extends JPanel {
myExpandByCombo.setSelectedItem(myDefaultShortcutItem);
}
else if(myTemplate.getShortcutChar() == TemplateSettings.TAB_CHAR) {
myExpandByCombo.setSelectedItem(TAB);
myExpandByCombo.setSelectedItem(getTAB());
}
else if(myTemplate.getShortcutChar() == TemplateSettings.ENTER_CHAR) {
myExpandByCombo.setSelectedItem(ENTER);
myExpandByCombo.setSelectedItem(getENTER());
}
else if (myTemplate.getShortcutChar() == TemplateSettings.SPACE_CHAR) {
myExpandByCombo.setSelectedItem(SPACE);
myExpandByCombo.setSelectedItem(getSPACE());
}
else {
myExpandByCombo.setSelectedItem(NONE);
myExpandByCombo.setSelectedItem(getNONE());
}
CommandProcessor.getInstance().executeCommand(
@@ -591,5 +587,21 @@ public class LiveTemplateSettingsEditor extends JPanel {
map.keySet().removeAll(TemplateImpl.INTERNAL_VARS_SET);
return map;
}
private static String getSPACE() {
return CodeInsightBundle.message("template.shortcut.space");
}
private static String getTAB() {
return CodeInsightBundle.message("template.shortcut.tab");
}
private static String getENTER() {
return CodeInsightBundle.message("template.shortcut.enter");
}
private static String getNONE() {
return CodeInsightBundle.message("template.shortcut.none");
}
}

View File

@@ -32,11 +32,6 @@ public class TemplateExpandShortcutPanel extends JPanel {
private final JComboBox<String> myExpandByCombo;
private final HyperlinkLabel myOpenKeymapLabel;
private static final String SPACE = CodeInsightBundle.message("template.shortcut.space");
private static final String TAB = CodeInsightBundle.message("template.shortcut.tab");
private static final String ENTER = CodeInsightBundle.message("template.shortcut.enter");
private static final String CUSTOM = CodeInsightBundle.message("template.shortcut.custom");
public TemplateExpandShortcutPanel(@NotNull String label) {
super(new GridBagLayout());
GridBagConstraints gbConstraints = new GridBagConstraints();
@@ -62,14 +57,14 @@ public class TemplateExpandShortcutPanel extends JPanel {
myExpandByCombo.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
myOpenKeymapLabel.setVisible(myExpandByCombo.getSelectedItem() == CUSTOM);
myOpenKeymapLabel.setVisible(myExpandByCombo.getSelectedItem() == getCUSTOM());
}
});
for (String s : ContainerUtil.ar(SPACE, TAB, ENTER, CUSTOM)) {
for (String s : ContainerUtil.ar(getSPACE(), getTAB(), getENTER(), getCUSTOM())) {
myExpandByCombo.addItem(s);
}
myExpandByCombo.setRenderer(SimpleListCellRenderer.create("", value -> {
if (value == CUSTOM) {
if (value == getCUSTOM()) {
Shortcut[] shortcuts = getCurrentCustomShortcuts();
String shortcutText = shortcuts.length == 0 ? "" : KeymapUtil.getShortcutsText(shortcuts);
return StringUtil.isEmpty(shortcutText) ? ApplicationBundle.message("custom.option") : "Custom (" + shortcutText + ")";
@@ -125,17 +120,17 @@ public class TemplateExpandShortcutPanel extends JPanel {
}
public void setSelectedChar(char ch) {
myExpandByCombo.setSelectedItem(ch == TemplateSettings.CUSTOM_CHAR ? CUSTOM :
ch == TemplateSettings.TAB_CHAR ? TAB :
ch == TemplateSettings.ENTER_CHAR ? ENTER :
SPACE);
myExpandByCombo.setSelectedItem(ch == TemplateSettings.CUSTOM_CHAR ? getCUSTOM() :
ch == TemplateSettings.TAB_CHAR ? getTAB() :
ch == TemplateSettings.ENTER_CHAR ? getENTER() :
getSPACE());
}
public char getSelectedChar() {
Object selectedItem = myExpandByCombo.getSelectedItem();
if (TAB.equals(selectedItem)) return TemplateSettings.TAB_CHAR;
if (ENTER.equals(selectedItem)) return TemplateSettings.ENTER_CHAR;
if (SPACE.equals(selectedItem)) {
if (getTAB().equals(selectedItem)) return TemplateSettings.TAB_CHAR;
if (getENTER().equals(selectedItem)) return TemplateSettings.ENTER_CHAR;
if (getSPACE().equals(selectedItem)) {
return TemplateSettings.SPACE_CHAR;
}
else {
@@ -145,8 +140,24 @@ public class TemplateExpandShortcutPanel extends JPanel {
private void resizeComboToFitCustomShortcut() {
myExpandByCombo.setPrototypeDisplayValue(null);
myExpandByCombo.setPrototypeDisplayValue(CUSTOM);
myExpandByCombo.setPrototypeDisplayValue(getCUSTOM());
myExpandByCombo.revalidate();
myExpandByCombo.repaint();
}
private static String getSPACE() {
return CodeInsightBundle.message("template.shortcut.space");
}
private static String getTAB() {
return CodeInsightBundle.message("template.shortcut.tab");
}
private static String getENTER() {
return CodeInsightBundle.message("template.shortcut.enter");
}
private static String getCUSTOM() {
return CodeInsightBundle.message("template.shortcut.custom");
}
}

View File

@@ -1,7 +1,6 @@
// Copyright 2000-2019 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.
package com.intellij.codeInsight.template.postfix.settings;
import com.intellij.application.options.editor.AutoImportOptionsProviderEP;
import com.intellij.application.options.editor.EditorOptionsProvider;
import com.intellij.codeInsight.CodeInsightBundle;
import com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor;
@@ -60,10 +59,6 @@ public class PostfixTemplatesConfigurable implements SearchableConfigurable, Edi
private JPanel myDescriptionPanel;
private final Alarm myUpdateDescriptionPanelAlarm = new Alarm();
private static final String SPACE = CodeInsightBundle.message("template.shortcut.space");
private static final String TAB = CodeInsightBundle.message("template.shortcut.tab");
private static final String ENTER = CodeInsightBundle.message("template.shortcut.enter");
public PostfixTemplatesConfigurable() {
myTemplatesSettings = PostfixTemplatesSettings.getInstance();
@@ -73,9 +68,9 @@ public class PostfixTemplatesConfigurable implements SearchableConfigurable, Edi
updateComponents();
}
});
myShortcutComboBox.addItem(TAB);
myShortcutComboBox.addItem(SPACE);
myShortcutComboBox.addItem(ENTER);
myShortcutComboBox.addItem(getTAB());
myShortcutComboBox.addItem(getSPACE());
myShortcutComboBox.addItem(getENTER());
myDescriptionPanel.setLayout(new BorderLayout());
}
@@ -269,10 +264,10 @@ public class PostfixTemplatesConfigurable implements SearchableConfigurable, Edi
}
private static char stringToShortcut(@Nullable String string) {
if (SPACE.equals(string)) {
if (getSPACE().equals(string)) {
return TemplateSettings.SPACE_CHAR;
}
else if (ENTER.equals(string)) {
else if (getENTER().equals(string)) {
return TemplateSettings.ENTER_CHAR;
}
return TemplateSettings.TAB_CHAR;
@@ -280,11 +275,23 @@ public class PostfixTemplatesConfigurable implements SearchableConfigurable, Edi
private static String shortcutToString(char shortcut) {
if (shortcut == TemplateSettings.SPACE_CHAR) {
return SPACE;
return getSPACE();
}
if (shortcut == TemplateSettings.ENTER_CHAR) {
return ENTER;
return getENTER();
}
return TAB;
return getTAB();
}
private static String getSPACE() {
return CodeInsightBundle.message("template.shortcut.space");
}
private static String getTAB() {
return CodeInsightBundle.message("template.shortcut.tab");
}
private static String getENTER() {
return CodeInsightBundle.message("template.shortcut.enter");
}
}

View File

@@ -49,11 +49,6 @@ public final class AllFileTemplatesConfigurable implements SearchableConfigurabl
Configurable.VariableProjectAppLevel {
private static final Logger LOG = Logger.getInstance(AllFileTemplatesConfigurable.class);
private static final String TEMPLATES_TITLE = IdeBundle.message("tab.filetemplates.templates");
private static final String INCLUDES_TITLE = IdeBundle.message("tab.filetemplates.includes");
private static final String CODE_TITLE = IdeBundle.message("tab.filetemplates.code");
private static final String OTHER_TITLE = IdeBundle.message("tab.filetemplates.j2ee");
final static class Provider extends ConfigurableProvider {
private final Project myProject;
@@ -186,19 +181,19 @@ public final class AllFileTemplatesConfigurable implements SearchableConfigurabl
public JComponent createComponent() {
myUIDisposable = Disposer.newDisposable();
myTemplatesList = new FileTemplateTabAsList(TEMPLATES_TITLE) {
myTemplatesList = new FileTemplateTabAsList(getTEMPLATES_TITLE()) {
@Override
public void onTemplateSelected() {
onListSelectionChanged();
}
};
myIncludesList = new FileTemplateTabAsList(INCLUDES_TITLE) {
myIncludesList = new FileTemplateTabAsList(getINCLUDES_TITLE()) {
@Override
public void onTemplateSelected() {
onListSelectionChanged();
}
};
myCodeTemplatesList = new FileTemplateTabAsList(CODE_TITLE) {
myCodeTemplatesList = new FileTemplateTabAsList(getCODE_TITLE()) {
@Override
public void onTemplateSelected() {
onListSelectionChanged();
@@ -210,7 +205,7 @@ public final class AllFileTemplatesConfigurable implements SearchableConfigurabl
final List<FileTemplateGroupDescriptorFactory> factories = FileTemplateGroupDescriptorFactory.EXTENSION_POINT_NAME.getExtensionList();
if (!factories.isEmpty()) {
myOtherTemplatesList = new FileTemplateTabAsTree(OTHER_TITLE) {
myOtherTemplatesList = new FileTemplateTabAsTree(getOTHER_TITLE()) {
@Override
public void onTemplateSelected() {
onListSelectionChanged();
@@ -444,16 +439,16 @@ public final class AllFileTemplatesConfigurable implements SearchableConfigurabl
if (templateName == null) {
return false;
}
if (Comparing.strEqual(templateTabTitle, TEMPLATES_TITLE)) {
if (Comparing.strEqual(templateTabTitle, getTEMPLATES_TITLE())) {
return isInternalTemplateName(templateName);
}
if (Comparing.strEqual(templateTabTitle, CODE_TITLE)) {
if (Comparing.strEqual(templateTabTitle, getCODE_TITLE())) {
return true;
}
if (Comparing.strEqual(templateTabTitle, OTHER_TITLE)) {
if (Comparing.strEqual(templateTabTitle, getOTHER_TITLE())) {
return true;
}
if (Comparing.strEqual(templateTabTitle, INCLUDES_TITLE)) {
if (Comparing.strEqual(templateTabTitle, getINCLUDES_TITLE())) {
return Comparing.strEqual(templateName, FileTemplateManager.FILE_HEADER_TEMPLATE_NAME);
}
return false;
@@ -592,7 +587,7 @@ public final class AllFileTemplatesConfigurable implements SearchableConfigurabl
public void disposeUIResources() {
if (myCurrentTab != null) {
final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
propertiesComponent.setValue(CURRENT_TAB, myCurrentTab.getTitle(), TEMPLATES_TITLE);
propertiesComponent.setValue(CURRENT_TAB, myCurrentTab.getTitle(), getTEMPLATES_TITLE());
final FileTemplate template = myCurrentTab.getSelectedTemplate();
if (template != null) {
propertiesComponent.setValue(SELECTED_TEMPLATE, template.getName());
@@ -788,4 +783,20 @@ public final class AllFileTemplatesConfigurable implements SearchableConfigurabl
throw new UnsupportedOperationException();
}
}
private static String getTEMPLATES_TITLE() {
return IdeBundle.message("tab.filetemplates.templates");
}
private static String getINCLUDES_TITLE() {
return IdeBundle.message("tab.filetemplates.includes");
}
private static String getCODE_TITLE() {
return IdeBundle.message("tab.filetemplates.code");
}
private static String getOTHER_TITLE() {
return IdeBundle.message("tab.filetemplates.j2ee");
}
}

View File

@@ -20,10 +20,6 @@ import org.jetbrains.annotations.Nullable;
import java.util.List;
public class ScopeChooserUtils {
private static final String CURRENT_FILE_SCOPE_NAME = IdeBundle.message("scope.current.file");
private static final String OPEN_FILES_SCOPE_NAME = IdeBundle.message("scope.open.files");
private ScopeChooserUtils() {
}
@@ -42,14 +38,14 @@ public class ScopeChooserUtils {
if (scopeName == null) return GlobalSearchScope.EMPTY_SCOPE;
if (OPEN_FILES_SCOPE_NAME.equals(scopeName)) {
if (getOPEN_FILES_SCOPE_NAME().equals(scopeName)) {
return intersectWithContentScope(project, GlobalSearchScopes.openFilesScope(project));
}
if (CURRENT_FILE_SCOPE_NAME.equals(scopeName)) {
if (getCURRENT_FILE_SCOPE_NAME().equals(scopeName)) {
VirtualFile[] array = FileEditorManager.getInstance(project).getSelectedFiles();
List<VirtualFile> files = ContainerUtil.createMaybeSingletonList(ArrayUtil.getFirstElement(array));
GlobalSearchScope scope = GlobalSearchScope.filesScope(project, files, CURRENT_FILE_SCOPE_NAME);
GlobalSearchScope scope = GlobalSearchScope.filesScope(project, files, getCURRENT_FILE_SCOPE_NAME());
return intersectWithContentScope(project, scope);
}
@@ -91,4 +87,12 @@ public class ScopeChooserUtils {
private static GlobalSearchScope intersectWithContentScope(@NotNull Project project, @NotNull GlobalSearchScope scope) {
return scope.intersectWith(ProjectScope.getContentScope(project));
}
private static String getCURRENT_FILE_SCOPE_NAME() {
return IdeBundle.message("scope.current.file");
}
private static String getOPEN_FILES_SCOPE_NAME() {
return IdeBundle.message("scope.open.files");
}
}

View File

@@ -18,8 +18,13 @@ import org.jetbrains.annotations.Nullable;
*/
final class ToggleFullScreenAction extends DumbAwareAction {
private static class Holder {
private static final String TEXT_ENTER_FULL_SCREEN = ActionsBundle.message("action.ToggleFullScreen.text.enter");
private static final String TEXT_EXIT_FULL_SCREEN = ActionsBundle.message("action.ToggleFullScreen.text.exit");
private static String getTEXT_ENTER_FULL_SCREEN() {
return ActionsBundle.message("action.ToggleFullScreen.text.enter");
}
private static String getTEXT_EXIT_FULL_SCREEN() {
return ActionsBundle.message("action.ToggleFullScreen.text.exit");
}
}
@Override
@@ -47,7 +52,7 @@ final class ToggleFullScreenAction extends DumbAwareAction {
p.setEnabled(isApplicable);
if (isApplicable) {
p.setText(frame.isInFullScreen() ? Holder.TEXT_EXIT_FULL_SCREEN : Holder.TEXT_ENTER_FULL_SCREEN);
p.setText(frame.isInFullScreen() ? Holder.getTEXT_EXIT_FULL_SCREEN() : Holder.getTEXT_ENTER_FULL_SCREEN());
}
}

View File

@@ -29,10 +29,6 @@ public class LightEditUtil {
private static final String ENABLED_FILE_OPEN_KEY = "light.edit.file.open.enabled";
private static final String CLOSE_SAVE = ApplicationBundle.message("light.edit.close.save");
private static final String CLOSE_DISCARD = ApplicationBundle.message("light.edit.close.discard");
private static final String CLOSE_CANCEL = ApplicationBundle.message("light.edit.close.cancel");
public static boolean openFile(@NotNull VirtualFile file) {
if (Registry.is(ENABLED_FILE_OPEN_KEY)) {
LightEditService.getInstance().openFile(file);
@@ -56,13 +52,13 @@ public class LightEditUtil {
static boolean confirmClose(@NotNull String message,
@NotNull String title,
@NotNull Runnable saveRunnable) {
final String[] options = {CLOSE_SAVE, CLOSE_DISCARD, CLOSE_CANCEL};
final String[] options = {getCLOSE_SAVE(), getCLOSE_DISCARD(), getCLOSE_CANCEL()};
int result = Messages.showDialog(getProject(), message, title, options, 0, Messages.getWarningIcon());
if (result >= 0) {
if (CLOSE_CANCEL.equals(options[result])) {
if (getCLOSE_CANCEL().equals(options[result])) {
return false;
}
else if (CLOSE_SAVE.equals(options[result])) {
else if (getCLOSE_SAVE().equals(options[result])) {
saveRunnable.run();
}
return true;
@@ -94,4 +90,15 @@ public class LightEditUtil {
.map(fileType -> fileType.getDefaultExtension()).sorted().distinct().collect(Collectors.toList()));
}
private static String getCLOSE_SAVE() {
return ApplicationBundle.message("light.edit.close.save");
}
private static String getCLOSE_DISCARD() {
return ApplicationBundle.message("light.edit.close.discard");
}
private static String getCLOSE_CANCEL() {
return ApplicationBundle.message("light.edit.close.cancel");
}
}

View File

@@ -17,8 +17,6 @@ import java.util.List;
* @author Konstantin Bulenkov
*/
class SwitchAnnotationSourceAction extends AnAction implements DumbAware {
private final static String ourShowMerged = VcsBundle.message("annotation.switch.to.merged.text");
private final static String ourHideMerged = VcsBundle.message("annotation.switch.to.original.text");
private final AnnotationSourceSwitcher mySwitcher;
private final List<Consumer<AnnotationSource>> myListeners = ContainerUtil.createLockFreeCopyOnWriteList();
private boolean myShowMerged;
@@ -34,7 +32,7 @@ class SwitchAnnotationSourceAction extends AnAction implements DumbAware {
@Override
public void update(@NotNull final AnActionEvent e) {
e.getPresentation().setText(myShowMerged ? ourHideMerged : ourShowMerged);
e.getPresentation().setText(myShowMerged ? getHideMerged() : getShowMerged());
}
@Override
@@ -48,4 +46,12 @@ class SwitchAnnotationSourceAction extends AnAction implements DumbAware {
AnnotateActionGroup.revalidateMarkupInAllEditors();
}
private static String getShowMerged() {
return VcsBundle.message("annotation.switch.to.merged.text");
}
private static String getHideMerged() {
return VcsBundle.message("annotation.switch.to.original.text");
}
}

View File

@@ -17,7 +17,6 @@ package com.intellij.cvsSupport2.javacvsImpl.io;
import com.intellij.CvsBundle;
import com.intellij.cvsSupport2.Progress;
import org.jetbrains.annotations.NonNls;
/**
* author: lesya
@@ -34,10 +33,6 @@ public class ReadWriteStatistics {
private long myShownSentKBytes = 0;
public static final int KB = 1024;
@NonNls private static final String READ_PROGRESS_MESSAGE = CvsBundle.message("progress.text.kb.read");
@NonNls private static final String SENT_PROGRESS_MESSAGE = CvsBundle.message("progress.text.kb.sent");
@NonNls private static final String PROGRESS_SENDING = CvsBundle.message("progress.text.sending.data.to.server");
@NonNls private static final String PROGRESS_READING = CvsBundle.message("progress.text.reading.data.from.server");
public ReadWriteStatistics() {
myProgress = Progress.create();
@@ -55,7 +50,7 @@ public class ReadWriteStatistics {
myShownReadKBytes = myReadBytes / KB;
}
showProgress(PROGRESS_READING);
showProgress(getPROGRESS_READING());
}
public void send(long bytes) {
@@ -65,7 +60,7 @@ public class ReadWriteStatistics {
mySentFromLastUpdateBytes = 0;
myShownSentKBytes = mySentBytes / KB;
}
showProgress(PROGRESS_SENDING);
showProgress(getPROGRESS_SENDING());
}
private void showProgress(String mesasge) {
@@ -76,16 +71,32 @@ public class ReadWriteStatistics {
}
if (myShownReadKBytes > 0) {
buffer.append(myShownReadKBytes);
buffer.append(READ_PROGRESS_MESSAGE);
buffer.append(getREAD_PROGRESS_MESSAGE());
if (myShownSentKBytes > 0) buffer.append("; ");
}
if (myShownSentKBytes > 0) {
buffer.append(myShownSentKBytes);
buffer.append(SENT_PROGRESS_MESSAGE);
buffer.append(getSENT_PROGRESS_MESSAGE());
}
myProgress.setText(buffer.toString());
}
private static String getREAD_PROGRESS_MESSAGE() {
return CvsBundle.message("progress.text.kb.read");
}
private static String getSENT_PROGRESS_MESSAGE() {
return CvsBundle.message("progress.text.kb.sent");
}
private static String getPROGRESS_SENDING() {
return CvsBundle.message("progress.text.sending.data.to.server");
}
private static String getPROGRESS_READING() {
return CvsBundle.message("progress.text.reading.data.from.server");
}
}

View File

@@ -24,9 +24,6 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDocumentManager;
public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesTestCase {
private static final String CREATE_MODULE_INTENTION = MavenDomBundle.message("fix.create.module");
private static final String CREATE_MODULE_WITH_PARENT_INTENTION = MavenDomBundle.message("fix.create.module.with.parent");
public void testCompleteFromAllAvailableModules() {
createProjectPom("<groupId>test</groupId>" +
"<artifactId>project</artifactId>" +
@@ -302,7 +299,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>subDir/new<caret>Module</module>" +
"</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
IntentionAction i = getIntentionAtCaret(getCREATE_MODULE_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -339,7 +336,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>subDir/new<caret>Module.xml</module>" +
"</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
IntentionAction i = getIntentionAtCaret(getCREATE_MODULE_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -377,7 +374,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
"</modules>");
createProjectSubFile("subDir/newModule.xml/empty"); // ensure that "subDir/newModule.xml" exists as a directory
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
IntentionAction i = getIntentionAtCaret(getCREATE_MODULE_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -418,7 +415,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>new<caret>Module</module>" +
"</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
IntentionAction i = getIntentionAtCaret(getCREATE_MODULE_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -458,7 +455,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>${dirName}/new<caret>Module</module>" +
"</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
IntentionAction i = getIntentionAtCaret(getCREATE_MODULE_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -481,7 +478,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>new<caret>Module</module>" +
"</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_INTENTION);
IntentionAction i = getIntentionAtCaret(getCREATE_MODULE_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -517,7 +514,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>new<caret>Module</module>" +
"</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_WITH_PARENT_INTENTION);
IntentionAction i = getIntentionAtCaret(getCREATE_MODULE_WITH_PARENT_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -559,7 +556,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>ppp/new<caret>Module</module>" +
"</modules>");
IntentionAction i = getIntentionAtCaret(CREATE_MODULE_WITH_PARENT_INTENTION);
IntentionAction i = getIntentionAtCaret(getCREATE_MODULE_WITH_PARENT_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -605,7 +602,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>../ppp/new<caret>Module</module>" +
"</modules>"));
PsiDocumentManager.getInstance(myProject).commitAllDocuments();
IntentionAction i = getIntentionAtCaret(parentPom, CREATE_MODULE_WITH_PARENT_INTENTION);
IntentionAction i = getIntentionAtCaret(parentPom, getCREATE_MODULE_WITH_PARENT_INTENTION());
assertNotNull(i);
myFixture.launchAction(i);
@@ -648,7 +645,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module><caret></module>" +
"</modules>");
assertNull(getIntentionAtCaret(CREATE_MODULE_INTENTION));
assertNull(getIntentionAtCaret(getCREATE_MODULE_INTENTION()));
}
public void testDoesNotShowCreatePomQuickFixExistingModule() {
@@ -676,7 +673,7 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
" <module>m<caret>odule</module>" +
"</modules>");
assertNull(getIntentionAtCaret(CREATE_MODULE_INTENTION));
assertNull(getIntentionAtCaret(getCREATE_MODULE_INTENTION()));
}
private void assertCreateModuleFixResult(String relativePath, String expectedText) {
@@ -690,4 +687,12 @@ public class MavenModuleCompletionAndResolutionTest extends MavenDomWithIndicesT
assertEquals(expectedText, doc.getText());
}
private static String getCREATE_MODULE_INTENTION() {
return MavenDomBundle.message("fix.create.module");
}
private static String getCREATE_MODULE_WITH_PARENT_INTENTION() {
return MavenDomBundle.message("fix.create.module.with.parent");
}
}

View File

@@ -30,9 +30,6 @@ public class PythonSdkDetailsStep extends BaseListPopupStep<String> {
private final Sdk[] myExistingSdks;
private final NullableConsumer<? super Sdk> mySdkAddedCallback;
private static final String ADD = PyBundle.message("sdk.details.step.add");
private static final String ALL = PyBundle.message("sdk.details.step.show.all");
public static void show(@Nullable final Project project,
@Nullable final Module module,
@NotNull final Sdk[] existingSdks,
@@ -60,9 +57,9 @@ public class PythonSdkDetailsStep extends BaseListPopupStep<String> {
private static List<String> getAvailableOptions(boolean showAll) {
final List<String> options = new ArrayList<>();
options.add(ADD);
options.add(getADD());
if (showAll) {
options.add(ALL);
options.add(getALL());
}
return options;
}
@@ -70,13 +67,13 @@ public class PythonSdkDetailsStep extends BaseListPopupStep<String> {
@Nullable
@Override
public ListSeparator getSeparatorAbove(String value) {
return ALL.equals(value) ? new ListSeparator() : null;
return getALL().equals(value) ? new ListSeparator() : null;
}
private void optionSelected(final String selectedValue) {
if (!ALL.equals(selectedValue) && myShowAll != null)
if (!getALL().equals(selectedValue) && myShowAll != null)
Disposer.dispose(myShowAll.getDisposable());
if (ADD.equals(selectedValue)) {
if (getADD().equals(selectedValue)) {
PyAddSdkDialog.show(myProject, myModule, Arrays.asList(myExistingSdks), sdk -> mySdkAddedCallback.consume(sdk));
}
else if (myShowAll != null) {
@@ -94,4 +91,12 @@ public class PythonSdkDetailsStep extends BaseListPopupStep<String> {
public PopupStep onChosen(final String selectedValue, boolean finalChoice) {
return doFinalStep(() -> optionSelected(selectedValue));
}
private static String getADD() {
return PyBundle.message("sdk.details.step.add");
}
private static String getALL() {
return PyBundle.message("sdk.details.step.show.all");
}
}

View File

@@ -22,131 +22,147 @@ import com.jetbrains.python.psi.LanguageLevel;
* @author Mikhail Golubev
*/
public class PyConvertCollectionLiteralIntentionTest extends PyIntentionTestCase {
private static final String CONVERT_TUPLE_TO_LIST = PyBundle.message("INTN.convert.collection.literal.text", "tuple", "list");
private static final String CONVERT_TUPLE_TO_SET = PyBundle.message("INTN.convert.collection.literal.text", "tuple", "set");
private static final String CONVERT_LIST_TO_TUPLE = PyBundle.message("INTN.convert.collection.literal.text", "list", "tuple");
private static final String CONVERT_LIST_TO_SET = PyBundle.message("INTN.convert.collection.literal.text", "list", "set");
private static final String CONVERT_SET_TO_TUPLE = PyBundle.message("INTN.convert.collection.literal.text", "set", "tuple");
private static final String CONVERT_SET_TO_LIST = PyBundle.message("INTN.convert.collection.literal.text", "set", "list");
// PY-9419
public void testConvertParenthesizedTupleToList() {
doIntentionTest(CONVERT_TUPLE_TO_LIST);
doIntentionTest(getCONVERT_TUPLE_TO_LIST());
}
// PY-9419
public void testConvertTupleWithoutParenthesesToList() {
doIntentionTest(CONVERT_TUPLE_TO_LIST);
doIntentionTest(getCONVERT_TUPLE_TO_LIST());
}
// PY-9419
public void testConvertTupleWithoutClosingParenthesisToList() {
doIntentionTest(CONVERT_TUPLE_TO_LIST);
doIntentionTest(getCONVERT_TUPLE_TO_LIST());
}
// PY-9419
public void testConvertParenthesizedTupleToSet() {
doIntentionTest(CONVERT_TUPLE_TO_SET);
doIntentionTest(getCONVERT_TUPLE_TO_SET());
}
// PY-9419
public void testConvertTupleToSetNotAvailableWithoutSetLiterals() {
runWithLanguageLevel(LanguageLevel.PYTHON26, () -> doNegativeTest(CONVERT_TUPLE_TO_SET));
runWithLanguageLevel(LanguageLevel.PYTHON26, () -> doNegativeTest(getCONVERT_TUPLE_TO_SET()));
}
// PY-9419
public void testConvertTupleToSetNotAvailableInAssignmentTarget() {
doNegativeTest(CONVERT_TUPLE_TO_SET);
doNegativeTest(getCONVERT_TUPLE_TO_SET());
}
// PY-9419
public void testConvertTupleToSetNotAvailableInForLoop() {
doNegativeTest(CONVERT_TUPLE_TO_SET);
doNegativeTest(getCONVERT_TUPLE_TO_SET());
}
// PY-9419
public void testConvertTupleToSetNotAvailableInComprehension() {
doNegativeTest(CONVERT_TUPLE_TO_SET);
doNegativeTest(getCONVERT_TUPLE_TO_SET());
}
// PY-9419
public void testConvertListToTuple() {
doIntentionTest(CONVERT_LIST_TO_TUPLE);
doIntentionTest(getCONVERT_LIST_TO_TUPLE());
}
// PY-9419
public void testConvertListWithoutClosingBracketToTuple() {
doIntentionTest(CONVERT_LIST_TO_TUPLE);
doIntentionTest(getCONVERT_LIST_TO_TUPLE());
}
// PY-9419
public void testConvertListToSet() {
doIntentionTest(CONVERT_LIST_TO_SET);
doIntentionTest(getCONVERT_LIST_TO_SET());
}
// PY-9419
public void testConvertSetToTuple() {
doIntentionTest(CONVERT_SET_TO_TUPLE);
doIntentionTest(getCONVERT_SET_TO_TUPLE());
}
// PY-9419
public void testConvertSetWithoutClosingBraceToTuple() {
doIntentionTest(CONVERT_SET_TO_TUPLE);
doIntentionTest(getCONVERT_SET_TO_TUPLE());
}
// PY-9419
public void testConvertSetToList() {
doIntentionTest(CONVERT_SET_TO_LIST);
doIntentionTest(getCONVERT_SET_TO_LIST());
}
// PY-16335
public void testConvertLiteralPreservesFormattingAndComments() {
doIntentionTest(CONVERT_TUPLE_TO_LIST);
doIntentionTest(getCONVERT_TUPLE_TO_LIST());
}
// PY-16553
public void testConvertOneElementListToTuple() {
doIntentionTest(CONVERT_LIST_TO_TUPLE);
doIntentionTest(getCONVERT_LIST_TO_TUPLE());
}
// PY-16553
public void testConvertOneElementIncompleteListToTuple() {
doIntentionTest(CONVERT_LIST_TO_TUPLE);
doIntentionTest(getCONVERT_LIST_TO_TUPLE());
}
// PY-16553
public void testConvertOneElementListWithCommentToTuple() {
doIntentionTest(CONVERT_LIST_TO_TUPLE);
doIntentionTest(getCONVERT_LIST_TO_TUPLE());
}
// PY-16553
public void testConvertOneElementListWithCommaAfterCommentToTuple() {
doIntentionTest(CONVERT_LIST_TO_TUPLE);
doIntentionTest(getCONVERT_LIST_TO_TUPLE());
}
// PY-16553
public void testConvertOneElementTupleToList() {
doIntentionTest(CONVERT_TUPLE_TO_LIST);
doIntentionTest(getCONVERT_TUPLE_TO_LIST());
}
// PY-16553
public void testConvertOneElementTupleWithoutParenthesesToSet() {
doIntentionTest(CONVERT_TUPLE_TO_SET);
doIntentionTest(getCONVERT_TUPLE_TO_SET());
}
// PY-16553
public void testConvertOneElementTupleWithCommentToList() {
doIntentionTest(CONVERT_TUPLE_TO_LIST);
doIntentionTest(getCONVERT_TUPLE_TO_LIST());
}
// PY-19399
public void testCannotConvertEmptyTupleToSet() {
doNegativeTest(CONVERT_TUPLE_TO_SET);
doNegativeTest(getCONVERT_TUPLE_TO_SET());
}
// PY-19399
public void testCannotConvertEmptyListToSet() {
doNegativeTest(CONVERT_LIST_TO_SET);
doNegativeTest(getCONVERT_LIST_TO_SET());
}
private static String getCONVERT_TUPLE_TO_LIST() {
return PyBundle.message("INTN.convert.collection.literal.text", "tuple", "list");
}
private static String getCONVERT_TUPLE_TO_SET() {
return PyBundle.message("INTN.convert.collection.literal.text", "tuple", "set");
}
private static String getCONVERT_LIST_TO_TUPLE() {
return PyBundle.message("INTN.convert.collection.literal.text", "list", "tuple");
}
private static String getCONVERT_LIST_TO_SET() {
return PyBundle.message("INTN.convert.collection.literal.text", "list", "set");
}
private static String getCONVERT_SET_TO_TUPLE() {
return PyBundle.message("INTN.convert.collection.literal.text", "set", "tuple");
}
private static String getCONVERT_SET_TO_LIST() {
return PyBundle.message("INTN.convert.collection.literal.text", "set", "list");
}
}