Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 220953 Details for
Bug 389197
[debug view] If user expands stack trace, it should re-expand after a suspended event.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updated patch.
0001-Bug-389197-debug-view-If-user-expands-stack-trace-it.patch (text/plain), 12.37 KB, created by
Pawel Piech
on 2012-09-11 17:22:49 EDT
(
hide
)
Description:
Updated patch.
Filename:
MIME Type:
Creator:
Pawel Piech
Created:
2012-09-11 17:22:49 EDT
Size:
12.37 KB
patch
obsolete
>From d19de45704a0c6abbd6955f02804d66b19da81ad Mon Sep 17 00:00:00 2001 >From: Pawel Piech <pawel.piech@windriver.com> >Date: Mon, 10 Sep 2012 14:21:48 -0700 >Subject: [PATCH] Bug 389197 - [debug view] If user expands stack trace, it > should re-expand after a suspended event > >--- > .../tcf/internal/debug/ui/model/TCFModel.java | 17 +++-- > .../tcf/internal/debug/ui/model/TCFModelProxy.java | 74 +++++++++++++++++--- > 2 files changed, 72 insertions(+), 19 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 2ed4a32..5529277 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 >@@ -40,7 +40,6 @@ import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension; > import org.eclipse.debug.core.model.ISourceLocator; > import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector; > import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant; >-import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation; >@@ -58,6 +57,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactor > import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicyFactory; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; >+import org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputProvider; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate; > import org.eclipse.debug.ui.DebugUITools; >@@ -86,8 +86,8 @@ import org.eclipse.swt.widgets.MessageBox; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.tcf.core.Command; > import org.eclipse.tcf.debug.ui.ITCFModel; >-import org.eclipse.tcf.debug.ui.ITCFSourceDisplay; > import org.eclipse.tcf.debug.ui.ITCFPresentationProvider; >+import org.eclipse.tcf.debug.ui.ITCFSourceDisplay; > import org.eclipse.tcf.internal.debug.actions.TCFAction; > import org.eclipse.tcf.internal.debug.launch.TCFSourceLookupDirector; > import org.eclipse.tcf.internal.debug.launch.TCFSourceLookupParticipant; >@@ -158,7 +158,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab > UPDATE_POLICY_MANUAL = 1, > UPDATE_POLICY_BREAKPOINT = 2; > >- /** >+ /** > * A dummy editor input to open the disassembly view as editor. > */ > public static class DisassemblyEditorInput implements IEditorInput { >@@ -295,8 +295,6 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab > > private final Map<String,Object> context_map = new HashMap<String,Object>(); > >- private final Set<String> expanded_nodes = new HashSet<String>(); >- > private final Map<IWorkbenchPart,TCFNode> pins = new HashMap<IWorkbenchPart,TCFNode>(); > private final Map<IWorkbenchPart,TCFSnapshot> locks = new HashMap<IWorkbenchPart,TCFSnapshot>(); > private final Map<IWorkbenchPart,Integer> lock_policy = new HashMap<IWorkbenchPart,Integer>(); >@@ -914,7 +912,10 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab > action_results.remove(id); > Object o = context_map.remove(id); > if (o instanceof CreateNodeRunnable) ((CreateNodeRunnable)o).onContextRemoved(); >- expanded_nodes.remove(id); >+ for (TCFModelProxy proxy : model_proxies.values()) { >+ proxy.clearAutoExpandStack(id); >+ } >+ > if (mem_blocks_update != null) mem_blocks_update.changeset.remove(id); > } > >@@ -1529,14 +1530,14 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab > if (node.isDisposed()) return; > runSuspendTrigger(node); > if (reason == null) return; >- if (reason.equals(IRunControl.REASON_USER_REQUEST)) return; > for (TCFModelProxy proxy : model_proxies.values()) { > if (proxy.getPresentationContext().getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) { >+ if (proxy.getAutoExpandStack(node.id)) proxy.expand(node); >+ if (reason.equals(IRunControl.REASON_USER_REQUEST)) continue; > proxy.setSelection(node); > if (reason.equals(IRunControl.REASON_STEP)) continue; > if (reason.equals(IRunControl.REASON_CONTAINER)) continue; > if (delay_stack_update_until_last_step && launch.getContextActionsCount(node.id) != 0) continue; >- if (expanded_nodes.add(node.id)) proxy.expand(node); > } > if (reason.equals(IRunControl.REASON_BREAKPOINT)) { > IWorkbenchPart part = proxy.getPresentationContext().getPart(); >diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java >index c59f7d2..0900f4e 100644 >--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java >+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java >@@ -17,10 +17,10 @@ import java.util.HashSet; > import java.util.LinkedList; > import java.util.Map; > import java.util.Set; >+import java.util.TreeMap; > > import org.eclipse.core.runtime.IStatus; >-import org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer; >-import org.eclipse.debug.internal.ui.viewers.model.InternalVirtualTreeModelViewer; >+import org.eclipse.debug.internal.ui.viewers.model.IInternalTreeModelViewer; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate; > import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; >@@ -32,7 +32,10 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateList > import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; > import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; > import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.jface.viewers.ITreeViewerListener; >+import org.eclipse.jface.viewers.TreeExpansionEvent; > import org.eclipse.jface.viewers.TreePath; >+import org.eclipse.jface.viewers.TreeViewer; > import org.eclipse.swt.graphics.Device; > import org.eclipse.swt.widgets.Display; > import org.eclipse.tcf.internal.debug.model.TCFLaunch; >@@ -44,7 +47,7 @@ import org.eclipse.tcf.protocol.Protocol; > * Model proxy listeners are debuggers views. > */ > @SuppressWarnings("restriction") >-public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Runnable { >+public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Runnable, ITreeViewerListener { > > private static final TCFNode[] EMPTY_NODE_ARRAY = new TCFNode[0]; > >@@ -67,6 +70,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > private boolean enable_auto_expand; > private Set<TCFNode> auto_expand_removed_nodes; > private Set<TCFNode> auto_expand_created_nodes; >+ private Map<String, Boolean> auto_expand_user_nodes = new TreeMap<String, Boolean>(); > > private final Runnable timer = new Runnable() { > >@@ -200,8 +204,11 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > super.initialize(viewer); > enable_auto_expand = > IDebugUIConstants.ID_DEBUG_VIEW.equals(getPresentationContext().getId()) && >- viewer instanceof InternalTreeModelViewer; >+ viewer instanceof IInternalTreeModelViewer; > viewer.addViewerUpdateListener(update_listener); >+ if (viewer instanceof TreeViewer) { >+ ((TreeViewer)viewer).addTreeListener(this); >+ } > Protocol.invokeAndWait(new Runnable() { > public void run() { > assert !installed; >@@ -226,6 +233,9 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > } > }); > viewer.removeViewerUpdateListener(update_listener); >+ if (viewer instanceof TreeViewer) { >+ ((TreeViewer)viewer).removeTreeListener(this); >+ } > super.dispose(); > } > >@@ -281,6 +291,25 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > } > > /** >+ * Returns true if stack trace should be expanded upon a suspended event. >+ */ >+ boolean getAutoExpandStack(String id) { >+ Boolean expand = auto_expand_user_nodes.get(id); >+ if (expand == null) { >+ expand = Boolean.TRUE; >+ auto_expand_user_nodes.put(id, expand); >+ } >+ return expand; >+ } >+ >+ /** >+ * Returns true if stack trace should be expanded upon a suspended event. >+ */ >+ void clearAutoExpandStack(String id) { >+ auto_expand_user_nodes.remove(id) ; >+ } >+ >+ /** > * Get current value of the view input. > * @return view input object. > */ >@@ -438,8 +467,8 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > asyncExec(new Runnable() { > public void run() { > if (save_expand_state != null && save_expand_state.size() > 0) { >- if (viewer instanceof InternalTreeModelViewer) { >- InternalTreeModelViewer tree_viwer = (InternalTreeModelViewer)viewer; >+ if (viewer instanceof IInternalTreeModelViewer) { >+ IInternalTreeModelViewer tree_viwer = (IInternalTreeModelViewer)viewer; > final Set<String> expanded = new HashSet<String>(); > for (TCFNode node : save_expand_state) { > if (tree_viwer.getExpandedState(node)) expanded.add(node.id); >@@ -471,11 +500,8 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > asyncExec(new Runnable() { > boolean found; > public void run() { >- if (viewer instanceof InternalTreeModelViewer) { >- found = ((InternalTreeModelViewer)viewer).findElementIndex(TreePath.EMPTY, launch) >= 0; >- } >- else if (viewer instanceof InternalVirtualTreeModelViewer) { >- found = ((InternalVirtualTreeModelViewer)viewer).findElementIndex(TreePath.EMPTY, launch) >= 0; >+ if (viewer instanceof IInternalTreeModelViewer) { >+ found = ((IInternalTreeModelViewer)viewer).findElementIndex(TreePath.EMPTY, launch) >= 0; > } > Protocol.invokeLater(new Runnable() { > public void run() { >@@ -566,4 +592,30 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > launch.removePendingClient(this); > } > } >+ >+ @Override >+ public void treeCollapsed(TreeExpansionEvent event) { >+ updateExpandStack(event, false); >+ } >+ >+ @Override >+ public void treeExpanded(TreeExpansionEvent event) { >+ updateExpandStack(event, true); >+ } >+ >+ private void updateExpandStack(TreeExpansionEvent event, final boolean expand) { >+ if (event.getElement() instanceof TCFNodeExecContext) { >+ final TCFNodeExecContext node = (TCFNodeExecContext)event.getElement(); >+ if ( !model.equals(node.getModel()) ) return; >+ Protocol.invokeLater(new Runnable() { >+ @Override >+ public void run() { >+ Boolean hasStack = node.getStackTrace().checkHasChildren(this); >+ if (Boolean.TRUE.equals(hasStack)) { >+ auto_expand_user_nodes.put(node.id, expand); >+ } >+ } >+ }); >+ } >+ } > } >-- >1.7.5.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 389197
:
220917
|
220953
|
221006