mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Rename method
This commit is contained in:
@@ -89,13 +89,13 @@ public abstract class Executor {
|
||||
public abstract String getHelpId();
|
||||
|
||||
public String getStartActionText(String configurationName) {
|
||||
return getStartActionText() + (StringUtil.isEmpty(configurationName) ? "" : " '" + getShortenName(configurationName) + "'");
|
||||
return getStartActionText() + (StringUtil.isEmpty(configurationName) ? "" : " '" + shortenNameIfNeed(configurationName) + "'");
|
||||
}
|
||||
|
||||
/**
|
||||
* Too long names don't fit into UI controls and has to be trimmed
|
||||
*/
|
||||
public static String getShortenName(@NotNull String name) {
|
||||
public static String shortenNameIfNeed(@NotNull String name) {
|
||||
return StringUtil.first(name, Registry.intValue("run.configuration.max.name.length", 40), true);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -353,7 +353,7 @@ public class ChooseRunConfigurationPopup implements ExecutorProvider {
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return Executor.getShortenName(getValue().getName());
|
||||
return Executor.shortenNameIfNeed(getValue().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -512,7 +512,7 @@ public class ChooseRunConfigurationPopup implements ExecutorProvider {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Executor.getShortenName(mySettings.getName());
|
||||
return Executor.shortenNameIfNeed(mySettings.getName());
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
@@ -1071,7 +1071,7 @@ public class ChooseRunConfigurationPopup implements ExecutorProvider {
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return Executor.getShortenName(configuration.getName());
|
||||
return Executor.shortenNameIfNeed(configuration.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -81,7 +81,7 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D
|
||||
@Nullable Project project,
|
||||
@NotNull Presentation presentation) {
|
||||
if (project != null && target != null && settings != null) {
|
||||
String name = Executor.getShortenName(settings.getName());
|
||||
String name = Executor.shortenNameIfNeed(settings.getName());
|
||||
if (target != DefaultExecutionTarget.INSTANCE) {
|
||||
name += " | " + target.getDisplayName();
|
||||
} else {
|
||||
@@ -207,7 +207,7 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D
|
||||
disable(presentation);
|
||||
}
|
||||
else {
|
||||
presentation.setText(ExecutionBundle.message("save.temporary.run.configuration.action.name", Executor.getShortenName(settings.getName())));
|
||||
presentation.setText(ExecutionBundle.message("save.temporary.run.configuration.action.name", Executor.shortenNameIfNeed(settings.getName())));
|
||||
presentation.setDescription(presentation.getText());
|
||||
presentation.setVisible(true);
|
||||
presentation.setEnabled(true);
|
||||
@@ -268,7 +268,7 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D
|
||||
public SelectConfigAction(final RunnerAndConfigurationSettings configuration, final Project project) {
|
||||
myConfiguration = configuration;
|
||||
myProject = project;
|
||||
String name = Executor.getShortenName(configuration.getName());
|
||||
String name = Executor.shortenNameIfNeed(configuration.getName());
|
||||
if (name.isEmpty()) {
|
||||
name = " ";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class CoverageExecutor extends Executor {
|
||||
|
||||
@Override
|
||||
public String getStartActionText(String configurationName) {
|
||||
final String name = configurationName != null ? escapeMnemonicsInConfigurationName(getShortenName(configurationName)) : null;
|
||||
final String name = configurationName != null ? escapeMnemonicsInConfigurationName(shortenNameIfNeed(configurationName)) : null;
|
||||
return "Run" + (StringUtil.isEmpty(name) ? "" : " '" + name + "'") + " with Co_verage";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user