mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
[services] IJPL-17077 add an option to run configuration on double click
GitOrigin-RevId: fcb41fe94a01e453ec789be621a972f0c3cdbd55
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8ea673ff41
commit
f111170c62
@@ -93,7 +93,11 @@
|
||||
<add-to-group group-id="ServiceView.AddService"/>
|
||||
</action>
|
||||
<reference id="RunDashboard.RestoreHiddenConfigurations">
|
||||
<add-to-group group-id="ServiceView.AddService" anchor="after" relative-to-action="RunDashboard.AddType"/>
|
||||
<add-to-group group-id="ServiceView.AddService" anchor="after" relative-to-action="RunDashboard.AddConfiguration"/>
|
||||
</reference>
|
||||
<action id="RunDashboard.DoubleClickRun"
|
||||
class="com.intellij.platform.execution.dashboard.actions.RunDashboardDoubleClickRunAction">
|
||||
<add-to-group group-id="ServiceView.Gear"/>
|
||||
</action>
|
||||
</actions>
|
||||
</idea-plugin>
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.intellij.openapi.util.NullableLazyValue;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.wm.ToolWindowId;
|
||||
import com.intellij.platform.execution.dashboard.actions.RunDashboardDoubleClickRunAction;
|
||||
import com.intellij.platform.execution.dashboard.tree.FolderDashboardGroupingRule.FolderDashboardGroup;
|
||||
import com.intellij.platform.execution.dashboard.tree.GroupingNode;
|
||||
import com.intellij.platform.execution.dashboard.tree.RunConfigurationNode;
|
||||
@@ -416,6 +417,10 @@ public final class RunDashboardServiceViewContributor
|
||||
|
||||
@Override
|
||||
public boolean handleDoubleClick(@NotNull MouseEvent event) {
|
||||
if (!RunDashboardDoubleClickRunAction.Companion.isDoubleClickRunEnabled$intellij_platform_execution_dashboard()) {
|
||||
return ServiceViewDescriptor.super.handleDoubleClick(event);
|
||||
}
|
||||
|
||||
Executor executor = getExecutor();
|
||||
if (executor == null) return true;
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.execution.dashboard.actions
|
||||
|
||||
import com.intellij.execution.dashboard.RunDashboardManager
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys
|
||||
import com.intellij.openapi.actionSystem.ToggleAction
|
||||
import com.intellij.openapi.project.DumbAware
|
||||
|
||||
private const val DOUBLE_CLICK_SETTING = "run.dashboard.double.click.run"
|
||||
|
||||
class RunDashboardDoubleClickRunAction : ToggleAction(), DumbAware {
|
||||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
super.update(e)
|
||||
val project = e.project
|
||||
if (project == null) {
|
||||
e.presentation.isEnabledAndVisible = false
|
||||
return
|
||||
}
|
||||
val toolWindow = e.getData(PlatformDataKeys.TOOL_WINDOW)
|
||||
if (toolWindow == null) {
|
||||
e.presentation.isEnabledAndVisible = false
|
||||
return
|
||||
}
|
||||
e.presentation.isEnabledAndVisible =
|
||||
RunDashboardManager.getInstance(project).toolWindowId == toolWindow.id
|
||||
}
|
||||
|
||||
override fun isSelected(e: AnActionEvent): Boolean {
|
||||
return isDoubleClickRunEnabled()
|
||||
}
|
||||
|
||||
override fun setSelected(e: AnActionEvent, state: Boolean) {
|
||||
PropertiesComponent.getInstance().setValue(DOUBLE_CLICK_SETTING, state, true)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
internal fun isDoubleClickRunEnabled(): Boolean {
|
||||
return PropertiesComponent.getInstance().getBoolean(DOUBLE_CLICK_SETTING, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,10 +49,12 @@
|
||||
<action id="ServiceView.JumpToServices" use-shortcut-of="ShowNavBar"
|
||||
class="com.intellij.platform.execution.serviceView.JumpToServicesAction"/>
|
||||
</group>
|
||||
<action id="ServiceView.SelectActiveService" class="com.intellij.platform.execution.serviceView.SelectActiveServiceAction"/>
|
||||
<action id="ServiceView.ShowServices" icon="AllIcons.Actions.ShowAsTree"
|
||||
class="com.intellij.platform.execution.serviceView.ShowServicesAction"/>
|
||||
<action id="ServiceView.ConfigureServices" icon="AllIcons.General.GearPlain"
|
||||
class="com.intellij.platform.execution.serviceView.ConfigureServicesAction"/>
|
||||
<group id="ServiceView.Gear">
|
||||
<action id="ServiceView.SelectActiveService" class="com.intellij.platform.execution.serviceView.SelectActiveServiceAction"/>
|
||||
<action id="ServiceView.ShowServices" icon="AllIcons.Actions.ShowAsTree"
|
||||
class="com.intellij.platform.execution.serviceView.ShowServicesAction"/>
|
||||
<action id="ServiceView.ConfigureServices" icon="AllIcons.General.GearPlain"
|
||||
class="com.intellij.platform.execution.serviceView.ConfigureServicesAction"/>
|
||||
</group>
|
||||
</actions>
|
||||
</idea-plugin>
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -109,15 +108,8 @@ final class ServiceViewActionProvider {
|
||||
}
|
||||
|
||||
List<AnAction> getAdditionalGearActions() {
|
||||
List<AnAction> result = new ArrayList<>();
|
||||
AnAction selectActiveServiceActions = ActionManager.getInstance().getAction("ServiceView.SelectActiveService");
|
||||
ContainerUtil.addIfNotNull(result, selectActiveServiceActions);
|
||||
result.add(Separator.getInstance());
|
||||
AnAction configureServicesActions = ActionManager.getInstance().getAction("ServiceView.ConfigureServices");
|
||||
ContainerUtil.addIfNotNull(result, configureServicesActions);
|
||||
AnAction showServicesActions = ActionManager.getInstance().getAction("ServiceView.ShowServices");
|
||||
ContainerUtil.addIfNotNull(result, showServicesActions);
|
||||
return result;
|
||||
AnAction additionalActions = ActionManager.getInstance().getAction("ServiceView.Gear");
|
||||
return ContainerUtil.createMaybeSingletonList(additionalActions);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -2424,6 +2424,7 @@ action.ServiceView.ConfigureServices.text=Configure Services Tool Window
|
||||
action.RunDashboard.GroupByType.text=Type
|
||||
action.RunDashboard.GroupByStatus.text=Status
|
||||
action.RunDashboard.AddConfiguration.text=Run Configuration\u2026
|
||||
action.RunDashboard.DoubleClickRun.text=Double Click to Run Configuration
|
||||
action.UpdateRunningApplication.text=Update Running Application
|
||||
action.TypingLatencyReport.text=Typing Latency Report
|
||||
action.RetypeFile.text=Retype Current File
|
||||
|
||||
Reference in New Issue
Block a user