make Presentation.setText(Bundle.message("...")) dynamic

GitOrigin-RevId: 54426726328063349514b0a0322cb638c398e8a5
This commit is contained in:
Dmitry.Krasilschikov
2020-01-28 14:37:01 +00:00
committed by intellij-monorepo-bot
parent 125d868d69
commit b2b337bef3
93 changed files with 134 additions and 130 deletions
@@ -92,7 +92,7 @@ public class InterruptThreadAction extends DebuggerAction{
}
}
final Presentation presentation = e.getPresentation();
presentation.setText(DebuggerBundle.message("action.interrupt.thread.text"));
presentation.setText(() -> DebuggerBundle.message("action.interrupt.thread.text"));
presentation.setEnabledAndVisible(visible && enabled);
}
}
@@ -92,7 +92,7 @@ public class ToggleFieldBreakpointAction extends AnAction {
presentation.setVisible(toEnable);
}
else if(DebuggerAction.isContextView(event)) {
presentation.setText(DebuggerBundle.message("action.add.field.watchpoint.text"));
presentation.setText(() -> DebuggerBundle.message("action.add.field.watchpoint.text"));
Project project = event.getData(CommonDataKeys.PROJECT);
if(project != null && place != null) {
Document document = PsiDocumentManager.getInstance(project).getDocument(place.getFile());
@@ -59,7 +59,7 @@ public class ViewTextAction extends XFetchValueActionBase {
public void update(@NotNull AnActionEvent e) {
super.update(e);
if (getStringNode(e) != null) {
e.getPresentation().setText(ActionsBundle.message("action.Debugger.ViewEditText.text"));
e.getPresentation().setText(() -> ActionsBundle.message("action.Debugger.ViewEditText.text"));
}
}
@@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
public class TemplateProjectStructureAction extends ShowStructureSettingsAction {
public TemplateProjectStructureAction() {
String projectConceptName = StringUtil.capitalize(IdeUICustomization.getInstance().getProjectConceptName());
getTemplatePresentation().setText(ActionsBundle.message("action.TemplateProjectStructure.text.template", projectConceptName));
getTemplatePresentation().setText(() -> ActionsBundle.message("action.TemplateProjectStructure.text.template", projectConceptName));
getTemplatePresentation().setDescription(ActionsBundle.message("action.TemplateProjectStructure.description.template", projectConceptName));
}
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
public class AttachExternalProjectAction extends DumbAwareAction {
public AttachExternalProjectAction() {
getTemplatePresentation().setText(ExternalSystemBundle.message("action.attach.external.project.text", "External"));
getTemplatePresentation().setText(() -> ExternalSystemBundle.message("action.attach.external.project.text", "External"));
getTemplatePresentation().setDescription(ExternalSystemBundle.message("action.attach.external.project.description", "external"));
}
@@ -34,7 +34,7 @@ public class AttachExternalProjectAction extends DumbAwareAction {
ProjectSystemId externalSystemId = e.getData(ExternalSystemDataKeys.EXTERNAL_SYSTEM_ID);
if (externalSystemId != null) {
String name = externalSystemId.getReadableName();
presentation.setText(ExternalSystemBundle.message("action.attach.external.project.text", name));
presentation.setText(() -> ExternalSystemBundle.message("action.attach.external.project.text", name));
presentation.setDescription(ExternalSystemBundle.message("action.attach.external.project.description", name));
}
@@ -34,7 +34,7 @@ public class EditRunConfigurationsAction extends DumbAwareAction {
Project project = e.getProject();
presentation.setEnabled(project == null || !DumbService.isDumb(project));
if (ActionPlaces.RUN_CONFIGURATIONS_COMBOBOX.equals(e.getPlace())) {
presentation.setText(ExecutionBundle.message("edit.configuration.action"));
presentation.setText(() -> ExecutionBundle.message("edit.configuration.action"));
presentation.setDescription(presentation.getText());
}
}
@@ -254,7 +254,7 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D
disable(presentation);
}
else {
presentation.setText(ExecutionBundle.message("save.temporary.run.configuration.action.name", Executor.shortenNameIfNeeded(settings.getName())));
presentation.setText(() -> ExecutionBundle.message("save.temporary.run.configuration.action.name", Executor.shortenNameIfNeeded(settings.getName())));
presentation.setDescription(presentation.getText());
presentation.setEnabledAndVisible(true);
}
@@ -57,7 +57,7 @@ public class StopAction extends DumbAwareAction implements AnAction.TransparentU
icon = IconUtil.addText(icon, String.valueOf(stopCount));
}
else if (stopCount == 1) {
presentation.setText(ExecutionBundle.message("stop.configuration.action.name",
presentation.setText(() -> ExecutionBundle.message("stop.configuration.action.name",
StringUtil.escapeMnemonics(
StringUtil.notNullize(stoppableDescriptors.get(0).getDisplayName()))));
}
@@ -81,7 +81,7 @@ public class StopAction extends DumbAwareAction implements AnAction.TransparentU
presentation.setText(getTemplatePresentation().getText());
}
else {
presentation.setText(ExecutionBundle.message("stop.configuration.action.name",
presentation.setText(() -> ExecutionBundle.message("stop.configuration.action.name",
StringUtil.escapeMnemonics(runProfile == null
? StringUtil.notNullize(contentDescriptor.getDisplayName())
: runProfile.getName())));
@@ -26,7 +26,7 @@ public class FakeRerunAction extends AnAction {
Presentation presentation = event.getPresentation();
ExecutionEnvironment environment = getEnvironment(event);
if (environment != null) {
presentation.setText(ExecutionBundle.message("rerun.configuration.action.name",
presentation.setText(() -> ExecutionBundle.message("rerun.configuration.action.name",
StringUtil.escapeMnemonics(environment.getRunProfile().getName())));
presentation.setIcon(
ActionPlaces.TOUCHBAR_GENERAL.equals(event.getPlace()) || ExecutionManagerImpl.isProcessRunning(getDescriptor(event)) ?
@@ -29,7 +29,7 @@ public class DetachExternalProjectAction extends ExternalSystemNodeAction<Projec
public DetachExternalProjectAction() {
super(ProjectData.class);
getTemplatePresentation().setText(ExternalSystemBundle.message("action.detach.external.project.text", "External"));
getTemplatePresentation().setText(() -> ExternalSystemBundle.message("action.detach.external.project.text", "External"));
getTemplatePresentation().setDescription(ExternalSystemBundle.message("action.detach.external.project.description"));
getTemplatePresentation().setIcon(AllIcons.General.Remove);
}
@@ -42,7 +42,7 @@ public class DetachExternalProjectAction extends ExternalSystemNodeAction<Projec
ProjectSystemId systemId = getSystemId(e);
final String systemIdName = systemId != null ? systemId.getReadableName() : "External";
Presentation presentation = e.getPresentation();
presentation.setText(ExternalSystemBundle.message("action.detach.external.project.text", systemIdName));
presentation.setText(() -> ExternalSystemBundle.message("action.detach.external.project.text", systemIdName));
}
@Override
@@ -58,7 +58,7 @@ public class DetachExternalProjectAction extends ExternalSystemNodeAction<Projec
@NotNull AnActionEvent e) {
e.getPresentation().setText(
ExternalSystemBundle.message("action.detach.external.project.text", projectSystemId.getReadableName())
() -> ExternalSystemBundle.message("action.detach.external.project.text", projectSystemId.getReadableName())
);
final ProjectNode projectNode = e.getData(ExternalSystemDataKeys.SELECTED_PROJECT_NODE);
@@ -38,7 +38,7 @@ public class IgnoreExternalProjectAction extends ExternalSystemToggleAction {
private static final Logger LOG = Logger.getInstance(IgnoreExternalProjectAction.class);
public IgnoreExternalProjectAction() {
getTemplatePresentation().setText(ExternalSystemBundle.message("action.ignore.external.projects.text", "External", 1));
getTemplatePresentation().setText(() -> ExternalSystemBundle.message("action.ignore.external.projects.text", "External", 1));
getTemplatePresentation()
.setDescription(ExternalSystemBundle.message("action.ignore.external.projects.description", "external", 1));
}
@@ -19,7 +19,7 @@ public class OpenExternalConfigAction extends ExternalSystemNodeAction<ExternalC
public OpenExternalConfigAction() {
super(ExternalConfigPathAware.class);
getTemplatePresentation().setText(ExternalSystemBundle.message("action.open.config.text", "External"));
getTemplatePresentation().setText(() -> ExternalSystemBundle.message("action.open.config.text", "External"));
getTemplatePresentation().setDescription(ExternalSystemBundle.message("action.open.config.description", "external"));
}
@@ -34,7 +34,7 @@ public class OpenExternalConfigAction extends ExternalSystemNodeAction<ExternalC
if (config == null) return false;
ProjectSystemId externalSystemId = getSystemId(e);
e.getPresentation().setText(ExternalSystemBundle.message("action.open.config.text", externalSystemId.getReadableName()));
e.getPresentation().setText(() -> ExternalSystemBundle.message("action.open.config.text", externalSystemId.getReadableName()));
e.getPresentation().setDescription(ExternalSystemBundle.message("action.open.config.description", externalSystemId.getReadableName()));
final ExternalSystemUiAware uiAware = getExternalSystemUiAware(e);
if (uiAware != null) {
@@ -25,7 +25,7 @@ public class OpenTasksActivationManagerAction extends ExternalSystemNodeAction<A
public OpenTasksActivationManagerAction() {
super(AbstractExternalEntityData.class);
getTemplatePresentation().setText(ExternalSystemBundle.message("external.system.task.activation.title"));
getTemplatePresentation().setText(() -> ExternalSystemBundle.message("external.system.task.activation.title"));
getTemplatePresentation().setDescription(
ExternalSystemBundle.message("external.system.task.activation.description", "external system"));
}
@@ -38,7 +38,7 @@ public class OpenTasksActivationManagerAction extends ExternalSystemNodeAction<A
final Object externalData = selectedNodes.get(0).getData();
ProjectSystemId projectSystemId = getSystemId(e);
e.getPresentation().setText(ExternalSystemBundle.message("external.system.task.activation.title"));
e.getPresentation().setText(() -> ExternalSystemBundle.message("external.system.task.activation.title"));
e.getPresentation().setDescription(
ExternalSystemBundle.message("external.system.task.activation.description", projectSystemId.getReadableName()));
final boolean isProjectNode = externalData instanceof ProjectData || externalData instanceof ModuleData;
@@ -30,7 +30,7 @@ import java.util.List;
*/
public class RefreshAllExternalProjectsAction extends AnAction implements AnAction.TransparentUpdate, DumbAware {
public RefreshAllExternalProjectsAction() {
getTemplatePresentation().setText(ExternalSystemBundle.message("action.refresh.all.projects.text", "External"));
getTemplatePresentation().setText(() -> ExternalSystemBundle.message("action.refresh.all.projects.text", "External"));
getTemplatePresentation().setDescription(ExternalSystemBundle.message("action.refresh.all.projects.description", "external"));
}
@@ -49,7 +49,7 @@ public class RefreshAllExternalProjectsAction extends AnAction implements AnActi
}
final String name = StringUtil.join(systemIds, projectSystemId -> projectSystemId.getReadableName(), ",");
e.getPresentation().setText(ExternalSystemBundle.message("action.refresh.all.projects.text", name));
e.getPresentation().setText(() -> ExternalSystemBundle.message("action.refresh.all.projects.text", name));
e.getPresentation().setDescription(ExternalSystemBundle.message("action.refresh.all.projects.description", name));
ExternalSystemProcessingManager processingManager = ServiceManager.getService(ExternalSystemProcessingManager.class);
@@ -32,7 +32,7 @@ import java.util.List;
public class RefreshExternalProjectAction extends ExternalSystemNodeAction<AbstractExternalEntityData> implements DumbAware {
public RefreshExternalProjectAction() {
super(AbstractExternalEntityData.class);
getTemplatePresentation().setText(ExternalSystemBundle.message("action.refresh.project.text", "External"));
getTemplatePresentation().setText(() -> ExternalSystemBundle.message("action.refresh.project.text", "External"));
getTemplatePresentation().setDescription(ExternalSystemBundle.message("action.refresh.project.description", "External"));
}
@@ -45,7 +45,7 @@ public class RefreshExternalProjectAction extends ExternalSystemNodeAction<Abstr
final String systemIdNameText = systemId != null ? systemId.getReadableName() : "External";
final String systemIdNameDescription = systemId != null ? systemId.getReadableName() : "external";
Presentation presentation = e.getPresentation();
presentation.setText(ExternalSystemBundle.message("action.refresh.project.text", systemIdNameText));
presentation.setText(() -> ExternalSystemBundle.message("action.refresh.project.text", systemIdNameText));
presentation.setDescription(ExternalSystemBundle.message("action.refresh.project.description", systemIdNameDescription));
}
@@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull;
public class ShowExternalSystemSettingsAction extends ExternalSystemAction {
public ShowExternalSystemSettingsAction() {
getTemplatePresentation().setText(ExternalSystemBundle.message("action.open.settings.text", "External"));
getTemplatePresentation().setText(() -> ExternalSystemBundle.message("action.open.settings.text", "External"));
getTemplatePresentation().setDescription(ExternalSystemBundle.message("action.open.settings.description", "external"));
}
@@ -40,7 +40,7 @@ public class ShowExternalSystemSettingsAction extends ExternalSystemAction {
ProjectSystemId systemId = getSystemId(e);
if (systemId == null) return false;
e.getPresentation().setText(ExternalSystemBundle.message("action.open.settings.text", systemId.getReadableName()));
e.getPresentation().setText(() -> ExternalSystemBundle.message("action.open.settings.text", systemId.getReadableName()));
e.getPresentation().setDescription(ExternalSystemBundle.message("action.open.settings.description", systemId.getReadableName()));
return true;
}
@@ -250,7 +250,7 @@ public class ExternalSystemRunConfiguration extends LocatableConfigurationBase i
Presentation presentation = event.getPresentation();
ExecutionEnvironment environment = getEnvironment(event);
if (environment != null) {
presentation.setText(ExecutionBundle.message("rerun.configuration.action.name",
presentation.setText(() -> ExecutionBundle.message("rerun.configuration.action.name",
StringUtil.escapeMnemonics(environment.getRunProfile().getName())));
Icon icon = ExecutionManagerImpl.isProcessRunning(getDescriptor(event))
? AllIcons.Actions.Restart
@@ -448,7 +448,7 @@ public final class ExternalSystemUtil {
}
};
String systemId = id.getProjectSystemId().getReadableName();
rerunImportAction.getTemplatePresentation().setText(ExternalSystemBundle.message("action.refresh.project.text", systemId));
rerunImportAction.getTemplatePresentation().setText(() -> ExternalSystemBundle.message("action.refresh.project.text", systemId));
rerunImportAction.getTemplatePresentation()
.setDescription(ExternalSystemBundle.message("action.refresh.project.description", systemId));
rerunImportAction.getTemplatePresentation().setIcon(AllIcons.Actions.Refresh);
@@ -28,7 +28,7 @@ public class CloseAction extends AnAction implements DumbAware {
ActionUtil.copyFrom(this, IdeActions.ACTION_CLOSE);
final Presentation templatePresentation = getTemplatePresentation();
templatePresentation.setIcon(AllIcons.Actions.Cancel);
templatePresentation.setText(ExecutionBundle.message("close.tab.action.name"));
templatePresentation.setText(() -> ExecutionBundle.message("close.tab.action.name"));
templatePresentation.setDescription(Presentation.NULL_STRING);
}
@@ -31,7 +31,7 @@ import org.jetbrains.annotations.NotNull;
public class AddArrangementRuleAction extends AbstractArrangementRuleAction implements DumbAware {
public AddArrangementRuleAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.rule.add.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.rule.add.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.rule.add.description"));
getTemplatePresentation().setIcon(IconUtil.getAddIcon());
setEnabledInModalContext(true);
@@ -29,7 +29,7 @@ import org.jetbrains.annotations.NotNull;
public class AddArrangementSectionRuleAction extends AddArrangementRuleAction {
public AddArrangementSectionRuleAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.section.rule.add.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.section.rule.add.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.section.rule.add.description"));
getTemplatePresentation().setIcon(AllIcons.CodeStyle.AddNewSectionRule);
}
@@ -30,7 +30,7 @@ import org.jetbrains.annotations.NotNull;
public class EditArrangementRuleAction extends AbstractArrangementRuleAction implements DumbAware, Toggleable {
public EditArrangementRuleAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.rule.edit.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.rule.edit.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.rule.edit.description"));
getTemplatePresentation().setIcon(IconUtil.getEditIcon());
setEnabledInModalContext(true);
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull;
public class EditRuleAliasesDefinitionAction extends AnAction {
public EditRuleAliasesDefinitionAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.alias.rule.add.edit.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.alias.rule.add.edit.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.alias.rule.add.edit.description"));
getTemplatePresentation().setIcon(AllIcons.General.GearPlain);
}
@@ -17,7 +17,7 @@ import javax.swing.table.DefaultTableModel;
public class MoveArrangementGroupingRuleDownAction extends AnAction implements DumbAware {
public MoveArrangementGroupingRuleDownAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.rule.move.down.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.rule.move.down.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.rule.move.down.description"));
getTemplatePresentation().setIcon(IconUtil.getMoveDownIcon());
}
@@ -17,7 +17,7 @@ import javax.swing.table.DefaultTableModel;
public class MoveArrangementGroupingRuleUpAction extends AnAction implements DumbAware {
public MoveArrangementGroupingRuleUpAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.rule.move.up.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.rule.move.up.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.rule.move.up.description"));
getTemplatePresentation().setIcon(IconUtil.getMoveUpIcon());
}
@@ -29,7 +29,7 @@ import java.util.List;
public class MoveArrangementMatchingRuleDownAction extends AbstractMoveArrangementRuleAction {
public MoveArrangementMatchingRuleDownAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.rule.move.down.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.rule.move.down.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.rule.move.down.description"));
getTemplatePresentation().setIcon(IconUtil.getMoveDownIcon());
setEnabledInModalContext(true);
@@ -29,7 +29,7 @@ import java.util.List;
public class MoveArrangementMatchingRuleUpAction extends AbstractMoveArrangementRuleAction {
public MoveArrangementMatchingRuleUpAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.rule.move.up.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.rule.move.up.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.rule.move.up.description"));
getTemplatePresentation().setIcon(IconUtil.getMoveUpIcon());
setEnabledInModalContext(true);
@@ -30,7 +30,7 @@ import org.jetbrains.annotations.NotNull;
public class RemoveArrangementRuleAction extends AbstractArrangementRuleAction implements DumbAware {
public RemoveArrangementRuleAction() {
getTemplatePresentation().setText(ApplicationBundle.message("arrangement.action.rule.remove.text"));
getTemplatePresentation().setText(() -> ApplicationBundle.message("arrangement.action.rule.remove.text"));
getTemplatePresentation().setDescription(ApplicationBundle.message("arrangement.action.rule.remove.description"));
getTemplatePresentation().setIcon(IconUtil.getRemoveIcon());
setEnabledInModalContext(true);
@@ -64,7 +64,7 @@ public class RunInspectionAction extends GotoActionBase implements DataProvider
public RunInspectionAction(String predefinedText) {
myPredefinedText = predefinedText;
getTemplatePresentation().setText(IdeBundle.message("goto.inspection.action.text"));
getTemplatePresentation().setText(() -> IdeBundle.message("goto.inspection.action.text"));
}
@Override
@@ -37,12 +37,12 @@ public class DebugAction extends ExecutorAction {
protected void update(@NotNull AnActionEvent e, boolean running) {
Presentation presentation = e.getPresentation();
if (running) {
presentation.setText(ExecutionBundle.message("run.dashboard.restart.debugger.action.name"));
presentation.setText(() -> ExecutionBundle.message("run.dashboard.restart.debugger.action.name"));
presentation.setDescription(ExecutionBundle.message("run.dashboard.restart.debugger.action.description"));
presentation.setIcon(AllIcons.Actions.RestartDebugger);
}
else {
presentation.setText(ExecutionBundle.message("run.dashboard.debug.action.name"));
presentation.setText(() -> ExecutionBundle.message("run.dashboard.debug.action.name"));
presentation.setDescription(ExecutionBundle.message("run.dashboard.debug.action.description"));
presentation.setIcon(AllIcons.Actions.StartDebugger);
}
@@ -28,7 +28,7 @@ public class RemoveRunConfigurationTypeAction extends DumbAwareAction {
Presentation presentation = e.getPresentation();
presentation.setEnabledAndVisible(true);
presentation.setText(ExecutionBundle.message("run.dashboard.remove.run.configuration.type.action.name",
presentation.setText(() -> ExecutionBundle.message("run.dashboard.remove.run.configuration.type.action.name",
"Configuration " + StringUtil.pluralize("Type", types.size())));
}
@@ -36,12 +36,12 @@ public class RunAction extends ExecutorAction {
protected void update(@NotNull AnActionEvent e, boolean running) {
Presentation presentation = e.getPresentation();
if (running) {
presentation.setText(ExecutionBundle.message("run.dashboard.rerun.action.name"));
presentation.setText(() -> ExecutionBundle.message("run.dashboard.rerun.action.name"));
presentation.setDescription(ExecutionBundle.message("run.dashboard.rerun.action.description"));
presentation.setIcon(AllIcons.Actions.Restart);
}
else {
presentation.setText(ExecutionBundle.message("run.dashboard.run.action.name"));
presentation.setText(() -> ExecutionBundle.message("run.dashboard.run.action.name"));
presentation.setDescription(ExecutionBundle.message("run.dashboard.run.action.description"));
presentation.setIcon(AllIcons.Actions.Execute);
}
@@ -521,7 +521,7 @@ public class FindPopupPanel extends JBPanel<FindPopupPanel> implements FindUI {
DefaultActionGroup tabOptionsGroup = new DefaultActionGroup() {{
Presentation presentation = getTemplatePresentation();
presentation.setText(FindBundle.message("find.popup.show.tab.options"));
presentation.setText(() -> FindBundle.message("find.popup.show.tab.options"));
presentation.setIcon(AllIcons.General.GearPlain);
setPopup(true);
setShortcutSet(CustomShortcutSet.fromString("alt ctrl DOWN"));
@@ -142,11 +142,11 @@ public class CreateDirectoryOrPackageAction extends AnAction implements DumbAwar
}
if (isPackage) {
presentation.setText(IdeBundle.message("action.package"));
presentation.setText(() -> IdeBundle.message("action.package"));
presentation.setIcon(PlatformIcons.PACKAGE_ICON);
}
else {
presentation.setText(IdeBundle.message("action.directory"));
presentation.setText(() -> IdeBundle.message("action.directory"));
presentation.setIcon(PlatformIcons.FOLDER_ICON);
}
}
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
public class ToggleBookmarkAction extends BookmarksAction implements DumbAware, Toggleable {
public ToggleBookmarkAction() {
getTemplatePresentation().setText(IdeBundle.message("action.bookmark.toggle"));
getTemplatePresentation().setText(() -> IdeBundle.message("action.bookmark.toggle"));
}
@Override
@@ -32,7 +32,7 @@ public class ToggleBookmarkAction extends BookmarksAction implements DumbAware,
event.getPresentation().setText(selected ? "Clear Bookmark" : "Set Bookmark");
}
else {
event.getPresentation().setText(IdeBundle.message("action.bookmark.toggle"));
event.getPresentation().setText(() -> IdeBundle.message("action.bookmark.toggle"));
Toggleable.setSelected(event.getPresentation(), selected);
}
}
@@ -24,7 +24,7 @@ public class ToggleBookmarkWithMnemonicAction extends ToggleBookmarkAction {
private boolean myPopupShown;
public ToggleBookmarkWithMnemonicAction() {
getTemplatePresentation().setText(IdeBundle.message("action.bookmark.toggle.mnemonic"));
getTemplatePresentation().setText(() -> IdeBundle.message("action.bookmark.toggle.mnemonic"));
}
@Override
@@ -42,7 +42,7 @@ public class ToggleBookmarkWithMnemonicAction extends ToggleBookmarkAction {
}
}
else {
e.getPresentation().setText(IdeBundle.message("action.bookmark.toggle.mnemonic"));
e.getPresentation().setText(() -> IdeBundle.message("action.bookmark.toggle.mnemonic"));
}
}
@@ -25,11 +25,11 @@ public class FavoritesCompactEmptyMiddlePackagesAction extends FavoritesToolbarB
Presentation presentation = e.getPresentation();
// see com.intellij.ide.projectView.impl.ProjectViewImpl.HideEmptyMiddlePackagesAction.update
if (getViewSettings().isFlattenPackages()) {
presentation.setText(IdeBundle.message("action.hide.empty.middle.packages"));
presentation.setText(() -> IdeBundle.message("action.hide.empty.middle.packages"));
presentation.setDescription(IdeBundle.message("action.show.hide.empty.middle.packages"));
}
else {
presentation.setText(IdeBundle.message("action.compact.empty.middle.packages"));
presentation.setText(() -> IdeBundle.message("action.compact.empty.middle.packages"));
presentation.setDescription(IdeBundle.message("action.show.compact.empty.middle.packages"));
}
@@ -684,7 +684,7 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
else {
String typeName = ElementDescriptionUtil.getElementDescription(selectedElement, UsageViewTypeLocation.INSTANCE);
if (StringUtil.isNotEmpty(typeName)) {
presentation.setText(IdeBundle.message("action.base.on.this.0", StringUtil.capitalize(typeName)));
presentation.setText(() -> IdeBundle.message("action.base.on.this.0", StringUtil.capitalize(typeName)));
}
presentation.setEnabled(isEnabled(browser, selectedElement));
}
@@ -36,7 +36,7 @@ public final class BrowseCallHierarchyAction extends BrowseHierarchyActionBase {
public final void update(@NotNull final AnActionEvent event){
final Presentation presentation = event.getPresentation();
if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
presentation.setText(IdeBundle.message("action.browse.call.hierarchy"));
presentation.setText(() -> IdeBundle.message("action.browse.call.hierarchy"));
}
super.update(event);
@@ -36,7 +36,7 @@ public final class BrowseMethodHierarchyAction extends BrowseHierarchyActionBase
public final void update(@NotNull final AnActionEvent event){
final Presentation presentation = event.getPresentation();
if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
presentation.setText(IdeBundle.message("action.browse.method.hierarchy"));
presentation.setText(() -> IdeBundle.message("action.browse.method.hierarchy"));
}
super.update(event);
}
@@ -36,7 +36,7 @@ public final class BrowseTypeHierarchyAction extends BrowseHierarchyActionBase {
public final void update(@NotNull final AnActionEvent event){
final Presentation presentation = event.getPresentation();
if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
presentation.setText(IdeBundle.message("action.browse.type.hierarchy"));
presentation.setText(() -> IdeBundle.message("action.browse.type.hierarchy"));
}
super.update(event);
}
@@ -683,7 +683,7 @@ public abstract class HierarchyBrowserBaseEx extends HierarchyBrowserBase implem
else {
String typeName = ElementDescriptionUtil.getElementDescription(selectedElement, UsageViewTypeLocation.INSTANCE);
if (StringUtil.isNotEmpty(typeName)) {
presentation.setText(IdeBundle.message("action.base.on.this.0", StringUtil.capitalize(typeName)));
presentation.setText(() -> IdeBundle.message("action.base.on.this.0", StringUtil.capitalize(typeName)));
}
presentation.setEnabled(isEnabled(browser, selectedElement));
}
@@ -18,7 +18,7 @@ public final class BrowseCallHierarchyAction extends BrowseHierarchyActionBase {
public final void update(@NotNull final AnActionEvent event){
final Presentation presentation = event.getPresentation();
if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
presentation.setText(IdeBundle.message("action.browse.call.hierarchy"));
presentation.setText(() -> IdeBundle.message("action.browse.call.hierarchy"));
}
super.update(event);
@@ -18,7 +18,7 @@ public final class BrowseMethodHierarchyAction extends BrowseHierarchyActionBase
public final void update(@NotNull final AnActionEvent event){
final Presentation presentation = event.getPresentation();
if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
presentation.setText(IdeBundle.message("action.browse.method.hierarchy"));
presentation.setText(() -> IdeBundle.message("action.browse.method.hierarchy"));
}
super.update(event);
}
@@ -18,7 +18,7 @@ public final class BrowseTypeHierarchyAction extends BrowseHierarchyActionBase {
public final void update(@NotNull final AnActionEvent event){
final Presentation presentation = event.getPresentation();
if (!ActionPlaces.isMainMenuOrActionSearch(event.getPlace())) {
presentation.setText(IdeBundle.message("action.browse.type.hierarchy"));
presentation.setText(() -> IdeBundle.message("action.browse.type.hierarchy"));
}
super.update(event);
}
@@ -50,7 +50,7 @@ public class ShowNavBarAction extends AnAction implements DumbAware, PopupAction
// see RIDER-15982
if (!ActionPlaces.isMainMenuOrActionSearch(e.getPlace())) {
e.getPresentation().setText(ActionsBundle.message("action.ShowNavBar.ShortText"));
e.getPresentation().setText(() -> ActionsBundle.message("action.ShowNavBar.ShortText"));
}
}
}
@@ -27,7 +27,7 @@ public class UnmarkRootAction extends MarkRootActionBase {
if (!Registry.is("ide.hide.excluded.files") && !selection.mySelectedExcludeRoots.isEmpty()
&& selection.mySelectedDirectories.isEmpty() && selection.mySelectedRoots.isEmpty()) {
e.getPresentation().setEnabledAndVisible(true);
e.getPresentation().setText(LangBundle.message("mark.as.unmark.excluded"));
e.getPresentation().setText(() -> LangBundle.message("mark.as.unmark.excluded"));
return;
}
@@ -125,7 +125,7 @@ abstract class TodoPanel extends SimpleToolWindowPanel implements OccurenceNavig
public static class GroupByActionGroup extends DefaultActionGroup {
{
getTemplatePresentation().setIcon(AllIcons.Actions.GroupBy);
getTemplatePresentation().setText(IdeBundle.message("group.group.by"));
getTemplatePresentation().setText(() -> IdeBundle.message("group.group.by"));
setPopup(true);
}
@@ -159,7 +159,7 @@ public class TodoView implements PersistentStateComponent<TodoView.State>, Dispo
if (toolWindow instanceof ToolWindowEx) {
DefaultActionGroup group = new DefaultActionGroup() {
{
getTemplatePresentation().setText(IdeBundle.message("group.view.options"));
getTemplatePresentation().setText(() -> IdeBundle.message("group.view.options"));
setPopup(true);
add(myAllTodos.createAutoScrollToSourceAction());
addSeparator();
@@ -61,7 +61,7 @@ public class GotoCustomRegionAction extends AnAction implements DumbAware, Popup
@Override
public void update(@NotNull AnActionEvent e) {
Presentation presentation = e.getPresentation();
presentation.setText(IdeBundle.message("goto.custom.region.menu.item"));
presentation.setText(() -> IdeBundle.message("goto.custom.region.menu.item"));
final Editor editor = e.getData(CommonDataKeys.EDITOR);
final Project project = e.getProject();
boolean isAvailable = editor != null && project != null;
@@ -37,7 +37,7 @@ public class ToggleExcludedStateAction extends ContentEntryEditingAction {
super(tree);
myEntryTreeEditor = entryEditor;
final Presentation templatePresentation = getTemplatePresentation();
templatePresentation.setText(ProjectBundle.message("module.toggle.excluded.action"));
templatePresentation.setText(() -> ProjectBundle.message("module.toggle.excluded.action"));
templatePresentation.setDescription(ProjectBundle.message("module.toggle.excluded.action.description"));
templatePresentation.setIcon(AllIcons.Modules.ExcludeRoot);
}
@@ -72,6 +72,6 @@ public class ToggleExcludedStateAction extends ContentEntryEditingAction {
public void update(@NotNull final AnActionEvent e) {
super.update(e);
final Presentation presentation = e.getPresentation();
presentation.setText(ProjectBundle.message("module.toggle.excluded.action"));
presentation.setText(() -> ProjectBundle.message("module.toggle.excluded.action"));
}
}
@@ -35,7 +35,7 @@ public class ChangeTemplateDataLanguageAction extends AnAction {
if (provider instanceof ConfigurableTemplateLanguageFileViewProvider) {
final TemplateLanguageFileViewProvider viewProvider = (TemplateLanguageFileViewProvider)provider;
e.getPresentation().setText(LangBundle.message("quickfix.change.template.data.language.text", viewProvider.getTemplateDataLanguage().getDisplayName()));
e.getPresentation().setText(() -> LangBundle.message("quickfix.change.template.data.language.text", viewProvider.getTemplateDataLanguage().getDisplayName()));
e.getPresentation().setEnabledAndVisible(true);
}
@@ -43,10 +43,10 @@ public class GotoTestOrCodeAction extends BaseCodeInsightAction {
presentation.setEnabledAndVisible(true);
if (TestFinderHelper.isTest(element)) {
presentation.setText(ActionsBundle.message("action.GotoTestSubject.text"));
presentation.setText(() -> ActionsBundle.message("action.GotoTestSubject.text"));
presentation.setDescription(ActionsBundle.message("action.GotoTestSubject.description"));
} else {
presentation.setText(ActionsBundle.message("action.GotoTest.text"));
presentation.setText(() -> ActionsBundle.message("action.GotoTest.text"));
presentation.setDescription(ActionsBundle.message("action.GotoTest.description"));
}
}
@@ -365,7 +365,7 @@ public class LightToolWindow extends JPanel {
private class HideAction extends AnAction {
HideAction() {
Presentation presentation = getTemplatePresentation();
presentation.setText(UIBundle.message("tool.window.hide.action.name"));
presentation.setText(() -> UIBundle.message("tool.window.hide.action.name"));
presentation.setIcon(AllIcons.General.HideToolWindow);
}
@@ -46,10 +46,10 @@ public class CloseAllEditorsAction extends AnAction implements DumbAware {
Presentation presentation = event.getPresentation();
final EditorWindow editorWindow = event.getData(EditorWindow.DATA_KEY);
if (editorWindow != null && editorWindow.inSplitter()) {
presentation.setText(IdeBundle.message("action.close.all.editors.in.tab.group"));
presentation.setText(() -> IdeBundle.message("action.close.all.editors.in.tab.group"));
}
else {
presentation.setText(IdeBundle.message("action.close.all.editors"));
presentation.setText(() -> IdeBundle.message("action.close.all.editors"));
}
Project project = event.getData(CommonDataKeys.PROJECT);
if (project == null) {
@@ -45,7 +45,7 @@ public class CloseAllEditorsToTheLeftAction extends CloseEditorsActionBase {
super.update(event);
int tabPlacement = UISettings.getInstance().getEditorTabPlacement();
if (tabPlacement == SwingConstants.LEFT || tabPlacement == SwingConstants.RIGHT) {
event.getPresentation().setText(IdeBundle.message(getAlternativeTextKey()));
event.getPresentation().setText(() -> IdeBundle.message(getAlternativeTextKey()));
}
}
@@ -43,7 +43,7 @@ public final 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(() -> IdeBundle.message("action.close.projects.in.current.window"));
}
else {
presentation.setText(IdeUICustomization.getInstance().getCloseProjectActionText());
@@ -48,7 +48,7 @@ public class CopyPathsAction extends AnAction implements DumbAware {
Presentation presentation = event.getPresentation();
presentation.setEnabled(num > 0);
presentation.setVisible(num > 0 || !ActionPlaces.isPopupPlace(event.getPlace()));
presentation.setText(IdeBundle.message(num == 1 ? "action.copy.path" : "action.copy.paths"));
presentation.setText(() -> IdeBundle.message(num == 1 ? "action.copy.path" : "action.copy.paths"));
}
public static boolean isCopyReferencePopupAvailable() {
@@ -49,10 +49,10 @@ public class DeleteAction extends AnAction implements DumbAware {
Presentation presentation = e.getPresentation();
if (ActionPlaces.isPopupPlace(e.getPlace())) {
presentation.setText(IdeBundle.message("action.delete.ellipsis"));
presentation.setText(() -> IdeBundle.message("action.delete.ellipsis"));
}
else {
presentation.setText(IdeBundle.message("action.delete"));
presentation.setText(() -> IdeBundle.message("action.delete"));
}
if (e.isFromActionToolbar() && e.getPresentation().getIcon() == null) {
e.getPresentation().setIcon(IconUtil.getRemoveIcon());
@@ -21,7 +21,7 @@ import java.util.List;
public class RecentProjectsGroup extends ActionGroup implements DumbAware {
public RecentProjectsGroup() {
Presentation presentation = getTemplatePresentation();
presentation.setText(ActionsBundle.message(SystemInfo.isMac ? "group.reopen.mac.text" : "group.reopen.win.text"));
presentation.setText(() -> ActionsBundle.message(SystemInfo.isMac ? "group.reopen.mac.text" : "group.reopen.win.text"));
}
@Override
@@ -45,7 +45,7 @@ public class ShowFilePathAction extends DumbAwareAction {
if (visible) {
VirtualFile file = getFile(e);
e.getPresentation().setEnabled(file != null);
e.getPresentation().setText(ActionsBundle.message(file != null && file.isDirectory() ? "action.ShowFilePath.directory" : "action.ShowFilePath.file"));
e.getPresentation().setText(() -> ActionsBundle.message(file != null && file.isDirectory() ? "action.ShowFilePath.directory" : "action.ShowFilePath.file"));
}
}
@@ -147,10 +147,10 @@ abstract class TabNavigationActionBase extends AnAction implements DumbAware {
protected GoToTabAction(@NotNull NavigationType navigationType) {
super(navigationType);
if (navigationType == NavigationType.LAST) {
getTemplatePresentation().setText(ActionsBundle.message("action.GoToLastTab.text"));
getTemplatePresentation().setText(() -> ActionsBundle.message("action.GoToLastTab.text"));
getTemplatePresentation().setDescription(ActionsBundle.message("action.GoToLastTab.description"));
} else {
getTemplatePresentation().setText(ActionsBundle.message("action.GoToTab.text", navigationType.ordinal() + 1));
getTemplatePresentation().setText(() -> ActionsBundle.message("action.GoToTab.text", navigationType.ordinal() + 1));
getTemplatePresentation().setDescription(ActionsBundle.message("action.GoToTab.description", navigationType.ordinal() + 1));
}
}
@@ -16,7 +16,7 @@ import org.jetbrains.annotations.NotNull;
public class TemplateProjectPropertiesAction extends AnAction implements DumbAware {
public TemplateProjectPropertiesAction() {
String projectConceptName = StringUtil.capitalize(IdeUICustomization.getInstance().getProjectConceptName());
getTemplatePresentation().setText(ActionsBundle.message("action.TemplateProjectProperties.text.template", CommonBundle.settingsTitle(), projectConceptName));
getTemplatePresentation().setText(() -> ActionsBundle.message("action.TemplateProjectProperties.text.template", CommonBundle.settingsTitle(), projectConceptName));
getTemplatePresentation().setDescription(ActionsBundle.message("action.TemplateProjectProperties.description.template", projectConceptName));
}
@@ -45,17 +45,21 @@ public class ToggleReadOnlyAttributeAction extends AnAction implements DumbAware
if (file.isWritable()) ++rw; else ++ro;
if (file.isDirectory()) ++d; else ++f;
}
int finalRo = ro;
int finalRw = rw;
int finalF = f;
int finalD = d;
if (ro > 0 && rw > 0) {
e.getPresentation().setText(ActionsBundle.message("action.ToggleReadOnlyAttribute.text"));
e.getPresentation().setText(() -> ActionsBundle.message("action.ToggleReadOnlyAttribute.text"));
}
else if (f > 0 && d == 0) {
e.getPresentation().setText(ActionsBundle.message("action.ToggleReadOnlyAttribute.files", ro, rw, f, d));
e.getPresentation().setText(() -> ActionsBundle.message("action.ToggleReadOnlyAttribute.files", finalRo, finalRw, finalF, finalD));
}
else if (f == 0 && d > 0) {
e.getPresentation().setText(ActionsBundle.message("action.ToggleReadOnlyAttribute.dirs", ro, rw, f, d));
e.getPresentation().setText(() -> ActionsBundle.message("action.ToggleReadOnlyAttribute.dirs", finalRo, finalRw, finalF, finalD));
}
else {
e.getPresentation().setText(ActionsBundle.message("action.ToggleReadOnlyAttribute.mixed", ro, rw, f, d));
e.getPresentation().setText(() -> ActionsBundle.message("action.ToggleReadOnlyAttribute.mixed", finalRo, finalRw, finalF, finalD));
}
}
}
@@ -22,7 +22,7 @@ public class WhatsNewAction extends AnAction implements DumbAware {
e.getPresentation().setVisible(visible);
if (visible) {
e.getPresentation()
.setText(IdeBundle.message("whatsnew.action.custom.text", ApplicationNamesInfo.getInstance().getFullProductName()));
.setText(() -> IdeBundle.message("whatsnew.action.custom.text", ApplicationNamesInfo.getInstance().getFullProductName()));
e.getPresentation().setDescription(
IdeBundle.message("whatsnew.action.custom.description", ApplicationNamesInfo.getInstance().getFullProductName()));
}
@@ -865,10 +865,10 @@ public class CustomizableActionsPanel {
Pair<TreeSet<String>, List<ActionUrl>> selection = findActionsUnderSelection();
e.getPresentation().setEnabled(!selection.second.isEmpty());
if (selection.first.size() != 1) {
e.getPresentation().setText(IdeBundle.message("button.restore.selected.groups"));
e.getPresentation().setText(() -> IdeBundle.message("button.restore.selected.groups"));
}
else {
e.getPresentation().setText(IdeBundle.message("button.restore.selection", selection.first.iterator().next()));
e.getPresentation().setText(() -> IdeBundle.message("button.restore.selection", selection.first.iterator().next()));
}
}
}
@@ -39,7 +39,7 @@ public class ToggleUseSoftWrapsMenuAction extends AbstractToggleUseSoftWrapsActi
e.getPresentation().setIcon(null);
}
if (ActionPlaces.UNKNOWN.equals(e.getPlace())) {
e.getPresentation().setText(ActionsBundle.message("action.EditorGutterToggleLocalSoftWraps.gutterText"));
e.getPresentation().setText(() -> ActionsBundle.message("action.EditorGutterToggleLocalSoftWraps.gutterText"));
}
e.getPresentation().setEnabled(getEditor(e) != null);
}
@@ -17,7 +17,7 @@ public class TogglePathShowingAction extends AnAction implements DumbAware {
@Override
public void update(@NotNull final AnActionEvent e) {
e.getPresentation().setText(IdeBundle.message("file.chooser.hide.path.tooltip.text"));
e.getPresentation().setText(() -> IdeBundle.message("file.chooser.hide.path.tooltip.text"));
DialogWrapper dialog = DialogWrapper.findInstance(e.getData(PlatformDataKeys.CONTEXT_COMPONENT));
e.getPresentation().setEnabled(dialog instanceof FileChooserDialogImpl);
}
@@ -306,7 +306,7 @@ public abstract class ToolWindowHeader extends JPanel implements UISettingsListe
HideAction() {
ActionUtil.copyFrom(this, InternalDecorator.HIDE_ACTIVE_WINDOW_ACTION_ID);
getTemplatePresentation().setIcon(AllIcons.General.HideToolWindow);
getTemplatePresentation().setText(UIBundle.message("tool.window.hide.action.name"));
getTemplatePresentation().setText(() -> UIBundle.message("tool.window.hide.action.name"));
}
@Override
@@ -42,7 +42,7 @@ public class AddCloudConnectionActionGroup extends ActionGroup {
@Override
public void update(@NotNull AnActionEvent e) {
if (e.getPlace().equals(ActionPlaces.ACTION_SEARCH)) {
e.getPresentation().setText(CloudBundle.message("new.cloud.connection.configurable.title", myServerType.getPresentableName()));
e.getPresentation().setText(() -> CloudBundle.message("new.cloud.connection.configurable.title", myServerType.getPresentableName()));
}
else {
e.getPresentation().setText(myServerType.getPresentableName());
@@ -1237,7 +1237,7 @@ public class StructuralSearchDialog extends DialogWrapper implements ProjectMana
}
private void init() {
getTemplatePresentation().setText(SSRBundle.message(myReplace ? "switch.to.search.action" : "switch.to.replace.action"));
getTemplatePresentation().setText(() -> SSRBundle.message(myReplace ? "switch.to.search.action" : "switch.to.replace.action"));
final ActionManager actionManager = ActionManager.getInstance();
final ShortcutSet searchShortcutSet = actionManager.getAction("StructuralSearchPlugin.StructuralSearchAction").getShortcutSet();
final ShortcutSet replaceShortcutSet = actionManager.getAction("StructuralSearchPlugin.StructuralReplaceAction").getShortcutSet();
@@ -839,7 +839,7 @@ public class UsageViewImpl implements UsageViewEx {
DefaultActionGroup group = new DefaultActionGroup();
group.setPopup(true);
group.getTemplatePresentation().setIcon(AllIcons.Actions.GroupBy);
group.getTemplatePresentation().setText(UsageViewBundle.message("action.group.by.title"));
group.getTemplatePresentation().setText(() -> UsageViewBundle.message("action.group.by.title"));
group.getTemplatePresentation().setDescription(UsageViewBundle.message("action.group.by.title"));
final AnAction[] groupingActions = createGroupingActions();
if (groupingActions.length > 0) {
@@ -23,7 +23,7 @@ public class StartUseVcsAction extends DumbAwareAction {
Presentation presentation = e.getPresentation();
presentation.setEnabledAndVisible(enabled);
if (enabled) {
presentation.setText(VcsBundle.message("action.enable.version.control.integration.text"));
presentation.setText(() -> VcsBundle.message("action.enable.version.control.integration.text"));
}
}
@@ -32,7 +32,7 @@ public class RestoreShelvedChange extends DumbAwareAction {
return;
}
Collection<ShelvedChangeList> deletedLists = notNullize(e.getData(ShelvedChangesViewManager.SHELVED_DELETED_CHANGELIST_KEY));
presentation.setText(VcsBundle.message("vcs.shelf.action.restore.text"));
presentation.setText(() -> VcsBundle.message("vcs.shelf.action.restore.text"));
presentation
.setDescription(VcsBundle.message("vcs.shelf.action.restore.description", StringUtil.pluralize("changelist", deletedLists.size())));
presentation.setEnabled(!isEmpty(deletedLists));
@@ -39,7 +39,7 @@ public class CompareRevisionsAction implements AnActionExtensionProvider {
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setText(VcsBundle.message("action.name.compare"));
e.getPresentation().setText(() -> VcsBundle.message("action.name.compare"));
e.getPresentation().setDescription(VcsBundle.message("action.description.compare"));
VcsFileRevision[] revisions = e.getData(VcsDataKeys.VCS_FILE_REVISIONS);
@@ -63,7 +63,7 @@ public class CreatePatchFromDirectoryAction implements AnActionExtensionProvider
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setVisible(true);
e.getPresentation().setText(VcsBundle.message("action.name.create.patch.for.selected.revisions"));
e.getPresentation().setText(() -> VcsBundle.message("action.name.create.patch.for.selected.revisions"));
e.getPresentation().setDescription(VcsBundle.message("action.description.create.patch.for.selected.revisions"));
VcsFileRevision[] revisions = e.getData(VcsDataKeys.VCS_FILE_REVISIONS);
@@ -58,10 +58,10 @@ public class RunTargetAction extends AnAction {
Pair<AntBuildFileBase, AntDomTarget> antTarget = findAntTarget(e);
if (antTarget == null) {
presentation.setEnabled(false);
presentation.setText(AntActionsBundle.message("action.RunTargetAction.text.template", ""));
presentation.setText(() -> AntActionsBundle.message("action.RunTargetAction.text.template", ""));
} else {
presentation.setEnabled(true);
presentation.setText(AntActionsBundle.message("action.RunTargetAction.text.template", "'" + antTarget.second.getName().getValue() + "'"));
presentation.setText(() -> AntActionsBundle.message("action.RunTargetAction.text.template", "'" + antTarget.second.getName().getValue() + "'"));
}
}
@@ -636,20 +636,20 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider,
final Presentation presentation = event.getPresentation();
final String place = event.getPlace();
if (ActionPlaces.ANT_EXPLORER_TOOLBAR.equals(place)) {
presentation.setText(AntBundle.message("run.ant.file.or.target.action.name"));
presentation.setText(() -> AntBundle.message("run.ant.file.or.target.action.name"));
}
else {
final TreePath[] paths = myTree.getSelectionPaths();
if (paths != null && paths.length == 1 &&
((DefaultMutableTreeNode)paths[0].getLastPathComponent()).getUserObject() instanceof AntBuildFileNodeDescriptor) {
presentation.setText(AntBundle.message("run.ant.build.action.name"));
presentation.setText(() -> AntBundle.message("run.ant.build.action.name"));
}
else {
if (paths == null || paths.length == 1) {
presentation.setText(AntBundle.message("run.ant.target.action.name"));
presentation.setText(() -> AntBundle.message("run.ant.target.action.name"));
}
else {
presentation.setText(AntBundle.message("run.ant.targets.action.name"));
presentation.setText(() -> AntBundle.message("run.ant.targets.action.name"));
}
}
}
@@ -911,7 +911,7 @@ public class AntExplorer extends SimpleToolWindowPanel implements DataProvider,
presentation.setEnabled(enabled);
}
else {
presentation.setText(AntBundle.message("remove.selected.meta.targets.action.name"));
presentation.setText(() -> AntBundle.message("remove.selected.meta.targets.action.name"));
final AntBuildTarget[] targets = getTargetObjectsFromPaths(paths);
boolean enabled = targets.length > 0;
for (final AntBuildTarget buildTarget : targets) {
@@ -59,7 +59,7 @@ public class PrepareAllToDeployAction extends PrepareToDeployAction {
}
e.getPresentation().setEnabledAndVisible(enabled);
if (enabled) {
e.getPresentation().setText(DevKitBundle.message("prepare.for.deployment.all"));
e.getPresentation().setText(() -> DevKitBundle.message("prepare.for.deployment.all"));
}
}
}
@@ -335,7 +335,7 @@ public class PrepareToDeployAction extends AnAction {
boolean enabled = module != null && PluginModuleType.isOfType(module);
e.getPresentation().setEnabledAndVisible(enabled);
if (enabled) {
e.getPresentation().setText(DevKitBundle.message("prepare.for.deployment", module.getName()));
e.getPresentation().setText(() -> DevKitBundle.message("prepare.for.deployment", module.getName()));
}
}
}
@@ -38,7 +38,7 @@ public class AddGradleDslDependencyAction extends CodeInsightAction {
public AddGradleDslDependencyAction() {
getTemplatePresentation().setDescription(GradleBundle.message("gradle.codeInsight.action.add_maven_dependency.description"));
getTemplatePresentation().setText(GradleBundle.message("gradle.codeInsight.action.add_maven_dependency.text"));
getTemplatePresentation().setText(() -> GradleBundle.message("gradle.codeInsight.action.add_maven_dependency.text"));
getTemplatePresentation().setIcon(AllIcons.Nodes.PpLib);
}
@@ -32,7 +32,7 @@ public class AddGradleDslPluginAction extends CodeInsightAction {
public AddGradleDslPluginAction() {
getTemplatePresentation().setDescription(GradleBundle.message("gradle.codeInsight.action.apply_plugin.description"));
getTemplatePresentation().setText(GradleBundle.message("gradle.codeInsight.action.apply_plugin.text"));
getTemplatePresentation().setText(() -> GradleBundle.message("gradle.codeInsight.action.apply_plugin.text"));
getTemplatePresentation().setIcon(GradleIcons.Gradle);
myPlugins = new ArrayList<>();
@@ -26,7 +26,7 @@ import java.util.List;
*/
public class GradleRefreshProjectDependenciesAction extends RefreshExternalProjectAction {
public GradleRefreshProjectDependenciesAction() {
getTemplatePresentation().setText(GradleBundle.message("gradle.action.refresh.dependencies.text"));
getTemplatePresentation().setText(() -> GradleBundle.message("gradle.action.refresh.dependencies.text"));
getTemplatePresentation().setDescription(GradleBundle.message("gradle.action.refresh.dependencies.description"));
}
@@ -39,7 +39,7 @@ public class MavenRebuildAction extends FakeRerunAction {
public void update(@NotNull AnActionEvent event) {
Presentation presentation = event.getPresentation();
presentation.setText(ExecutionBundle.message("rerun.configuration.action.name",
presentation.setText(() -> ExecutionBundle.message("rerun.configuration.action.name",
StringUtil.escapeMnemonics(myEnvironment.getRunProfile().getName())));
presentation.setIcon(
ExecutionManagerImpl.isProcessRunning(myEnvironment.getContentToReuse()) ?
@@ -41,13 +41,13 @@ public class ToggleIgnoredProjectsAction extends MavenAction {
List<MavenProject> projects = MavenActionUtil.getMavenProjects(context);
if (isIgnoredInSettings(projectsManager, projects)) {
e.getPresentation().setText(MavenProjectBundle.message("maven.ignore.edit"));
e.getPresentation().setText(() -> MavenProjectBundle.message("maven.ignore.edit"));
}
else if (isIgnored(projectsManager, projects)) {
e.getPresentation().setText(MavenProjectBundle.message("maven.unignore"));
e.getPresentation().setText(() -> MavenProjectBundle.message("maven.unignore"));
}
else {
e.getPresentation().setText(MavenProjectBundle.message("maven.ignore"));
e.getPresentation().setText(() -> MavenProjectBundle.message("maven.ignore"));
}
}
@@ -39,7 +39,7 @@ public abstract class AbstractIntegrateChangesAction<T extends SelectedCommitted
return;
}
presentation.setText(SvnBundle.message("action.Subversion.integrate.changes.actionname"));
presentation.setText(() -> SvnBundle.message("action.Subversion.integrate.changes.actionname"));
presentation.setDescription(SvnBundle.message("action.Subversion.integrate.changes.description"));
final T checker = createChecker();
@@ -85,7 +85,7 @@ public class IgnoreActionGroup extends DefaultActionGroup implements DumbAware {
add(myRemoveExtensionAction);
}
e.getPresentation().setText(SvnBundle.message("group.RevertIgnoreChoicesGroup.text"));
e.getPresentation().setText(() -> SvnBundle.message("group.RevertIgnoreChoicesGroup.text"));
} else if (myHelperAction.allCanBeIgnored()) {
final String ignoreExactlyName = (fileGroupInfo.oneFileSelected()) ?
fileGroupInfo.getFileName() : SvnBundle.message("action.Subversion.Ignore.ExactMatch.text");
@@ -95,7 +95,7 @@ public class IgnoreActionGroup extends DefaultActionGroup implements DumbAware {
myAddExtensionAction.setActionText(fileGroupInfo.getExtensionMask());
add(myAddExtensionAction);
}
e.getPresentation().setText(SvnBundle.message("group.IgnoreChoicesGroup.text"));
e.getPresentation().setText(() -> SvnBundle.message("group.IgnoreChoicesGroup.text"));
}
}
}
@@ -32,7 +32,7 @@ public class ShareWholeProject extends AnAction implements DumbAware {
presentation.setVisible(checker.isVisible());
if (checker.isEnabled()) {
presentation.setText(SvnBundle.message("action.share.whole.project.text"));
presentation.setText(() -> SvnBundle.message("action.share.whole.project.text"));
}
}
@@ -334,7 +334,7 @@ public class RepositoryBrowserDialog extends DialogWrapper {
protected class HistoryAction extends DumbAwareAction {
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setText(SvnBundle.message("repository.browser.history.action"));
e.getPresentation().setText(() -> SvnBundle.message("repository.browser.history.action"));
e.getPresentation().setDescription(SvnBundle.message("repository.browser.history.action"));
final RepositoryTreeNode node = getRepositoryBrowser().getSelectedNode();
e.getPresentation().setEnabled(node != null && node.getURL() != null && !myProject.isDefault());
@@ -366,7 +366,7 @@ public class RepositoryBrowserDialog extends DialogWrapper {
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setText(SvnBundle.message("action.name.refresh"));
e.getPresentation().setText(() -> SvnBundle.message("action.name.refresh"));
e.getPresentation().setDescription(SvnBundle.message("repository.browser.refresh.action"));
e.getPresentation().setIcon(AllIcons.Actions.Refresh);
e.getPresentation().setEnabled(myBrowserComponent.getSelectedNode() != null);
@@ -394,7 +394,7 @@ public class RepositoryBrowserDialog extends DialogWrapper {
public void update(@NotNull AnActionEvent e) {
if (e.getPlace().equals(PLACE_TOOLBAR)) {
e.getPresentation().setDescription(SvnBundle.message("repository.browser.add.location.action.description"));
e.getPresentation().setText(SvnBundle.message("repository.browser.add.location.action.text"));
e.getPresentation().setText(() -> SvnBundle.message("repository.browser.add.location.action.text"));
e.getPresentation().setIcon(IconUtil.getAddIcon());
}
}
@@ -434,7 +434,7 @@ public class RepositoryBrowserDialog extends DialogWrapper {
RepositoryTreeNode node = myBrowserComponent.getSelectedNode();
if (e.getPlace().equals(PLACE_TOOLBAR)) {
e.getPresentation().setDescription(SvnBundle.message("repository.browser.edit.location.menu.item"));
e.getPresentation().setText(SvnBundle.message("repository.browser.edit.location.menu.item"));
e.getPresentation().setText(() -> SvnBundle.message("repository.browser.edit.location.menu.item"));
e.getPresentation().setIcon(AllIcons.Actions.EditSource);
}
e.getPresentation().setEnabled(node != null && node.getParent() instanceof RepositoryTreeRootNode);
@@ -868,7 +868,7 @@ public class RepositoryBrowserDialog extends DialogWrapper {
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setVisible(showImportAction());
e.getPresentation().setText(SvnBundle.message("repository.browser.import.action"));
e.getPresentation().setText(() -> SvnBundle.message("repository.browser.import.action"));
setEnabled(e, getRepositoryBrowser().getSelectedNode(),
ProjectLevelVcsManager.getInstance(myProject).isBackgroundVcsOperationRunning());
}
@@ -960,7 +960,7 @@ public class RepositoryBrowserDialog extends DialogWrapper {
@Override
public void update(@NotNull final AnActionEvent e) {
e.getPresentation().setDescription(SvnBundle.message("repository.browser.details.action"));
e.getPresentation().setText(SvnBundle.message("repository.browser.details.action"));
e.getPresentation().setText(() -> SvnBundle.message("repository.browser.details.action"));
e.getPresentation().setIcon(AllIcons.Actions.Annotate);
super.update(e);
}
@@ -34,7 +34,7 @@ public class PythonDebugLanguageConsoleView extends DuplexConsoleView<ConsoleVie
enableConsole(!PyConsoleOptions.getInstance(project).isShowDebugConsoleByDefault());
getSwitchConsoleActionPresentation().setIcon(PythonIcons.Python.PythonConsole);
getSwitchConsoleActionPresentation().setText(PyBundle.message("run.configuration.show.command.line.action.name"));
getSwitchConsoleActionPresentation().setText(() -> PyBundle.message("run.configuration.show.command.line.action.name"));
List<AnAction> actions = ContainerUtil.newArrayList(PyConsoleUtil.createTabCompletionAction(getPydevConsoleView()));
actions.add(PyConsoleUtil.createInterruptAction(getPydevConsoleView()));
@@ -104,7 +104,7 @@ final class PanelWithActions extends JPanel {
@Override
public void update(@NotNull final AnActionEvent e) {
super.update(e);
e.getPresentation().setText(PyBundle.message("windowWithActions.closeWindow"));
e.getPresentation().setText(() -> PyBundle.message("windowWithActions.closeWindow"));
}
@Override
@@ -84,7 +84,7 @@ public class DeleteDomElement extends BaseDomTreeAction {
e.getPresentation().setText(getPresentationText(selectedNode, ApplicationBundle.message("action.remove")));
}
else {
e.getPresentation().setText(ApplicationBundle.message("action.remove"));
e.getPresentation().setText(() -> ApplicationBundle.message("action.remove"));
}
e.getPresentation().setIcon(AllIcons.General.Remove);
@@ -44,6 +44,6 @@ public class GotoDomElementDeclarationAction extends BaseDomTreeAction {
@Override
public void update(AnActionEvent e, DomModelTreeView treeView) {
e.getPresentation().setVisible(treeView.getTree().getSelectedNode() instanceof BaseDomElementNode);
e.getPresentation().setText(ActionsBundle.message("action.EditSource.text"));
e.getPresentation().setText(() -> ActionsBundle.message("action.EditSource.text"));
}
}