mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup: remove unused
This commit is contained in:
+2
-3
@@ -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
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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<Image, Point> createDraggedImage(final DnDAction action, final Point dragOrigin) {
|
||||
DebuggerTreeNodeImpl[] nodes = getNodesToDrag();
|
||||
|
||||
Pair<Image, Point> 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<DebuggerTreeNodeImpl>() {
|
||||
@Override
|
||||
public boolean accept(final DebuggerTreeNodeImpl node) {
|
||||
return node.getDescriptor() instanceof ValueDescriptorImpl;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -542,7 +542,7 @@
|
||||
|
||||
<action id="Debugger.CreateRenderer" class="com.intellij.debugger.actions.CreateRendererAction" text="Create..."/>
|
||||
<action id="Debugger.AutoRenderer" class="com.intellij.debugger.actions.AutoRendererAction"/>
|
||||
<action id="Debugger.MuteRenderers" class="com.intellij.debugger.ui.tree.actions.ForceOnDemandRenderersAction" text="Mute Renderers">
|
||||
<action id="Debugger.MuteRenderers" class="com.intellij.debugger.actions.ForceOnDemandRenderersAction" text="Mute Renderers">
|
||||
<add-to-group group-id="XDebugger.ValueGroup" anchor="last"/>
|
||||
</action>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user