Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
799dc447
Commit
799dc447
authored
7 years ago
by
Dmitry Jemerov
Browse files
Options
Download
Email Patches
Plain Diff
API for replacing term "project" used in the UI
parent
42a95a9f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java
+1
-1
.../src/com/intellij/ide/actions/SearchEverywhereAction.java
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoClassModel2.java
+3
-2
...src/com/intellij/ide/util/gotoByName/GotoClassModel2.java
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileModel.java
+2
-1
...l/src/com/intellij/ide/util/gotoByName/GotoFileModel.java
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoSymbolModel2.java
+3
-2
...rc/com/intellij/ide/util/gotoByName/GotoSymbolModel2.java
platform/platform-api/src/com/intellij/ui/ProjectUICustomization.java
+49
-0
...tform-api/src/com/intellij/ui/ProjectUICustomization.java
platform/platform-impl/src/com/intellij/ide/GeneralSettingsConfigurable.java
+10
-2
...mpl/src/com/intellij/ide/GeneralSettingsConfigurable.java
platform/platform-impl/src/com/intellij/ide/GeneralSettingsPanel.form
+1
-1
...tform-impl/src/com/intellij/ide/GeneralSettingsPanel.form
platform/platform-impl/src/com/intellij/ide/actions/CloseProjectAction.java
+3
-2
...impl/src/com/intellij/ide/actions/CloseProjectAction.java
platform/platform-resources/src/META-INF/PlatformExtensions.xml
+2
-0
...rm/platform-resources/src/META-INF/PlatformExtensions.xml
with
74 additions
and
11 deletions
+74
-11
platform/lang-impl/src/com/intellij/ide/actions/SearchEverywhereAction.java
+
1
-
1
View file @
799dc447
...
...
@@ -672,7 +672,7 @@ public class SearchEverywhereAction extends AnAction implements CustomComponentA
UIManager
.
getColor
(
"SearchEverywhere.shortcutForeground"
)
:
foregroundColor
;
StringBuilder
cbText
=
new
StringBuilder
(
"<html>"
);
cbText
.
append
(
IdeBundle
.
message
(
"checkbox.include.non.project.items"
));
cbText
.
append
(
ProjectUICustomization
.
replaceProjectConceptName
(
IdeBundle
.
message
(
"checkbox.include.non.project.items"
))
)
;
cbText
.
append
(
" "
);
if
(!
UIUtil
.
isUnderWin10LookAndFeel
())
cbText
.
append
(
"<b>"
);
cbText
.
append
(
"<font color=#"
).
append
(
ColorUtil
.
toHex
(
shortcutColor
)).
append
(
">"
).
append
(
getShortcut
()).
append
(
"</font>"
);
...
...
This diff is collapsed.
Click to expand it.
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoClassModel2.java
+
3
-
2
View file @
799dc447
...
...
@@ -27,6 +27,7 @@ import com.intellij.openapi.project.Project;
import
com.intellij.openapi.util.SystemInfo
;
import
com.intellij.openapi.util.text.StringUtil
;
import
com.intellij.psi.PsiElement
;
import
com.intellij.ui.ProjectUICustomization
;
import
com.intellij.util.ArrayUtil
;
import
com.intellij.util.containers.ContainerUtil
;
import
com.intellij.util.indexing.FileBasedIndex
;
...
...
@@ -68,12 +69,12 @@ public class GotoClassModel2 extends FilteringGotoByModel<Language> {
@Override
public
String
getCheckBoxName
()
{
return
IdeBundle
.
message
(
"checkbox.include.non.project.classes"
);
return
ProjectUICustomization
.
replaceProjectConceptName
(
IdeBundle
.
message
(
"checkbox.include.non.project.classes"
)
)
;
}
@Override
public
String
getNotInMessage
()
{
return
IdeBundle
.
message
(
"label.no.matches.found.in.project"
);
return
ProjectUICustomization
.
replaceProjectConceptName
(
IdeBundle
.
message
(
"label.no.matches.found.in.project"
)
)
;
}
@Override
...
...
This diff is collapsed.
Click to expand it.
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoFileModel.java
+
2
-
1
View file @
799dc447
...
...
@@ -24,6 +24,7 @@ import com.intellij.psi.PsiFile;
import
com.intellij.psi.PsiFileSystemItem
;
import
com.intellij.psi.codeStyle.MinusculeMatcher
;
import
com.intellij.psi.codeStyle.NameUtil
;
import
com.intellij.ui.ProjectUICustomization
;
import
com.intellij.util.containers.JBIterable
;
import
com.intellij.util.indexing.FileBasedIndex
;
import
org.jetbrains.annotations.NotNull
;
...
...
@@ -94,7 +95,7 @@ public class GotoFileModel extends FilteringGotoByModel<FileType> implements Dum
if
(
NonProjectScopeDisablerEP
.
isSearchInNonProjectDisabled
())
{
return
null
;
}
return
IdeBundle
.
message
(
"checkbox.include.non.project.files"
);
return
ProjectUICustomization
.
replaceProjectConceptName
(
IdeBundle
.
message
(
"checkbox.include.non.project.files"
)
)
;
}
@Override
...
...
This diff is collapsed.
Click to expand it.
platform/lang-impl/src/com/intellij/ide/util/gotoByName/GotoSymbolModel2.java
+
3
-
2
View file @
799dc447
...
...
@@ -26,6 +26,7 @@ import com.intellij.openapi.project.Project;
import
com.intellij.openapi.util.SystemInfo
;
import
com.intellij.psi.PsiElement
;
import
com.intellij.psi.presentation.java.SymbolPresentationUtil
;
import
com.intellij.ui.ProjectUICustomization
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
...
...
@@ -66,12 +67,12 @@ public class GotoSymbolModel2 extends FilteringGotoByModel<Language> {
@Override
public
String
getCheckBoxName
()
{
return
IdeBundle
.
message
(
"checkbox.include.non.project.symbols"
);
return
ProjectUICustomization
.
replaceProjectConceptName
(
IdeBundle
.
message
(
"checkbox.include.non.project.symbols"
)
)
;
}
@Override
public
String
getNotInMessage
()
{
return
IdeBundle
.
message
(
"label.no.matches.found.in.project"
);
return
ProjectUICustomization
.
replaceProjectConceptName
(
IdeBundle
.
message
(
"label.no.matches.found.in.project"
)
)
;
}
@Override
...
...
This diff is collapsed.
Click to expand it.
platform/platform-api/src/com/intellij/ui/ProjectUICustomization.java
0 → 100644
+
49
-
0
View file @
799dc447
// Copyright 2000-2018 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.ui
;
import
com.intellij.openapi.components.ServiceManager
;
import
com.intellij.openapi.util.text.StringUtil
;
import
javax.swing.*
;
import
javax.swing.border.Border
;
import
javax.swing.border.TitledBorder
;
/**
* Allows to apply IDE-specific customizations to the terms used in platform UI features.
*/
public
class
ProjectUICustomization
{
public
static
ProjectUICustomization
getInstance
()
{
return
ServiceManager
.
getService
(
ProjectUICustomization
.
class
);
}
/**
* Returns the name to be displayed in the UI for the "project" concept (Rider changes this to "solution").
*/
public
String
getProjectConceptName
()
{
return
"project"
;
}
public
static
String
replaceProjectConceptName
(
String
text
)
{
return
text
.
replace
(
"project"
,
getInstance
().
getProjectConceptName
());
}
public
static
void
replaceProjectConceptName
(
AbstractButton
component
)
{
component
.
setText
(
component
.
getText
().
replace
(
"project"
,
getInstance
().
getProjectConceptName
()));
}
public
static
void
replaceProjectConceptName
(
Border
border
)
{
if
(
border
instanceof
TitledBorder
)
{
TitledBorder
titledBorder
=
(
TitledBorder
)
border
;
titledBorder
.
setTitle
(
titledBorder
.
getTitle
().
replace
(
"project"
,
getInstance
().
getProjectConceptName
()));
}
}
public
static
String
replaceProjectConceptNameForAction
(
String
actionName
)
{
String
name
=
getInstance
().
getProjectConceptName
();
if
(
name
.
equals
(
"project"
))
{
return
actionName
;
}
return
actionName
.
replace
(
"_"
,
""
).
replace
(
"project"
,
name
).
replace
(
"Project"
,
StringUtil
.
capitalize
(
name
));
}
}
This diff is collapsed.
Click to expand it.
platform/platform-impl/src/com/intellij/ide/GeneralSettingsConfigurable.java
+
10
-
2
View file @
799dc447
...
...
@@ -25,6 +25,7 @@ import com.intellij.openapi.options.ConfigurationException;
import
com.intellij.openapi.options.SearchableConfigurable
;
import
com.intellij.openapi.options.ex.ConfigurableWrapper
;
import
com.intellij.openapi.ui.TextFieldWithBrowseButton
;
import
com.intellij.ui.ProjectUICustomization
;
import
com.intellij.ui.components.JBRadioButton
;
import
com.intellij.util.PlatformUtils
;
import
org.jetbrains.annotations.NotNull
;
...
...
@@ -216,8 +217,15 @@ public class GeneralSettingsConfigurable extends CompositeConfigurable<Searchabl
private
JBRadioButton
myDisconnectJBRadioButton
;
private
JBRadioButton
myAskJBRadioButton
;
private
TextFieldWithBrowseButton
myProjectDirectoryTextField
;
public
MyComponent
()
{
}
private
JPanel
myProjectOpeningPanel
;
public
MyComponent
()
{
ProjectUICustomization
.
replaceProjectConceptName
(
myChkReopenLastProject
);
ProjectUICustomization
.
replaceProjectConceptName
(
myProjectOpeningPanel
.
getBorder
());
ProjectUICustomization
.
replaceProjectConceptName
(
myOpenProjectInNewWindow
);
ProjectUICustomization
.
replaceProjectConceptName
(
myOpenProjectInSameWindow
);
ProjectUICustomization
.
replaceProjectConceptName
(
myConfirmWindowToOpenProject
);
}
private
void
createUIComponents
()
{
myProjectDirectoryTextField
=
new
TextFieldWithBrowseButton
();
...
...
This diff is collapsed.
Click to expand it.
platform/platform-impl/src/com/intellij/ide/GeneralSettingsPanel.form
+
1
-
1
View file @
799dc447
...
...
@@ -181,7 +181,7 @@
<border
type=
"none"
/>
<children/>
</grid>
<grid
id=
"dab62"
layout-manager=
"GridLayoutManager"
row-count=
"5"
column-count=
"1"
same-size-horizontally=
"false"
same-size-vertically=
"false"
hgap=
"-1"
vgap=
"-1"
>
<grid
id=
"dab62"
binding=
"myProjectOpeningPanel"
layout-manager=
"GridLayoutManager"
row-count=
"5"
column-count=
"1"
same-size-horizontally=
"false"
same-size-vertically=
"false"
hgap=
"-1"
vgap=
"-1"
>
<margin
top=
"0"
left=
"0"
bottom=
"0"
right=
"0"
/>
<constraints>
<grid
row=
"1"
column=
"0"
row-span=
"1"
col-span=
"1"
vsize-policy=
"3"
hsize-policy=
"3"
anchor=
"0"
fill=
"3"
indent=
"0"
use-parent-layout=
"false"
/>
...
...
This diff is collapsed.
Click to expand it.
platform/platform-impl/src/com/intellij/ide/actions/CloseProjectAction.java
+
3
-
2
View file @
799dc447
...
...
@@ -26,6 +26,7 @@ import com.intellij.openapi.project.DumbAware;
import
com.intellij.openapi.project.Project
;
import
com.intellij.openapi.wm.impl.welcomeScreen.WelcomeFrame
;
import
com.intellij.projectImport.ProjectAttachProcessor
;
import
com.intellij.ui.ProjectUICustomization
;
public
class
CloseProjectAction
extends
AnAction
implements
DumbAware
{
@Override
...
...
@@ -43,10 +44,10 @@ public class CloseProjectAction extends AnAction implements DumbAware {
Project
project
=
event
.
getData
(
CommonDataKeys
.
PROJECT
);
presentation
.
setEnabled
(
project
!=
null
);
if
(
ProjectAttachProcessor
.
canAttachToProject
()
&&
project
!=
null
&&
ModuleManager
.
getInstance
(
project
).
getModules
().
length
>
1
)
{
presentation
.
setText
(
IdeBundle
.
message
(
"action.close.projects.in.current.window"
));
presentation
.
setText
(
ProjectUICustomization
.
replaceProjectConceptNameForAction
(
IdeBundle
.
message
(
"action.close.projects.in.current.window"
))
)
;
}
else
{
presentation
.
setText
(
IdeBundle
.
message
(
"action.close.project"
));
presentation
.
setText
(
ProjectUICustomization
.
replaceProjectConceptNameForAction
(
IdeBundle
.
message
(
"action.close.project"
))
)
;
}
}
}
This diff is collapsed.
Click to expand it.
platform/platform-resources/src/META-INF/PlatformExtensions.xml
+
2
-
0
View file @
799dc447
...
...
@@ -294,6 +294,8 @@
<postStartupActivity
implementation=
"com.intellij.internal.IconsLoadTime$StartupLoadTime"
/>
<applicationService
serviceImplementation=
"com.intellij.ui.ProjectUICustomization"
/>
<!-- General -->
<applicationConfigurable
groupId=
"appearance"
groupWeight=
"120"
key=
"title.general"
bundle=
"messages.IdeBundle"
id=
"preferences.general"
instance=
"com.intellij.ide.GeneralSettingsConfigurable"
/>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment