Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-10-24 16:46:41 +0000
committerPawel Piech2012-10-24 16:46:41 +0000
commit09bac73885a81b24c3c7e266f16a849198970a17 (patch)
treeadf0d6ae888ca3244f704910f3711a3bccbeff1c /plugins
parentcad4ea8c233c651d29a8fb64bd1296a26152b767 (diff)
downloadorg.eclipse.tcf-09bac73885a81b24c3c7e266f16a849198970a17.tar.gz
org.eclipse.tcf-09bac73885a81b24c3c7e266f16a849198970a17.tar.xz
org.eclipse.tcf-09bac73885a81b24c3c7e266f16a849198970a17.zip
Bug 392771 - Debug view breadcrumb drop-down closes immediately after expanding a TCF element
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java46
1 files changed, 33 insertions, 13 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index 3daf8e550..71aed8c98 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -613,23 +613,27 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
};
private class InitialSelection implements Runnable {
+ final TCFModelProxy proxy;
boolean done;
+ InitialSelection(TCFModelProxy proxy) {
+ this.proxy = proxy;
+ }
public void run() {
if (done) return;
if (launch_node != null) {
ArrayList<TCFNodeExecContext> nodes = new ArrayList<TCFNodeExecContext>();
if (!searchSuspendedThreads(launch_node.getFilteredChildren(), nodes)) return;
if (nodes.size() == 0) {
- setDebugViewSelection(launch_node, "Launch");
+ setDebugViewSelectionForProxy(proxy, launch_node, "Launch");
}
else if (nodes.size() == 1) {
TCFNodeExecContext n = nodes.get(0);
- setDebugViewSelection(n, "Launch");
+ setDebugViewSelectionForProxy(proxy, n, "Launch");
}
else {
for (TCFNodeExecContext n : nodes) {
String reason = n.getState().getData().suspend_reason;
- setDebugViewSelection(n, reason);
+ setDebugViewSelectionForProxy(proxy, n, reason);
}
}
}
@@ -792,7 +796,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
for (TCFModelProxy p : model_proxies) {
String id = p.getPresentationContext().getId();
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) {
- Protocol.invokeLater(new InitialSelection());
+ Protocol.invokeLater(new InitialSelection(p));
}
}
}
@@ -916,7 +920,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
IPresentationContext pc = mp.getPresentationContext();
model_proxies.add(mp);
if (launch_node != null && pc.getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) {
- Protocol.invokeLater(new InitialSelection());
+ Protocol.invokeLater(new InitialSelection(mp));
}
}
@@ -1567,14 +1571,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
if (reason == null) return;
for (TCFModelProxy proxy : model_proxies) {
if (proxy.getPresentationContext().getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) {
- boolean user_request =
- reason.equals(IRunControl.REASON_USER_REQUEST) ||
- reason.equals(IRunControl.REASON_STEP) ||
- reason.equals(IRunControl.REASON_CONTAINER) ||
- delay_stack_update_until_last_step && launch.getContextActionsCount(node.id) != 0;
- if (proxy.getAutoExpandNode(node.id, user_request)) proxy.expand(node);
- if (reason.equals(IRunControl.REASON_USER_REQUEST)) continue;
- proxy.setSelection(node);
+ setDebugViewSelectionForProxy(proxy, node, reason);
}
if (reason.equals(IRunControl.REASON_BREAKPOINT)) {
IWorkbenchPart part = proxy.getPresentationContext().getPart();
@@ -1586,6 +1583,29 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
}
}
}
+
+ /**
+ * Sets the selection in debug view for a given debug view instance.
+ * @param proxy - model proxy for a given debug view instance
+ * @param node - model node that represents the debug context.
+ * @param reason - suspend reason.
+ */
+ public void setDebugViewSelectionForProxy(TCFModelProxy proxy, TCFNode node, String reason) {
+ assert Protocol.isDispatchThread();
+ if (!proxy.getPresentationContext().getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) return;
+ if (node == null) return;
+ if (node.isDisposed()) return;
+ if (reason == null) return;
+
+ boolean user_request =
+ reason.equals(IRunControl.REASON_USER_REQUEST) ||
+ reason.equals(IRunControl.REASON_STEP) ||
+ reason.equals(IRunControl.REASON_CONTAINER) ||
+ delay_stack_update_until_last_step && launch.getContextActionsCount(node.id) != 0;
+ if (proxy.getAutoExpandNode(node.id, user_request)) proxy.expand(node);
+ if (reason.equals(IRunControl.REASON_USER_REQUEST)) return;
+ proxy.setSelection(node);
+ }
/**
* Reveal source code associated with given model element.

Back to the top