mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-200366 No way to configure Run Configuration Templates for a new projects in non-IDEA IDEs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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(), "..."));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -678,6 +678,7 @@
|
||||
<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"/>
|
||||
|
||||
@@ -385,10 +385,9 @@
|
||||
<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"/>
|
||||
|
||||
Reference in New Issue
Block a user