IDEA-200366 No way to configure Run Configuration Templates for a new projects in... rubymine/191.176
authorVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Thu, 11 Oct 2018 13:03:17 +0000 (15:03 +0200)
committerVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Thu, 11 Oct 2018 13:24:32 +0000 (15:24 +0200)
java/idea-ui/src/com/intellij/ide/actions/TemplateProjectSettingsGroup.java [deleted file]
java/idea-ui/src/com/intellij/ide/actions/TemplateProjectStructureAction.java
platform/platform-resources/src/idea/PlatformActions.xml
resources/src/idea/RichPlatformActions.xml

diff --git a/java/idea-ui/src/com/intellij/ide/actions/TemplateProjectSettingsGroup.java b/java/idea-ui/src/com/intellij/ide/actions/TemplateProjectSettingsGroup.java
deleted file mode 100644 (file)
index 9e92452..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2000-2016 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * @author max
- */
-package com.intellij.ide.actions;
-
-import com.intellij.execution.actions.EditRunConfigurationsAction;
-import com.intellij.icons.AllIcons;
-import com.intellij.openapi.actionSystem.AnAction;
-import com.intellij.openapi.actionSystem.DefaultActionGroup;
-import com.intellij.openapi.actionSystem.Presentation;
-
-import javax.swing.*;
-
-public class TemplateProjectSettingsGroup extends DefaultActionGroup {
-  public TemplateProjectSettingsGroup() {
-    setPopup(true);
-
-    Presentation presentation = getTemplatePresentation();
-    presentation.setText("Project Defaults");
-    presentation.setIcon(AllIcons.General.Settings);
-
-    add(withTextAndIcon(new TemplateProjectPropertiesAction(), "Settings", AllIcons.General.Settings));
-    add(withTextAndIcon(new TemplateProjectStructureAction(), "Project Structure", AllIcons.General.ProjectStructure));
-    add(withTextAndIcon(new EditRunConfigurationsAction(), "Run Configurations", AllIcons.ToolbarDecorator.Import));
-  }
-
-  private static AnAction withTextAndIcon(AnAction action, String text, Icon icon) {
-    Presentation presentation = action.getTemplatePresentation();
-    presentation.setText(text);
-    presentation.setIcon(icon);
-    return action;
-  }
-}
\ No newline at end of file
index 83e2ea362382d1d348af50ff0830c7b38098d606..cf35f329c21a86b2a6f662ba4a45e036b091abee 100644 (file)
@@ -1,21 +1,8 @@
-/*
- * Copyright 2000-2014 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+// 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.ide.actions;
 
 import com.intellij.idea.ActionsBundle;
+import com.intellij.openapi.actionSystem.ActionPlaces;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.project.ProjectManager;
 import com.intellij.openapi.util.text.StringUtil;
@@ -33,4 +20,11 @@ public class TemplateProjectStructureAction extends ShowStructureSettingsAction
   public void actionPerformed(@NotNull AnActionEvent e) {
     showDialog(ProjectManager.getInstance().getDefaultProject());
   }
+
+  @Override
+  public void update(@NotNull AnActionEvent e) {
+    if (e.getPlace().equals(ActionPlaces.WELCOME_SCREEN)) {
+      e.getPresentation().setText(StringUtil.trimEnd(getTemplatePresentation().getText(), "..."));
+    }
+  }
 }
\ No newline at end of file
index e6f17619d91a70ca52c62936dd42ca422fe55802..4bf79b78f04a7b13d4f814453c1f74e88b4eade0 100644 (file)
     <group id="WelcomeScreen.Configure">
       <action id="WelcomeScreen.Settings" class="com.intellij.ide.actions.ShowSettingsAction" icon="AllIcons.General.Settings"/>
       <action id="WelcomeScreen.Plugins" class="com.intellij.ide.actions.ShowPluginManagerAction" icon="AllIcons.General.PluginManager"/>
+      <action id="WelcomeScreen.Configure.RunConfigurations" class="com.intellij.execution.actions.EditRunConfigurationsAction" text="Run Configuration Templates"/>
 
       <action id="WelcomeScreen.Configure.Import" class="com.intellij.configurationStore.ImportSettingsAction" icon="AllIcons.ToolbarDecorator.Import"/>
       <action id="WelcomeScreen.Configure.Export" class="com.intellij.configurationStore.ExportSettingsAction" icon="AllIcons.ToolbarDecorator.Export"/>
index 9e4f426816423cbf992facafea8f4dddc65164e9..c7cb233249496df8a490ede7b638f28c49651138 100644 (file)
       <add-to-group group-id="WelcomeScreen.Documentation" anchor="last"/>
     </group>
 
-    <group id="WelcomeScreen.Configure.IDEA">
-      <action class="com.intellij.ide.actions.TemplateProjectSettingsGroup"/>
-      <add-to-group group-id="WelcomeScreen.Configure" anchor="last"/>
-    </group>
+    <action id="WelcomeScreen.Configure.ProjectStructure" class="com.intellij.ide.actions.TemplateProjectStructureAction">
+      <add-to-group group-id="WelcomeScreen.Configure" anchor="before" relative-to-action="WelcomeScreen.Configure.RunConfigurations"/>
+    </action>
 
     <action id="AddFrameworkSupport" class="com.intellij.ide.util.frameworkSupport.AddFrameworkSupportAction">
       <add-to-group group-id="ProjectViewPopupMenu" anchor="after" relative-to-action="WeighingNewGroup"/>