mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
LAB-62 get rid of static *Bundle usages: more fields with better names
GitOrigin-RevId: 494947dafcce4d4284464de89b472861fdf9c093
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8fd0bcff95
commit
bb8b4b8c66
+1
-1
@@ -175,7 +175,7 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
|
||||
}
|
||||
}
|
||||
};
|
||||
setFixedColumnWidth(ClasspathTableModel.EXPORT_COLUMN, ClasspathTableModel.getEXPORT_COLUMN_NAME());
|
||||
setFixedColumnWidth(ClasspathTableModel.EXPORT_COLUMN, ClasspathTableModel.getExportColumnName());
|
||||
setFixedColumnWidth(ClasspathTableModel.SCOPE_COLUMN, DependencyScope.COMPILE.toString() + " "); // leave space for combobox border
|
||||
myEntryTable.getTableHeader().getColumnModel().getColumn(ClasspathTableModel.ITEM_COLUMN).setPreferredWidth(10000); // consume all available space
|
||||
|
||||
|
||||
+3
-2
@@ -38,7 +38,8 @@ import java.util.List;
|
||||
* @author nik
|
||||
*/
|
||||
class ClasspathTableModel extends ListTableModel<ClasspathTableItem<?>> implements ItemRemovable {
|
||||
private static final ColumnInfo<ClasspathTableItem<?>, Boolean> EXPORT_COLUMN_INFO = new ColumnInfo<ClasspathTableItem<?>, Boolean>(getEXPORT_COLUMN_NAME()) {
|
||||
private static final ColumnInfo<ClasspathTableItem<?>, Boolean> EXPORT_COLUMN_INFO = new ColumnInfo<ClasspathTableItem<?>, Boolean>(
|
||||
getExportColumnName()) {
|
||||
@Nullable
|
||||
@Override
|
||||
public Boolean valueOf(ClasspathTableItem<?> item) {
|
||||
@@ -188,7 +189,7 @@ class ClasspathTableModel extends ListTableModel<ClasspathTableItem<?>> implemen
|
||||
return ProjectBundle.message("modules.order.export.scope.column");
|
||||
}
|
||||
|
||||
static String getEXPORT_COLUMN_NAME() {
|
||||
static String getExportColumnName() {
|
||||
return ProjectBundle.message("modules.order.export.export.column");
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -218,7 +218,7 @@ public class LiveTemplateSettingsEditor extends JPanel {
|
||||
|
||||
gbConstraints.gridx = 1;
|
||||
gbConstraints.insets = JBUI.insetsLeft(4);
|
||||
myExpandByCombo = new ComboBox<>(new String[]{myDefaultShortcutItem, getSPACE(), getTAB(), getENTER(), getNONE()});
|
||||
myExpandByCombo = new ComboBox<>(new String[]{myDefaultShortcutItem, getSpace(), getTab(), getEnter(), getNone()});
|
||||
myExpandByCombo.addItemListener(new ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(@NotNull ItemEvent e) {
|
||||
@@ -226,13 +226,13 @@ public class LiveTemplateSettingsEditor extends JPanel {
|
||||
if(myDefaultShortcutItem.equals(selectedItem)) {
|
||||
myTemplate.setShortcutChar(TemplateSettings.DEFAULT_CHAR);
|
||||
}
|
||||
else if(getTAB().equals(selectedItem)) {
|
||||
else if(getTab().equals(selectedItem)) {
|
||||
myTemplate.setShortcutChar(TemplateSettings.TAB_CHAR);
|
||||
}
|
||||
else if(getENTER().equals(selectedItem)) {
|
||||
else if(getEnter().equals(selectedItem)) {
|
||||
myTemplate.setShortcutChar(TemplateSettings.ENTER_CHAR);
|
||||
}
|
||||
else if (getSPACE().equals(selectedItem)) {
|
||||
else if (getSpace().equals(selectedItem)) {
|
||||
myTemplate.setShortcutChar(TemplateSettings.SPACE_CHAR);
|
||||
}
|
||||
else {
|
||||
@@ -484,16 +484,16 @@ public class LiveTemplateSettingsEditor extends JPanel {
|
||||
myExpandByCombo.setSelectedItem(myDefaultShortcutItem);
|
||||
}
|
||||
else if(myTemplate.getShortcutChar() == TemplateSettings.TAB_CHAR) {
|
||||
myExpandByCombo.setSelectedItem(getTAB());
|
||||
myExpandByCombo.setSelectedItem(getTab());
|
||||
}
|
||||
else if(myTemplate.getShortcutChar() == TemplateSettings.ENTER_CHAR) {
|
||||
myExpandByCombo.setSelectedItem(getENTER());
|
||||
myExpandByCombo.setSelectedItem(getEnter());
|
||||
}
|
||||
else if (myTemplate.getShortcutChar() == TemplateSettings.SPACE_CHAR) {
|
||||
myExpandByCombo.setSelectedItem(getSPACE());
|
||||
myExpandByCombo.setSelectedItem(getSpace());
|
||||
}
|
||||
else {
|
||||
myExpandByCombo.setSelectedItem(getNONE());
|
||||
myExpandByCombo.setSelectedItem(getNone());
|
||||
}
|
||||
|
||||
CommandProcessor.getInstance().executeCommand(
|
||||
@@ -588,19 +588,19 @@ public class LiveTemplateSettingsEditor extends JPanel {
|
||||
return map;
|
||||
}
|
||||
|
||||
private static String getSPACE() {
|
||||
private static String getSpace() {
|
||||
return CodeInsightBundle.message("template.shortcut.space");
|
||||
}
|
||||
|
||||
private static String getTAB() {
|
||||
private static String getTab() {
|
||||
return CodeInsightBundle.message("template.shortcut.tab");
|
||||
}
|
||||
|
||||
private static String getENTER() {
|
||||
private static String getEnter() {
|
||||
return CodeInsightBundle.message("template.shortcut.enter");
|
||||
}
|
||||
|
||||
private static String getNONE() {
|
||||
private static String getNone() {
|
||||
return CodeInsightBundle.message("template.shortcut.none");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
|
||||
public static final String SCOPE_PROJECT = "Production";
|
||||
|
||||
/**
|
||||
* Use {code {@link #getSCOPE_ALL()}} instead
|
||||
* Use {code {@link #getScopeAll()}} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String SCOPE_ALL = "All";
|
||||
@@ -124,7 +124,7 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
|
||||
for (Map.Entry<String, JTree> entry : type2treeMap.entrySet()) {
|
||||
JTree tree = entry.getValue();
|
||||
String type = entry.getKey();
|
||||
String scope = state.SCOPE != null ? state.SCOPE : getSCOPE_ALL();
|
||||
String scope = state.SCOPE != null ? state.SCOPE : getScopeAll();
|
||||
|
||||
OccurenceNavigatorSupport occurenceNavigatorSupport = new OccurenceNavigatorSupport(tree) {
|
||||
@Override
|
||||
@@ -710,9 +710,9 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
|
||||
private Collection<String> getValidScopeNames() {
|
||||
List<String> result = new ArrayList<>();
|
||||
result.add(getScopeProject());
|
||||
result.add(getSCOPE_TEST());
|
||||
result.add(getSCOPE_ALL());
|
||||
result.add(getSCOPE_CLASS());
|
||||
result.add(getScopeTest());
|
||||
result.add(getScopeAll());
|
||||
result.add(getScopeClass());
|
||||
|
||||
final NamedScopesHolder[] holders = NamedScopesHolder.getAllNamedScopeHolders(myProject);
|
||||
for (NamedScopesHolder holder : holders) {
|
||||
@@ -795,7 +795,7 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
EditScopesDialog.showDialog(myProject, null);
|
||||
if (!getValidScopeNames().contains(getCurrentScopeType())) {
|
||||
selectScope(getSCOPE_ALL());
|
||||
selectScope(getScopeAll());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -805,15 +805,15 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
|
||||
return IdeBundle.message("hierarchy.scope.project");
|
||||
}
|
||||
|
||||
public static String getSCOPE_ALL() {
|
||||
public static String getScopeAll() {
|
||||
return IdeBundle.message("hierarchy.scope.all");
|
||||
}
|
||||
|
||||
public static String getSCOPE_TEST() {
|
||||
public static String getScopeTest() {
|
||||
return IdeBundle.message("hierarchy.scope.test");
|
||||
}
|
||||
|
||||
public static String getSCOPE_CLASS() {
|
||||
public static String getScopeClass() {
|
||||
return IdeBundle.message("hierarchy.scope.this.class");
|
||||
}
|
||||
}
|
||||
@@ -136,13 +136,13 @@ public abstract class HierarchyTreeStructure extends AbstractTreeStructure {
|
||||
|
||||
protected SearchScope getSearchScope(final String scopeType, final PsiElement thisClass) {
|
||||
SearchScope searchScope = GlobalSearchScope.allScope(myProject);
|
||||
if (HierarchyBrowserBaseEx.getSCOPE_CLASS().equals(scopeType)) {
|
||||
if (HierarchyBrowserBaseEx.getScopeClass().equals(scopeType)) {
|
||||
searchScope = new LocalSearchScope(thisClass);
|
||||
}
|
||||
else if (HierarchyBrowserBaseEx.getScopeProject().equals(scopeType)) {
|
||||
searchScope = GlobalSearchScopesCore.projectProductionScope(myProject);
|
||||
}
|
||||
else if (HierarchyBrowserBaseEx.getSCOPE_TEST().equals(scopeType)) {
|
||||
else if (HierarchyBrowserBaseEx.getScopeTest().equals(scopeType)) {
|
||||
searchScope = GlobalSearchScopesCore.projectTestScope(myProject);
|
||||
} else {
|
||||
final NamedScope namedScope = NamedScopesHolder.getScope(myProject, scopeType);
|
||||
@@ -154,18 +154,18 @@ public abstract class HierarchyTreeStructure extends AbstractTreeStructure {
|
||||
}
|
||||
|
||||
protected boolean isInScope(final PsiElement baseClass, @NotNull PsiElement srcElement, final String scopeType) {
|
||||
if (HierarchyBrowserBaseEx.getSCOPE_CLASS().equals(scopeType)) {
|
||||
if (HierarchyBrowserBaseEx.getScopeClass().equals(scopeType)) {
|
||||
return PsiTreeUtil.isAncestor(baseClass, srcElement, true);
|
||||
}
|
||||
if (HierarchyBrowserBaseEx.getScopeProject().equals(scopeType)) {
|
||||
final VirtualFile virtualFile = srcElement.getContainingFile().getVirtualFile();
|
||||
return virtualFile == null || !TestSourcesFilter.isTestSources(virtualFile, myProject);
|
||||
}
|
||||
if (HierarchyBrowserBaseEx.getSCOPE_TEST().equals(scopeType)) {
|
||||
if (HierarchyBrowserBaseEx.getScopeTest().equals(scopeType)) {
|
||||
final VirtualFile virtualFile = srcElement.getContainingFile().getVirtualFile();
|
||||
return virtualFile == null || TestSourcesFilter.isTestSources(virtualFile, myProject);
|
||||
}
|
||||
if (HierarchyBrowserBaseEx.getSCOPE_ALL().equals(scopeType)) {
|
||||
if (HierarchyBrowserBaseEx.getScopeAll().equals(scopeType)) {
|
||||
return true;
|
||||
}
|
||||
final NamedScope namedScope = NamedScopesHolder.getScope(myProject, scopeType);
|
||||
|
||||
@@ -70,7 +70,7 @@ public class RenameDialog extends RefactoringDialog {
|
||||
myPsiElement = psiElement;
|
||||
myNameSuggestionContext = nameSuggestionContext;
|
||||
myEditor = editor;
|
||||
setTitle(getREFACTORING_NAME());
|
||||
setTitle(getRefactoringName());
|
||||
|
||||
createNewNameComponent();
|
||||
init();
|
||||
@@ -364,7 +364,7 @@ public class RenameDialog extends RefactoringDialog {
|
||||
return myCbSearchInComments;
|
||||
}
|
||||
|
||||
private static String getREFACTORING_NAME() {
|
||||
private static String getRefactoringName() {
|
||||
return RefactoringBundle.message("rename.title");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user