Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-11-16 14:09:30 -0500
committerPawel Piech2012-11-19 16:43:04 -0500
commit26d23ea2a3d093a4551658ec79aeb36a9c70ac6e (patch)
treea0f2ee126d19b4f5d40f8baef5542d9a60b5cab3
parente3b321d2e60eab67c275c9e3bc0f083ff2092a3e (diff)
downloadorg.eclipse.tcf-26d23ea2a3d093a4551658ec79aeb36a9c70ac6e.tar.gz
org.eclipse.tcf-26d23ea2a3d093a4551658ec79aeb36a9c70ac6e.tar.xz
org.eclipse.tcf-26d23ea2a3d093a4551658ec79aeb36a9c70ac6e.zip
Bug 394494 - [breakpoins] Breakpoint scope page should filter out contexts that cannot have breakpoints (i.e. no BPGroup)
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java26
1 files changed, 23 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
index edd55c230..ba99d375a 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFThreadFilterEditor.java
@@ -49,11 +49,11 @@ import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.tcf.internal.cdt.ui.Activator;
@@ -81,6 +81,7 @@ public class TCFThreadFilterEditor {
private final boolean fIsContainer;
private final String fScopeId;
private final String fSessionId;
+ private final String fBpGroup;
Context(IRunControl.RunControlContext ctx, Context parent) {
this(ctx, parent.fSessionId);
@@ -93,6 +94,7 @@ public class TCFThreadFilterEditor {
fId = ctx.getID();
fParentId = ctx.getParentID();
fIsContainer = ctx.isContainer();
+ fBpGroup = ctx.getBPGroup();
}
}
@@ -182,10 +184,12 @@ public class TCFThreadFilterEditor {
public Object[] getChildren(Object parent) {
if (parent instanceof Context) {
- return syncGetThreads((Context) parent);
+ Context[] children = syncGetThreads((Context) parent);
+ return filterBPGroupContexts(children);
}
if (parent instanceof ILaunch) {
- return syncGetContainers((TCFLaunch) parent);
+ Context[] children = syncGetContainers((TCFLaunch) parent);
+ return filterBPGroupContexts(children);
}
if (parent instanceof ILaunchManager) {
return getLaunches();
@@ -193,6 +197,22 @@ public class TCFThreadFilterEditor {
return new Object[0];
}
+ private Context[] filterBPGroupContexts(Context[] children) {
+ List<Context> filteredChildren = new ArrayList<Context>(children.length);
+ for (Context child : children) {
+ if (child.fBpGroup != null ||
+ getChildren(child).length != 0)
+ {
+ filteredChildren.add(child);
+ }
+ }
+ if (filteredChildren.size() == children.length) {
+ return children;
+ } else {
+ return filteredChildren.toArray(new Context[filteredChildren.size()]);
+ }
+ }
+
public Object getParent(Object element) {
if (element instanceof Context) {
Context ctx = (Context) element;

Back to the top