Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ action.auto.variables.mode:
text: Auto-Variables Mode
action.auto.variables.mode.description:
text: Show only variables used near the execution point
action.create.renderer.text:
text: Create...
action.disable.text:
text: Disable
action.enable.text:
Expand All @@ -20,6 +22,8 @@ action.kill.process.text:
text: Kill Process
action.maximizeContent.text:
text: ''
action.mute.renderers.text:
text: Mute Renderers
action.remove.text:
text: Remove
action.remove.watch.text:
Expand Down Expand Up @@ -531,6 +535,8 @@ frame.panel.frames.not.available:
text: Frames not available for unsuspended thread
get.jpda.dialog.title:
text: JPDA Libraries Missing
group.java.debugger.actions.text:
text: Java
hotswap.dialog.hang.question:
text: Would you like to reload changed classes anyway?
hotswap.dialog.hang.warning:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright 2000-2017 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.
*/
package com.intellij.java.debugger.impl.actions;

import com.intellij.java.debugger.impl.DebuggerContextImpl;
import com.intellij.java.debugger.impl.ui.tree.render.ArrayRenderer;
import consulo.annotation.component.ActionImpl;
import consulo.execution.debug.frame.XValueNode;
import consulo.execution.debug.localize.XDebuggerLocalize;
import consulo.ide.setting.ShowSettingsUtil;
import consulo.localize.LocalizeValue;
import consulo.ui.annotation.RequiredUIAccess;
import consulo.util.concurrent.AsyncResult;
import jakarta.annotation.Nonnull;

