From 8cea92b350b14a07745cfc61f5ec0260f5871155 Mon Sep 17 00:00:00 2001 From: Roman Chernyatchik Date: Thu, 12 Nov 2009 21:22:15 +0300 Subject: [PATCH] =?utf8?q?fix=20improved=20:=20[IDEADEV-41302]=20Change=20?= =?utf8?q?File=E2=80=8B-=E2=80=8B>=E2=80=8BReopen=20to=20'=E2=80=8BOpen=20?= =?utf8?q?Recent'?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/com/intellij/ide/actions/RecentProjectsGroup.java | 14 ++++++++++++++ .../openapi/actionSystem/impl/ActionManagerImpl.java | 15 ++++++++++++--- .../src/messages/ActionsBundle.properties | 3 ++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/actions/RecentProjectsGroup.java b/platform/platform-impl/src/com/intellij/ide/actions/RecentProjectsGroup.java index a0d76ea210..1ed87056ec 100644 --- a/platform/platform-impl/src/com/intellij/ide/actions/RecentProjectsGroup.java +++ b/platform/platform-impl/src/com/intellij/ide/actions/RecentProjectsGroup.java @@ -16,14 +16,28 @@ package com.intellij.ide.actions; import com.intellij.ide.RecentProjectsManagerBase; +import com.intellij.idea.ActionsBundle; import com.intellij.openapi.actionSystem.ActionGroup; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.Presentation; +import com.intellij.openapi.util.SystemInfo; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class RecentProjectsGroup extends ActionGroup { + public RecentProjectsGroup() { + super(); + + final Presentation templatePresentation = getTemplatePresentation(); + // Let's make tile more macish + if (SystemInfo.isMac) { + templatePresentation.setText(ActionsBundle.message("group.reopen.mac.text")); + } else { + templatePresentation.setText(ActionsBundle.message("group.reopen.win.text")); + } + } + @NotNull public AnAction[] getChildren(@Nullable AnActionEvent e) { return RecentProjectsManagerBase.getInstance().getRecentProjectsActions(true); diff --git a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java index 3d50db775f..013fb4ef82 100644 --- a/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java @@ -477,13 +477,22 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat if (id != null) { registerAction(id, group); } - // text Presentation presentation = group.getTemplatePresentation(); + + // text String text = loadTextForElement(element, bundle, id, GROUP_ELEMENT_NAME); - presentation.setText(text); + // don't override value which was set in API with empty value from xml descriptor + if (!StringUtil.isEmpty(text) || presentation.getText() == null) { + presentation.setText(text); + } + // description String description = loadDescriptionForElement(element, bundle, id, GROUP_ELEMENT_NAME); - presentation.setDescription(description); + // don't override value which was set in API with empty value from xml descriptor + if (!StringUtil.isEmpty(description) || presentation.getDescription() == null) { + presentation.setDescription(description); + } + // icon setIcon(element.getAttributeValue(ICON_ATTR_NAME), className, loader, presentation, pluginId); // popup diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties index f5eb71f170..88eea57285 100644 --- a/platform/platform-resources-en/src/messages/ActionsBundle.properties +++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties @@ -200,7 +200,8 @@ action.OpenProject.text=_Open Project... action.OpenProject.description=Open an existing project action.OpenFile.text=Open Fi_le... action.OpenFile.description=Open file in editor -group.$LRU.text=Open _Recent +group.reopen.win.text=_Reopen +group.reopen.mac.text=Open _Recent group.$LRU.description=List of recently opened projects action.CloseProject.text=Close Pro_ject action.CloseProject.description=Close current project -- 2.11.4.GIT