mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-132319 "View as" broken in evaluation dialog
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 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.
|
||||
@@ -75,15 +75,23 @@ public class ViewAsGroup extends ActionGroup implements DumbAware {
|
||||
|
||||
final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
|
||||
final List<JavaValue> values = getSelectedValues(e);
|
||||
final List<XValueNodeImpl> selectedNodes = XDebuggerTreeActionBase.getSelectedNodes(e.getDataContext());
|
||||
|
||||
LOG.assertTrue(debuggerContext != null && !values.isEmpty());
|
||||
|
||||
debuggerContext.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
|
||||
DebugProcessImpl process = debuggerContext.getDebugProcess();
|
||||
if (process == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
process.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
|
||||
public void threadAction() {
|
||||
for (JavaValue value : values) {
|
||||
value.getDescriptor().setRenderer(myNodeRenderer);
|
||||
for (final XValueNodeImpl node : selectedNodes) {
|
||||
final XValue container = node.getValueContainer();
|
||||
if (container instanceof JavaValue) {
|
||||
((JavaValue)container).setRenderer(myNodeRenderer, node);
|
||||
}
|
||||
}
|
||||
DebuggerAction.refreshViews(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -288,7 +288,7 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
|
||||
return myValueDescriptor.getValueText();
|
||||
}
|
||||
|
||||
private int currentStart = 0;
|
||||
private int myCurrentChildrenStart = 0;
|
||||
|
||||
@Override
|
||||
public void computeChildren(@NotNull final XCompositeNode node) {
|
||||
@@ -326,9 +326,9 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
|
||||
|
||||
@Override
|
||||
public void initChildrenArrayRenderer(ArrayRenderer renderer) {
|
||||
renderer.START_INDEX = currentStart;
|
||||
renderer.END_INDEX = currentStart + XCompositeNode.MAX_CHILDREN_TO_SHOW - 1;
|
||||
currentStart += XCompositeNode.MAX_CHILDREN_TO_SHOW;
|
||||
renderer.START_INDEX = myCurrentChildrenStart;
|
||||
renderer.END_INDEX = myCurrentChildrenStart + XCompositeNode.MAX_CHILDREN_TO_SHOW - 1;
|
||||
myCurrentChildrenStart += XCompositeNode.MAX_CHILDREN_TO_SHOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -456,14 +456,14 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
|
||||
public String getEvaluationExpression() {
|
||||
if (evaluationExpression == null) {
|
||||
// TODO: change API to allow to calculate it asynchronously
|
||||
myEvaluationContext.getManagerThread().invokeAndWait(new DebuggerCommandImpl() {
|
||||
myEvaluationContext.getManagerThread().invokeAndWait(new SuspendContextCommandImpl(myEvaluationContext.getSuspendContext()) {
|
||||
@Override
|
||||
public Priority getPriority() {
|
||||
return Priority.HIGH;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void action() throws Exception {
|
||||
public void contextAction() throws Exception {
|
||||
evaluationExpression = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
|
||||
@Override
|
||||
public String compute() {
|
||||
@@ -536,4 +536,17 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void setRenderer(NodeRenderer nodeRenderer, final XValueNodeImpl node) {
|
||||
DebuggerManagerThreadImpl.assertIsManagerThread();
|
||||
myValueDescriptor.setRenderer(nodeRenderer);
|
||||
myCurrentChildrenStart = 0;
|
||||
node.getTree().getLaterInvocator().offer(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
node.clearChildren();
|
||||
computePresentation(node, XValuePlace.TREE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user