[rd debugger] IDEA-377734 Move customize data views action to frontend

GitOrigin-RevId: c95a0691eeb4477dfc87eb621da36f108e0ce8e8
This commit is contained in:
Maksim Zuev
2025-08-21 16:32:34 +00:00
committed by intellij-monorepo-bot
parent 46e3e76039
commit 2c590397df
10 changed files with 62 additions and 29 deletions
+1
View File
@@ -35,6 +35,7 @@ jvm_library(
"//platform/xdebugger-impl/rpc",
"//platform/projectModel-api:projectModel",
"//platform/util/jdom",
"//platform/project/shared:project",
],
runtime_deps = [":backend_resources"]
)
@@ -55,5 +55,6 @@
<orderEntry type="module" module-name="intellij.platform.debugger.impl.rpc" />
<orderEntry type="module" module-name="intellij.platform.projectModel" />
<orderEntry type="module" module-name="intellij.platform.util.jdom" />
<orderEntry type="module" module-name="intellij.platform.project" />
</component>
</module>
@@ -2,6 +2,7 @@
package com.intellij.java.debugger.impl.backend
import com.intellij.debugger.actions.CreateRendererActionUtils
import com.intellij.debugger.actions.CustomizeContextViewActionUtils
import com.intellij.debugger.engine.JavaDebugProcess
import com.intellij.debugger.engine.JavaValue
import com.intellij.debugger.memory.action.CalculateRetainedSizeActionUtil
@@ -10,6 +11,8 @@ import com.intellij.debugger.memory.filtering.ClassInstancesProvider
import com.intellij.debugger.memory.ui.InstancesWindow
import com.intellij.java.debugger.impl.shared.rpc.JavaDebuggerLuxActionsApi
import com.intellij.openapi.application.EDT
import com.intellij.platform.project.ProjectId
import com.intellij.platform.project.findProject
import com.intellij.xdebugger.impl.rpc.XValueId
import com.intellij.xdebugger.impl.rpc.models.BackendXValueModel
import com.sun.jdi.ReferenceType
@@ -45,4 +48,11 @@ internal class BackendJavaDebuggerLuxActionsApi : JavaDebuggerLuxActionsApi {
CreateRendererActionUtils.showCreateRendererDialog(javaValue)
}
}
override suspend fun showCustomizeDataViewsDialog(projectId: ProjectId) {
val project = projectId.findProject()
withContext(Dispatchers.EDT) {
CustomizeContextViewActionUtils.showDialog(project)
}
}
}
@@ -216,10 +216,6 @@
<action id="Debugger.ShowCollectionHistory" class="com.intellij.debugger.actions.ShowCollectionHistoryAction">
<add-to-group group-id="XDebugger.ValueGroup" anchor="last"/>
</action>
<action id="Debugger.CustomizeContextView" class="com.intellij.debugger.actions.CustomizeContextViewAction">
<add-to-group group-id="XDebugger.Variables.Tree.Popup" anchor="last"/>
<add-to-group group-id="XDebugger.Watches.Tree.Popup" anchor="last"/>
</action>
<action id="Debugger.NewCustomField" class="com.intellij.debugger.actions.NewCustomFieldAction">
<add-to-group group-id="XDebugger.Variables.Tree.Popup" anchor="first"/>
<add-to-group group-id="XDebugger.Watches.Tree.Popup" anchor="after" relative-to-action="XDebugger.NewWatch"/>
@@ -4,33 +4,23 @@ package com.intellij.debugger.actions;
import com.intellij.debugger.JavaDebuggerBundle;
import com.intellij.debugger.settings.JavaDebuggerSettings;
import com.intellij.debugger.settings.NodeRendererSettings;
import com.intellij.idea.ActionsBundle;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.TabbedConfigurable;
import com.intellij.openapi.options.ex.SingleConfigurableEditor;
import com.intellij.openapi.project.Project;
import com.intellij.util.ui.JBUI;
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeActionBase;
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.util.List;
public class CustomizeContextViewAction extends XDebuggerTreeActionBase {
@ApiStatus.Internal
public final class CustomizeContextViewActionUtils {
private static int ourLastSelectedTabIndex = 0;
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
perform(null, "", e);
}
@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
final Project project = e.getProject();
public static void showDialog(Project project) {
final MyTabbedConfigurable configurable = new MyTabbedConfigurable();
SingleConfigurableEditor editor = new SingleConfigurableEditor(project, configurable) {
@Override
@@ -87,15 +77,4 @@ public class CustomizeContextViewAction extends XDebuggerTreeActionBase {
return myTabbedPane.getSelectedIndex();
}
}
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.BGT;
}
@Override
public void update(@NotNull AnActionEvent e) {
e.getPresentation().setText(ActionsBundle.actionText("Debugger.CustomizeContextView"));
e.getPresentation().setEnabledAndVisible(DebuggerAction.isInJavaSession(e));
}
}
+1
View File
@@ -34,6 +34,7 @@ jvm_library(
"//platform/util/coroutines",
"//platform/xdebugger-impl/rpc",
"//platform/xdebugger-impl/shared",
"//platform/project/shared:project",
],
runtime_deps = [":shared_resources"]
)
@@ -54,5 +54,6 @@
<orderEntry type="module" module-name="intellij.platform.util.coroutines" />
<orderEntry type="module" module-name="intellij.platform.debugger.impl.rpc" />
<orderEntry type="module" module-name="intellij.platform.debugger.impl.shared" />
<orderEntry type="module" module-name="intellij.platform.project" />
</component>
</module>
@@ -75,5 +75,10 @@
<add-to-group group-id="XDebugger.ValueGroup" anchor="after" relative-to-action="Debugger.ShowTypes"/>
<add-to-group group-id="XDebugger.Inspect.Tree.Popup.Bottom.Section.Frontend" anchor="after" relative-to-action="Debugger.ShowTypes"/>
</action>
<action id="Debugger.CustomizeContextView" class="com.intellij.java.debugger.impl.shared.actions.CustomizeContextViewAction">
<add-to-group group-id="XDebugger.Variables.Tree.Popup" anchor="last"/>
<add-to-group group-id="XDebugger.Watches.Tree.Popup" anchor="last"/>
<add-to-group group-id="XDebugger.Inspect.Tree.Popup.Bottom.Section.Frontend" anchor="last"/>
</action>
</actions>
</idea-plugin>
@@ -0,0 +1,37 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.java.debugger.impl.shared.actions
import com.intellij.idea.ActionsBundle
import com.intellij.java.debugger.impl.shared.SharedJavaDebuggerSession
import com.intellij.java.debugger.impl.shared.rpc.JavaDebuggerLuxActionsApi
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.remoting.ActionRemoteBehaviorSpecification
import com.intellij.platform.project.projectId
import com.intellij.xdebugger.impl.ui.DebuggerUIUtil
import com.intellij.xdebugger.impl.ui.tree.actions.XDebuggerTreeActionBase
import com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl
import kotlinx.coroutines.launch
private class CustomizeContextViewAction : XDebuggerTreeActionBase(), ActionRemoteBehaviorSpecification.FrontendOtherwiseBackend {
override fun actionPerformed(e: AnActionEvent) {
perform(null, "", e)
}
override fun perform(node: XValueNodeImpl?, nodeName: String, e: AnActionEvent) {
val session = DebuggerUIUtil.getSessionProxy(e) ?: return
session.coroutineScope.launch {
JavaDebuggerLuxActionsApi.getInstance().showCustomizeDataViewsDialog(session.project.projectId())
}
}
override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
override fun update(e: AnActionEvent) {
e.presentation.setText(ActionsBundle.actionText("Debugger.CustomizeContextView"))
val javaSession = SharedJavaDebuggerSession.findSession(e)
e.presentation.setEnabledAndVisible(javaSession != null)
}
}
@@ -1,6 +1,7 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.java.debugger.impl.shared.rpc
import com.intellij.platform.project.ProjectId
import com.intellij.platform.rpc.RemoteApiProviderService
import com.intellij.xdebugger.impl.rpc.XValueId
import fleet.rpc.RemoteApi
@@ -12,6 +13,7 @@ interface JavaDebuggerLuxActionsApi : RemoteApi<Unit> {
suspend fun showInstancesDialog(xValueId: XValueId)
suspend fun showCalculateRetainedSizeDialog(xValueId: XValueId, nodeName: String)
suspend fun showCreateRendererDialog(xValueId: XValueId)
suspend fun showCustomizeDataViewsDialog(projectId: ProjectId)
companion object {
@JvmStatic