diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/actions/ForceOnDemandRenderersAction.kt b/java/debugger/impl/src/com/intellij/debugger/actions/ForceOnDemandRenderersAction.kt similarity index 88% rename from java/debugger/impl/src/com/intellij/debugger/ui/tree/actions/ForceOnDemandRenderersAction.kt rename to java/debugger/impl/src/com/intellij/debugger/actions/ForceOnDemandRenderersAction.kt index cc9562631c87..29f66141ee89 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/actions/ForceOnDemandRenderersAction.kt +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ForceOnDemandRenderersAction.kt @@ -1,7 +1,6 @@ -// Copyright 2000-2017 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.debugger.ui.tree.actions +// Copyright 2000-2019 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.debugger.actions -import com.intellij.debugger.actions.DebuggerAction import com.intellij.debugger.settings.NodeRendererSettings import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.ToggleAction diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/InspectDebuggerTree.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/InspectDebuggerTree.java deleted file mode 100644 index 9d92942fbb39..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/InspectDebuggerTree.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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.debugger.ui.impl; - -import com.intellij.debugger.DebuggerInvocationUtil; -import com.intellij.debugger.actions.DebuggerActions; -import com.intellij.debugger.engine.SuspendContextImpl; -import com.intellij.debugger.engine.events.DebuggerContextCommandImpl; -import com.intellij.debugger.impl.DebuggerContextImpl; -import com.intellij.debugger.ui.impl.watch.DebuggerTree; -import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; -import com.intellij.debugger.ui.impl.watch.NodeDescriptorImpl; -import com.intellij.openapi.actionSystem.ActionGroup; -import com.intellij.openapi.actionSystem.ActionManager; -import com.intellij.openapi.actionSystem.ActionPopupMenu; -import com.intellij.openapi.project.Project; -import com.intellij.ui.PopupHandler; -import org.jetbrains.annotations.NotNull; - -import java.awt.*; - -public class InspectDebuggerTree extends DebuggerTree{ - private NodeDescriptorImpl myInspectDescriptor; - - public InspectDebuggerTree(Project project) { - super(project); - - final PopupHandler popupHandler = new PopupHandler() { - @Override - public void invokePopup(Component comp, int x, int y) { - ActionPopupMenu popupMenu = createPopupMenu(); - if (popupMenu != null) { - myTipManager.registerPopup(popupMenu.getComponent()).show(comp, x, y); - } - } - }; - addMouseListener(popupHandler); - - new ValueNodeDnD(this, project); - } - - public static ActionPopupMenu createPopupMenu() { - ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(DebuggerActions.INSPECT_PANEL_POPUP); - return ActionManager.getInstance().createActionPopupMenu(DebuggerActions.INSPECT_PANEL_POPUP, group); - } - - @Override - protected void build(DebuggerContextImpl context) { - updateNode(context); - } - - public void setInspectDescriptor(NodeDescriptorImpl inspectDescriptor) { - myInspectDescriptor = inspectDescriptor; - } - - public NodeDescriptorImpl getInspectDescriptor() { - return myInspectDescriptor; - } - - - - private void updateNode(final DebuggerContextImpl context) { - context.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(context) { - @Override - public void threadAction(@NotNull SuspendContextImpl suspendContext) { - DebuggerTreeNodeImpl node = getNodeFactory().createNode(myInspectDescriptor, context.createEvaluationContext()); - - DebuggerInvocationUtil.swingInvokeLater(getProject(), () -> { - DebuggerTreeNodeImpl root = (DebuggerTreeNodeImpl) getModel().getRoot(); - root.removeAllChildren(); - - root.add(node); - treeChanged(); - root.getTree().expandRow(0); - }); - } - }); - } -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/ValueNodeDnD.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/ValueNodeDnD.java deleted file mode 100644 index 87f1d4fd0ded..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/ValueNodeDnD.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2000-2009 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.debugger.ui.impl; - -import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; -import com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl; -import com.intellij.ide.dnd.DnDAction; -import com.intellij.ide.dnd.DnDDragStartBean; -import com.intellij.ide.dnd.DnDManager; -import com.intellij.ide.dnd.DnDSource; -import com.intellij.ide.dnd.aware.DnDAwareTree; -import com.intellij.openapi.Disposable; -import com.intellij.openapi.util.Pair; -import com.intellij.ui.treeStructure.Tree; -import org.jetbrains.annotations.Nullable; - -import javax.swing.tree.TreePath; -import java.awt.*; - -public class ValueNodeDnD { - private final DnDAwareTree myTree; - - public ValueNodeDnD(DnDAwareTree tree, Disposable parent) { - myTree = tree; - - DnDManager.getInstance().registerSource(new DnDSource() { - @Override - public boolean canStartDragging(final DnDAction action, final Point dragOrigin) { - return getNodesToDrag().length > 0; - } - - @Override - public DnDDragStartBean startDragging(final DnDAction action, final Point dragOrigin) { - DebuggerTreeNodeImpl[] nodes = getNodesToDrag(); - return new DnDDragStartBean(nodes); - } - - @Override - @Nullable - public Pair createDraggedImage(final DnDAction action, final Point dragOrigin) { - DebuggerTreeNodeImpl[] nodes = getNodesToDrag(); - - Pair image; - if (nodes.length == 1) { - image = DnDAwareTree.getDragImage(myTree, new TreePath(nodes[0].getPath()), dragOrigin); - } else { - image = DnDAwareTree.getDragImage(myTree, nodes.length + " elements", dragOrigin); - } - - return image; - } - - @Override - public void dragDropEnd() { - } - - @Override - public void dropActionChanged(final int gestureModifiers) { - } - }, tree); - } - - private DebuggerTreeNodeImpl[] getNodesToDrag() { - return myTree.getSelectedNodes(DebuggerTreeNodeImpl.class, new Tree.NodeFilter() { - @Override - public boolean accept(final DebuggerTreeNodeImpl node) { - return node.getDescriptor() instanceof ValueDescriptorImpl; - } - }); - } - -} diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/impl/nodes/ArrayIndexHelper.java b/java/debugger/impl/src/com/intellij/debugger/ui/impl/nodes/ArrayIndexHelper.java deleted file mode 100644 index 78309a8d198b..000000000000 --- a/java/debugger/impl/src/com/intellij/debugger/ui/impl/nodes/ArrayIndexHelper.java +++ /dev/null @@ -1,59 +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. - */ - -/* - * Class ArrayIndexHelper - * @author Jeka - */ -package com.intellij.debugger.ui.impl.nodes; - -import com.intellij.debugger.ui.tree.render.ArrayRenderer; -import com.intellij.openapi.diagnostic.Logger; -import com.sun.jdi.ArrayReference; - -public class ArrayIndexHelper { - private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.ui.impl.nodes.ArrayIndexHelper"); - private final ArrayReference myArray; - private final ArrayRenderer myRenderer; - - public ArrayIndexHelper(ArrayReference array, ArrayRenderer renderer) { - myRenderer = renderer; - myArray = array; - } - - /** - * @return normalized start index or -1 if this is not an array or array's length == 0 - */ - public int getStartIndex() { - if (myArray.length() == 0) return -1; - return myRenderer.START_INDEX; - } - - /** - * @return normalized end index or -1 if this is not an array or array's length == 0 - */ - - public int getEndIndex() { - return Math.min(myArray.length() - 1, myRenderer.END_INDEX); - } - - public ArrayRenderer newRenderer(int startIdx, int endIdx) { - ArrayRenderer result = myRenderer.clone(); - result.START_INDEX = startIdx < myArray.length() ? startIdx : 0; - result.END_INDEX = startIdx <= endIdx ? endIdx : startIdx; - return result; - } -} \ No newline at end of file diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/OnDemandRenderer.java b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/OnDemandRenderer.java index 434c238e5ca2..2894db612209 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/OnDemandRenderer.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/tree/render/OnDemandRenderer.java @@ -1,18 +1,4 @@ -/* - * 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. - */ +// Copyright 2000-2019 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.debugger.ui.tree.render; import com.intellij.debugger.engine.DebugProcessImpl; @@ -23,7 +9,7 @@ import com.intellij.debugger.engine.evaluation.EvaluationContext; import com.intellij.debugger.engine.evaluation.EvaluationContextImpl; import com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl; import com.intellij.debugger.ui.tree.ValueDescriptor; -import com.intellij.debugger.ui.tree.actions.ForceOnDemandRenderersAction; +import com.intellij.debugger.actions.ForceOnDemandRenderersAction; import com.intellij.openapi.util.Key; import com.intellij.xdebugger.frame.XFullValueEvaluator; import com.intellij.xdebugger.frame.XValuePlace; diff --git a/resources/src/idea/JavaActions.xml b/resources/src/idea/JavaActions.xml index 3615791354b7..160f91445ff3 100644 --- a/resources/src/idea/JavaActions.xml +++ b/resources/src/idea/JavaActions.xml @@ -542,7 +542,7 @@ - +