Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2010-02-25 17:52:18 +0000
committerDarin Wright2010-02-25 17:52:18 +0000
commiteec7676fe87baa0622bcb4abc9bb93fd55dd6331 (patch)
treeddc8132e2df361e872c50f7fd674ee9d5dc4e157 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model
parentcbcecded1ee69948e9068393ca411af9fe51a925 (diff)
downloadeclipse.platform.debug-eec7676fe87baa0622bcb4abc9bb93fd55dd6331.tar.gz
eclipse.platform.debug-eec7676fe87baa0622bcb4abc9bb93fd55dd6331.tar.xz
eclipse.platform.debug-eec7676fe87baa0622bcb4abc9bb93fd55dd6331.zip
Bug 303938 - breakpoints view is filtereing when no filtering in effect
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java215
1 files changed, 107 insertions, 108 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
index 23cb0ad6e..6949b8a9c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
@@ -1,108 +1,107 @@
-/*****************************************************************
- * Copyright (c) 2009 Texas Instruments and others
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956)
- *****************************************************************/
-package org.eclipse.debug.internal.ui.model.elements;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.debug.core.model.IDebugElement;
-import org.eclipse.debug.core.model.IDebugTarget;
-import org.eclipse.debug.core.model.IProcess;
-import org.eclipse.debug.internal.ui.elements.adapters.AbstractBreakpointManagerInput;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Breakpoint manager content provider.
- *
- * @since 3.6
- */
-public class BreakpointManagerContentProvider extends AbstractBreakpointManagerContentProvider {
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.AbstractBreakpointManagerContentProvider#supportsBreakpoint(org.eclipse.jface.viewers.IStructuredSelection, org.eclipse.debug.core.model.IBreakpoint)
- */
- protected boolean supportsBreakpoint(IStructuredSelection ss, IBreakpoint breakpoint) {
- return supportsBreakpoint(getDebugTargets(ss), breakpoint);
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.model.elements.AbstractBreakpointManagerContentProvider#filterBreakpointsByInput(org.eclipse.debug.internal.ui.elements.adapters.AbstractBreakpointManagerInput, org.eclipse.debug.core.model.IBreakpoint[])
- */
- protected IBreakpoint[] filterBreakpoints(AbstractBreakpointManagerInput input, IBreakpoint[] breakpoints) {
- ArrayList retVal = new ArrayList();
-
- IStructuredSelection selectionFilter = getSelectionFilter(input);
- List targets = getDebugTargets(selectionFilter);
-
- if (targets != null) {
- for (int i = 0; i < breakpoints.length; ++i) {
- if (supportsBreakpoint(targets, breakpoints[i]))
- retVal.add(breakpoints[i]);
- }
- } else {
- return breakpoints;
- }
-
- return (IBreakpoint[]) retVal.toArray(new IBreakpoint[retVal.size()]);
- }
-
- /**
- * Returns true if the breakpoint contains in one of the targets.
- *
- * @param targets a list of <code>IDebugTarget</code> objects.
- * @param breakpoint the breakpoint.
- * @return true if breakpoint contains in the list of targets.
- */
- protected boolean supportsBreakpoint(List targets, IBreakpoint breakpoint) {
- boolean exist = targets.size() == 0 ? true : false;
- for (int i = 0; !exist && i < targets.size(); ++i) {
- IDebugTarget target = (IDebugTarget) targets.get(i);
- exist |= target.supportsBreakpoint(breakpoint);
- }
- return exist;
- }
-
- /**
- * Returns the list of IDebugTarget for the selection.
- *
- * @param ss the selection.
- * @return list of IDebugTarget object.
- */
- protected List getDebugTargets(IStructuredSelection ss) {
- List debugTargets = new ArrayList(2);
- if (ss != null) {
- Iterator i = ss.iterator();
- while (i.hasNext()) {
- Object next = i.next();
- if (next instanceof IDebugElement) {
- debugTargets.add(((IDebugElement)next).getDebugTarget());
- } else if (next instanceof ILaunch) {
- IDebugTarget[] targets = ((ILaunch)next).getDebugTargets();
- for (int j = 0; j < targets.length; j++) {
- debugTargets.add(targets[j]);
- }
- } else if (next instanceof IProcess) {
- IDebugTarget target = (IDebugTarget)((IProcess)next).getAdapter(IDebugTarget.class);
- if (target != null) {
- debugTargets.add(target);
- }
- }
- }
- }
- return debugTargets;
- }
-
-
-}
+/*****************************************************************
+ * Copyright (c) 2009 Texas Instruments and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956)
+ *****************************************************************/
+package org.eclipse.debug.internal.ui.model.elements;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.debug.core.model.IBreakpoint;
+import org.eclipse.debug.core.model.IDebugElement;
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.internal.ui.elements.adapters.AbstractBreakpointManagerInput;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+/**
+ * Breakpoint manager content provider.
+ *
+ * @since 3.6
+ */
+public class BreakpointManagerContentProvider extends AbstractBreakpointManagerContentProvider {
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.model.elements.AbstractBreakpointManagerContentProvider#supportsBreakpoint(org.eclipse.jface.viewers.IStructuredSelection, org.eclipse.debug.core.model.IBreakpoint)
+ */
+ protected boolean supportsBreakpoint(IStructuredSelection ss, IBreakpoint breakpoint) {
+ return supportsBreakpoint(getDebugTargets(ss), breakpoint);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.model.elements.AbstractBreakpointManagerContentProvider#filterBreakpointsByInput(org.eclipse.debug.internal.ui.elements.adapters.AbstractBreakpointManagerInput, org.eclipse.debug.core.model.IBreakpoint[])
+ */
+ protected IBreakpoint[] filterBreakpoints(AbstractBreakpointManagerInput input, IBreakpoint[] breakpoints) {
+ IStructuredSelection selectionFilter = getSelectionFilter(input);
+ if (selectionFilter != null && !selectionFilter.isEmpty()) {
+ List targets = getDebugTargets(selectionFilter);
+ ArrayList retVal = new ArrayList();
+ if (targets != null) {
+ for (int i = 0; i < breakpoints.length; ++i) {
+ if (supportsBreakpoint(targets, breakpoints[i]))
+ retVal.add(breakpoints[i]);
+ }
+ }
+ return (IBreakpoint[]) retVal.toArray(new IBreakpoint[retVal.size()]);
+ } else {
+ return breakpoints;
+ }
+ }
+
+ /**
+ * Returns true if the breakpoint contains in one of the targets.
+ *
+ * @param targets a list of <code>IDebugTarget</code> objects.
+ * @param breakpoint the breakpoint.
+ * @return true if breakpoint contains in the list of targets.
+ */
+ protected boolean supportsBreakpoint(List targets, IBreakpoint breakpoint) {
+ boolean exist = targets.size() == 0 ? true : false;
+ for (int i = 0; !exist && i < targets.size(); ++i) {
+ IDebugTarget target = (IDebugTarget) targets.get(i);
+ exist |= target.supportsBreakpoint(breakpoint);
+ }
+ return exist;
+ }
+
+ /**
+ * Returns the list of IDebugTarget for the selection.
+ *
+ * @param ss the selection.
+ * @return list of IDebugTarget object.
+ */
+ protected List getDebugTargets(IStructuredSelection ss) {
+ List debugTargets = new ArrayList(2);
+ if (ss != null) {
+ Iterator i = ss.iterator();
+ while (i.hasNext()) {
+ Object next = i.next();
+ if (next instanceof IDebugElement) {
+ debugTargets.add(((IDebugElement)next).getDebugTarget());
+ } else if (next instanceof ILaunch) {
+ IDebugTarget[] targets = ((ILaunch)next).getDebugTargets();
+ for (int j = 0; j < targets.length; j++) {
+ debugTargets.add(targets[j]);
+ }
+ } else if (next instanceof IProcess) {
+ IDebugTarget target = (IDebugTarget)((IProcess)next).getAdapter(IDebugTarget.class);
+ if (target != null) {
+ debugTargets.add(target);
+ }
+ }
+ }
+ }
+ return debugTargets;
+ }
+
+
+}

Back to the top