@ActionImpl(id = "Debugger.AdjustArrayRange")
public class AdjustArrayRangeAction extends ArrayAction {
public AdjustArrayRangeAction() {
super(XDebuggerLocalize.actionAdjustArrayRangeText());
}

@Nonnull
@Override
@RequiredUIAccess
protected AsyncResult<ArrayRenderer> createNewRenderer(
XValueNode node,
ArrayRenderer original,
@Nonnull DebuggerContextImpl debuggerContext,
LocalizeValue title
) {
ArrayRenderer clonedRenderer = original.clone();
clonedRenderer.setForced(true);
AsyncResult<ArrayRenderer> result = AsyncResult.undefined();
AsyncResult<Void> showResult = ShowSettingsUtil.getInstance()
.editConfigurable(debuggerContext.getProject(), new NamedArrayConfigurable(title, clonedRenderer));
showResult.doWhenDone(() -> result.setDone(clonedRenderer));
showResult.doWhenRejected((Runnable)result::setRejected);
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
import java.util.List;

public abstract class ArrayAction extends DebuggerAction {
protected ArrayAction(@Nonnull LocalizeValue text) {
super(text);
}

@Override
@RequiredUIAccess
public void actionPerformed(@Nonnull AnActionEvent e) {
Expand Down Expand Up @@ -163,7 +167,7 @@ private static String createNodeTitle(String prefix, DebuggerTreeNodeImpl node)
return prefix;
}

private static class NamedArrayConfigurable extends ArrayRendererConfigurable implements Configurable {
protected static class NamedArrayConfigurable extends ArrayRendererConfigurable implements Configurable {
private final LocalizeValue myTitle;

public NamedArrayConfigurable(LocalizeValue title, ArrayRenderer renderer) {
Expand All @@ -182,39 +186,4 @@ public String getHelpTopic() {
return null;
}
}

public static class AdjustArrayRangeAction extends ArrayAction {
@Nonnull
@Override
@RequiredUIAccess
protected AsyncResult<ArrayRenderer> createNewRenderer(
XValueNode node,
ArrayRenderer original,
@Nonnull DebuggerContextImpl debuggerContext,
LocalizeValue title
) {
ArrayRenderer clonedRenderer = original.clone();
clonedRenderer.setForced(true);
AsyncResult<ArrayRenderer> result = AsyncResult.undefined();
AsyncResult<Void> showResult = ShowSettingsUtil.getInstance()
.editConfigurable(debuggerContext.getProject(), new NamedArrayConfigurable(title, clonedRenderer));
showResult.doWhenDone(() -> result.setDone(clonedRenderer));
showResult.doWhenRejected((Runnable)result::setRejected);
return result;
}
}

public static class FilterArrayAction extends ArrayAction {
@Nonnull
@Override
protected AsyncResult<ArrayRenderer> createNewRenderer(
XValueNode node,
ArrayRenderer original,
@Nonnull DebuggerContextImpl debuggerContext,
LocalizeValue title
) {
//TODO [VISTALL] ArrayFilterInplaceEditor.editParent(node);
return AsyncResult.rejected();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
import com.intellij.java.debugger.impl.engine.events.DebuggerContextCommandImpl;
import com.intellij.java.debugger.impl.ui.impl.watch.DebuggerTreeNodeImpl;
import com.intellij.java.debugger.impl.ui.impl.watch.ValueDescriptorImpl;
import consulo.annotation.component.ActionImpl;
import consulo.execution.debug.localize.XDebuggerLocalize;
import consulo.ui.annotation.RequiredUIAccess;
import consulo.ui.ex.action.AnAction;
import consulo.ui.ex.action.AnActionEvent;

@ActionImpl(id = "Debugger.AutoRenderer")
public class AutoRendererAction extends AnAction {
public AutoRendererAction() {
super(XDebuggerLocalize.actionAutoRendererText());
}

@Override
@RequiredUIAccess
public void actionPerformed(AnActionEvent e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.intellij.java.debugger.impl.settings.UserRenderersConfigurable;
import com.intellij.java.debugger.impl.ui.tree.render.NodeRenderer;
import com.intellij.java.debugger.localize.JavaDebuggerLocalize;
import consulo.annotation.component.ActionImpl;
import consulo.application.Application;
import consulo.configurable.IdeaConfigurableBase;
import consulo.ide.impl.idea.openapi.options.ex.SingleConfigurableEditor;
Expand All @@ -36,7 +37,12 @@

import java.util.List;

@ActionImpl(id = "Debugger.CreateRenderer")
public class CreateRendererAction extends AnAction {
public CreateRendererAction() {
super(JavaDebuggerLocalize.actionCreateRendererText());
}

@Override
@RequiredUIAccess
public void update(@Nonnull AnActionEvent e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import com.intellij.java.debugger.impl.settings.JavaDebuggerSettings;
import com.intellij.java.debugger.impl.settings.NodeRendererSettings;
import com.intellij.java.debugger.localize.JavaDebuggerLocalize;
import consulo.annotation.component.ActionImpl;
import consulo.annotation.component.ActionParentRef;
import consulo.annotation.component.ActionRef;
import consulo.configurable.Configurable;
import consulo.configurable.ConfigurationException;
import consulo.disposer.Disposable;
Expand All @@ -33,68 +36,77 @@
import consulo.ui.annotation.RequiredUIAccess;
import consulo.ui.ex.action.AnActionEvent;
import consulo.ui.ex.action.DumbAwareAction;
import jakarta.annotation.Nonnull;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.util.List;

@ActionImpl(
id = "Debugger.CustomizeContextView",
parents = {
@ActionParentRef(@ActionRef(id = "XDebugger.Variables.Tree.Popup")),
@ActionParentRef(@ActionRef(id = "XDebugger.Watches.Tree.Popup"))
}
)
public class CustomizeContextViewAction extends DumbAwareAction {
public CustomizeContextViewAction() {
super(XDebuggerLocalize.actionCustomizeContextViewText());
}

@Override
@RequiredUIAccess
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(Project.KEY);
Disposable disposable = Disposable.newDisposable();
SingleConfigurableEditor editor = new SingleConfigurableEditor(project, new TabbedConfigurable(disposable) {
@Override
protected List<Configurable> createConfigurables() {
return JavaDebuggerSettings.createDataViewsConfigurable();
}
SingleConfigurableEditor editor = new SingleConfigurableEditor(
project,
new TabbedConfigurable(disposable) {
@Override
protected List<Configurable> createConfigurables() {
return JavaDebuggerSettings.createDataViewsConfigurable();
}

@Override
@RequiredUIAccess
public void apply() throws ConfigurationException {
super.apply();
NodeRendererSettings.getInstance().fireRenderersChanged();
}
@Override
@RequiredUIAccess
public void apply() throws ConfigurationException {
super.apply();
NodeRendererSettings.getInstance().fireRenderersChanged();
}

@Override
public LocalizeValue getDisplayName() {
return JavaDebuggerLocalize.titleCustomizeDataViews();
}
@Nonnull
@Override
public LocalizeValue getDisplayName() {
return JavaDebuggerLocalize.titleCustomizeDataViews();
}

@Override
public String getHelpTopic() {
return "reference.debug.customize.data.view";
}
@Override
public String getHelpTopic() {
return "reference.debug.customize.data.view";
}

@Override
@RequiredUIAccess
protected void createConfigurableTabs() {
for (Configurable configurable : getConfigurables()) {
JComponent component = configurable.createComponent(disposable);
assert component != null;
component.setBorder(new EmptyBorder(8, 8, 8, 8));
myTabbedPane.addTab(configurable.getDisplayName().get(), component);
@Override
@RequiredUIAccess
protected void createConfigurableTabs() {
for (Configurable configurable : getConfigurables()) {
JComponent component = configurable.createComponent(disposable);
assert component != null;
component.setBorder(new EmptyBorder(8, 8, 8, 8));
myTabbedPane.addTab(configurable.getDisplayName().get(), component);
}
}
}
});
);
Disposer.register(editor.getDisposable(), disposable);
editor.show();
}

@Override
@RequiredUIAccess
public void update(AnActionEvent e) {
e.getPresentation().setTextValue(XDebuggerLocalize.actionCustomizeContextViewText());

Project project = e.getData(Project.KEY);
XDebuggerManager debuggerManager = project == null ? null : XDebuggerManager.getInstance(project);
XDebugSession currentSession = debuggerManager == null ? null : debuggerManager.getCurrentSession();
if (currentSession != null) {
e.getPresentation().setEnabledAndVisible(currentSession.getDebugProcess() instanceof JavaDebugProcess);
}
else {
e.getPresentation().setEnabledAndVisible(false);
}
e.getPresentation().setEnabledAndVisible(currentSession != null && currentSession.getDebugProcess() instanceof JavaDebugProcess);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

import com.intellij.java.debugger.impl.settings.ThreadsViewSettings;
import com.intellij.java.debugger.localize.JavaDebuggerLocalize;
import consulo.annotation.component.ActionImpl;
import consulo.annotation.component.ActionParentRef;
import consulo.annotation.component.ActionRef;
import consulo.execution.debug.localize.XDebuggerLocalize;
import consulo.ide.setting.ShowSettingsUtil;
import consulo.java.debugger.impl.settings.ThreadsViewConfigurable;
Expand All @@ -29,7 +32,12 @@
* @author lex
* @since 2003-09-26
*/
@ActionImpl(id = "Debugger.CustomizeThreadsView", parents = @ActionParentRef(@ActionRef(id = "XDebugger.Frames.Tree.Popup")))
public class CustomizeThreadsViewAction extends DebuggerAction {
public CustomizeThreadsViewAction() {
super(XDebuggerLocalize.actionCustomizeThreadsViewText());
}

@Override
@RequiredUIAccess
public void actionPerformed(@Nonnull AnActionEvent e) {
Expand All @@ -41,11 +49,4 @@ public void actionPerformed(@Nonnull AnActionEvent e) {
new ThreadsViewConfigurable(ThreadsViewSettings::getInstance)
);
}

@Override
@RequiredUIAccess
public void update(@Nonnull AnActionEvent e) {
e.getPresentation().setVisible(true);
e.getPresentation().setTextValue(XDebuggerLocalize.actionCustomizeThreadsViewText());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import consulo.execution.debug.XDebugSession;
import consulo.execution.debug.frame.XValueNode;
import consulo.execution.debug.ui.XValueTree;
import consulo.localize.LocalizeValue;
import consulo.project.Project;
import consulo.ui.ex.action.ActionManager;
import consulo.ui.ex.action.AnAction;
Expand All @@ -42,15 +43,27 @@
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
* Class DebuggerAction
*
* @author Jeka
*/
public abstract class DebuggerAction extends AnAction {
private static final Set<String> POPUP_PLACES = Set.of(
DebuggerActions.EVALUATION_DIALOG_POPUP,
DebuggerActions.FRAME_PANEL_POPUP,
DebuggerActions.WATCH_PANEL_POPUP,
DebuggerActions.INSPECT_PANEL_POPUP
);

private static final DebuggerTreeNodeImpl[] EMPTY_TREE_NODE_ARRAY = new DebuggerTreeNodeImpl[0];

protected DebuggerAction(@Nonnull LocalizeValue text) {
super(text);
}

@Nullable
public static DebuggerTree getTree(DataContext dataContext) {
return dataContext.getData(DebuggerTree.DATA_KEY);
Expand Down Expand Up @@ -117,10 +130,7 @@ public static DebuggerStateManager getContextManager(DataContext dataContext) {
}

public static boolean isContextView(AnActionEvent e) {
return DebuggerActions.EVALUATION_DIALOG_POPUP.equals(e.getPlace()) ||
DebuggerActions.FRAME_PANEL_POPUP.equals(e.getPlace()) ||
DebuggerActions.WATCH_PANEL_POPUP.equals(e.getPlace()) ||
DebuggerActions.INSPECT_PANEL_POPUP.equals(e.getPlace());
return POPUP_PLACES.contains(e.getPlace());
}

public static Disposable installEditAction(JTree tree, String actionName) {
Expand Down Expand Up @@ -148,7 +158,7 @@ protected boolean onDoubleClick(MouseEvent e) {

public static boolean isFirstStart(AnActionEvent event) {
//noinspection HardCodedStringLiteral
String key = "initalized";
String key = "initialized";
if (event.getPresentation().getClientProperty(key) != null) {
return false;
}
Expand Down
Loading
Loading