Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJared Burns2004-10-16 20:30:25 +0000
committerJared Burns2004-10-16 20:30:25 +0000
commitb649a5165a7b73259bd5f3c4cc8caaecdc99a18e (patch)
tree652d5787a26bf83e2c9a84894e4da81c4a4704fb
parentb08080d9c1c27bfee88c9a3299dd7f087e5af118 (diff)
downloadeclipse.platform.debug-b649a5165a7b73259bd5f3c4cc8caaecdc99a18e.tar.gz
eclipse.platform.debug-b649a5165a7b73259bd5f3c4cc8caaecdc99a18e.tar.xz
eclipse.platform.debug-b649a5165a7b73259bd5f3c4cc8caaecdc99a18e.zip
Bug 75282 - Composite breakpoint groups
-rw-r--r--org.eclipse.debug.ui/icons/full/obj16/brkp_grp.gif (renamed from org.eclipse.debug.ui/icons/full/obj16/breakpoint_group.gif)bin361 -> 361 bytes
-rw-r--r--org.eclipse.debug.ui/icons/full/obj16/brkp_grp_disabled.gifbin0 -> 173 bytes
-rw-r--r--org.eclipse.debug.ui/plugin.properties28
-rw-r--r--org.eclipse.debug.ui/plugin.xml42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractSelectBreakpointsAction.java99
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByProjectAction.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByResourceAction.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByTypeAction.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFileContainerFactory.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointProjectContainerFactory.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java40
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java3
15 files changed, 89 insertions, 292 deletions
diff --git a/org.eclipse.debug.ui/icons/full/obj16/breakpoint_group.gif b/org.eclipse.debug.ui/icons/full/obj16/brkp_grp.gif
index 173661c5d..173661c5d 100644
--- a/org.eclipse.debug.ui/icons/full/obj16/breakpoint_group.gif
+++ b/org.eclipse.debug.ui/icons/full/obj16/brkp_grp.gif
Binary files differ
diff --git a/org.eclipse.debug.ui/icons/full/obj16/brkp_grp_disabled.gif b/org.eclipse.debug.ui/icons/full/obj16/brkp_grp_disabled.gif
new file mode 100644
index 000000000..5ea466bcb
--- /dev/null
+++ b/org.eclipse.debug.ui/icons/full/obj16/brkp_grp_disabled.gif
Binary files differ
diff --git a/org.eclipse.debug.ui/plugin.properties b/org.eclipse.debug.ui/plugin.properties
index 3ef5eb23e..fc4895035 100644
--- a/org.eclipse.debug.ui/plugin.properties
+++ b/org.eclipse.debug.ui/plugin.properties
@@ -271,21 +271,13 @@ rawHexMemoryRendering.name= Raw Hex Memory Rendering
ViewManagementAction.label=&View Management...
-setDefaultGroup.label=&Set Default Group...
-setDefaultGroup.tooltip=Set Default Breakpoint Group
-clearDefaultGroup.label=&Clear Default Group
-clearDefaultGroup.tooltip=Clear Default Breakpoint Group
-
-selectBy.label=&Select Similar By
-groupAllBy.label=Group All &By
-file.label=&File
-project.label=&Project
-breakpointType.label=&Breakpoint Type
-selectByType.label=Breakpoint &Type
-selectByFile.label=&File
-selectByProject.label=&Project
-addToGroup.label=&Add To Group
-removeFromGroup.label=&Remove From Group
-renameGroup.label=Re&name Group
-dissolveGroup.label=&Ungroup
-GroupBreakpointsByAction.label=Group By \ No newline at end of file
+setDefaultGroup.label=&Set Custom Group...
+setDefaultGroup.tooltip=Set Default Custom Breakpoint Group
+clearDefaultGroup.label=&Clear Custom Group
+clearDefaultGroup.tooltip=Clear Default Custom Breakpoint Group
+
+addToGroup.label=&Set Custom Group
+removeFromGroup.label=&Remove From Custom Group
+renameGroup.label=Re&name Custom Group
+dissolveGroup.label=&Remove Custom Group
+GroupBreakpointsByAction.label=&Group By \ No newline at end of file
diff --git a/org.eclipse.debug.ui/plugin.xml b/org.eclipse.debug.ui/plugin.xml
index f3b9cd6d3..18fd10c9f 100644
--- a/org.eclipse.debug.ui/plugin.xml
+++ b/org.eclipse.debug.ui/plugin.xml
@@ -1066,7 +1066,7 @@
label="%SelectAll.label"
helpContextId="select_all_breakpoints_action_context"
class="org.eclipse.debug.internal.ui.actions.SelectAllBreakpointsAction"
- menubarPath="selectGroup"
+ menubarPath="breakpointGroup"
id="org.eclipse.debug.ui.actions.SelectAllBreakpointsAction">
</action>
<action
@@ -1074,14 +1074,14 @@
icon="icons/full/elcl16/rem_all_co.gif"
helpContextId="remove_all_breakpoints_action_context"
class="org.eclipse.debug.internal.ui.actions.RemoveAllBreakpointsAction"
- menubarPath="removeGroup"
+ menubarPath="breakpointGroup"
id="org.eclipse.debug.ui.actions.RemoveAllBreakpoints">
</action>
<action
label="%GroupBreakpointsByAction.label"
style="pulldown"
class="org.eclipse.debug.internal.ui.actions.breakpointGroups.GroupBreakpointsByAction"
- menubarPath="additions"
+ menubarPath="breakpointGroupGroup"
enablesFor="*"
id="org.eclipse.debug.ui.actions.GroupBreakpointsByAction">
</action>
@@ -1095,34 +1095,14 @@
name="org.eclipse.debug.core.model.IBreakpoint">
</objectClass>
</visibility>
- <menu
- label="%selectBy.label"
- path="selectGroup"
- id="selectMenu">
- <separator
- name="additions">
- </separator>
- </menu>
<action
- label="%selectByType.label"
- helpContextId="select_breakpoints_by_type_action_context"
- class="org.eclipse.debug.internal.ui.actions.breakpointGroups.SelectBreakpointsByTypeAction"
- menubarPath="selectMenu/additions"
- id="org.eclipse.debug.ui.actions.SelectBreakpointsByType">
- </action>
- <action
- label="%selectByFile.label"
- helpContextId="select_breakpoints_by_file_action_context"
- class="org.eclipse.debug.internal.ui.actions.breakpointGroups.SelectBreakpointsByResourceAction"
- menubarPath="selectMenu/additions"
- id="org.eclipse.debug.ui.actions.SelectBreakpointsByFile">
- </action>
- <action
- label="%selectByProject.label"
- helpContextId="select_breakpoints_by_project_action_context"
- class="org.eclipse.debug.internal.ui.actions.breakpointGroups.SelectBreakpointsByProjectAction"
- menubarPath="selectMenu/additions"
- id="org.eclipse.debug.ui.actions.SelectBreakpointsByProject">
+ label="%RemoveAction.label"
+ icon="icons/full/elcl16/rem_co.gif"
+ helpContextId="remove_breakpoint_action_context"
+ class="org.eclipse.debug.internal.ui.actions.RemoveBreakpointAction"
+ menubarPath="breakpointGroup"
+ enabledFor="1+"
+ id="org.eclipse.debug.ui.breakpointsView.toolbar.remove">
</action>
<action
label="%DisableBreakpointsAction.label"
@@ -2172,6 +2152,6 @@ M4 = Platform-specific fourth key
<breakpointContainerFactory
class="org.eclipse.debug.internal.ui.views.breakpoints.BreakpointGroupContainerFactory"
id="org.eclipse.debug.ui.breakpointGroupContainerFactory"
- label="Group"/>
+ label="Custom Groups"/>
</extension>
</plugin> \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
index a848d91e4..d7181ec78 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPluginImages.java
@@ -150,7 +150,8 @@ public class DebugPluginImages {
declareRegistryImage(IDebugUIConstants.IMG_OBJS_REGISTER_GROUP, OBJECT + "genericreggroup_obj.gif"); //$NON-NLS-1$
declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT, OBJECT + "brkp_obj.gif"); //$NON-NLS-1$
declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_DISABLED, OBJECT + "brkpd_obj.gif"); //$NON-NLS-1$
- declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_GROUP, OBJECT + "breakpoint_group.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_GROUP, OBJECT + "brkp_grp.gif"); //$NON-NLS-1$
+ declareRegistryImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_GROUP_DISABLED, OBJECT + "brkp_grp_disabled.gif"); //$NON-NLS-1$
declareRegistryImage(IDebugUIConstants.IMG_OBJS_WATCHPOINT, OBJECT + "readwrite_obj.gif"); //$NON-NLS-1$
declareRegistryImage(IDebugUIConstants.IMG_OBJS_WATCHPOINT_DISABLED, OBJECT + "readwrite_obj_disabled.gif"); //$NON-NLS-1$
declareRegistryImage(IDebugUIConstants.IMG_OBJS_ACCESS_WATCHPOINT, OBJECT + "read_obj.gif"); //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractSelectBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractSelectBreakpointsAction.java
deleted file mode 100644
index ea427d2cd..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractSelectBreakpointsAction.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.debug.core.DebugPlugin;
-import org.eclipse.debug.core.model.IBreakpoint;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-
-/**
- * Abstract implementation of an action which selects some subset of breakpoints.
- */
-public abstract class AbstractSelectBreakpointsAction extends AbstractBreakpointsViewAction {
-
- /**
- * The currently selected breakpoints.
- */
- private IBreakpoint[] fBreakpoints= new IBreakpoint[0];
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
- */
- public void run(IAction action) {
- if (fBreakpoints.length < 1) {
- return;
- }
- List elementsToSelect= chooseSimilarBreakpoints();
- if (elementsToSelect.size() > 0) {
- IStructuredSelection selection= new StructuredSelection(elementsToSelect);
- fView.getViewer().setSelection(selection, true);
- }
- }
-
- /**
- * Returns whether or not the given breakpoints "match" based on some
- * subclass-specific criteria. This information is used to select
- * all breakpoints that match the selected breakpoint(s).
- *
- * @param breakpointOne a breakpoint
- * @param breakpointTwo another breakpoint
- * @return whether or not the given breakpoints match
- */
- public abstract boolean breakpointsMatch(IBreakpoint breakpointOne, IBreakpoint breakpointTwo);
-
- /**
- * Returns a list of breakpoints which match any of the currently selected
- * breakpoints.
- */
- public List chooseSimilarBreakpoints() {
- Set breakpointsToSelect= new HashSet();
- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints();
- for (int i = 0; i < breakpoints.length; i++) {
- IBreakpoint breakpoint = breakpoints[i];
- for (int j = 0; j < fBreakpoints.length; j++) {
- IBreakpoint selected = fBreakpoints[j];
- if (breakpointsMatch(breakpoint, selected)) {
- breakpointsToSelect.add(breakpoint);
- }
- }
- }
- return new ArrayList(breakpointsToSelect);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- List selectedBreakpoints= new ArrayList();
- Iterator iter = ((IStructuredSelection) selection).iterator();
- while (iter.hasNext()) {
- Object element = iter.next();
- if (element instanceof IBreakpoint) {
- selectedBreakpoints.add(element);
- } else {
- selectedBreakpoints.clear();
- break;
- }
- }
- fBreakpoints= (IBreakpoint[]) selectedBreakpoints.toArray(new IBreakpoint[0]);
- action.setEnabled(fBreakpoints.length > 0);
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties
index 46ce7bb30..5b848d129 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointGroupMessages.properties
@@ -9,13 +9,13 @@
# IBM Corporation - initial API and implementation
###############################################################################
SelectBreakpointGroupDialog.0=&Browse...
-SelectBreakpointGroupDialog.1=&Choose a group:
-SelectBreakpointGroupDialog.2=Breakpoint Groups
-AddBreakpointToGroupAction.0=Add To Group
-AddBreakpointToGroupAction.1=&Specify the name of the group:
-AddBreakpointToGroupAction.3=Error Adding To Group
-AddBreakpointToGroupAction.4=An exception occurred while attempting to add the breakpoint to the specified group.
-SetDefaultBreakpointGroupAction.1=Set Default Group
-SetDefaultBreakpointGroupAction.2=&Specify the group in which new breakpoints will be automatically placed:
-RenameBreakpointGroupAction.0=Rename Group
-RenameBreakpointGroupAction.1=&Specify the new name for the group:
+SelectBreakpointGroupDialog.1=&Choose a custom group:
+SelectBreakpointGroupDialog.2=Custom Breakpoint Groups
+AddBreakpointToGroupAction.0=Set Custom Group
+AddBreakpointToGroupAction.1=&Specify the name of the custom group:
+AddBreakpointToGroupAction.3=Error Adding To Custom Group
+AddBreakpointToGroupAction.4=An exception occurred while attempting to add the breakpoint to the specified custom group.
+SetDefaultBreakpointGroupAction.1=Set Default Custom Group
+SetDefaultBreakpointGroupAction.2=&Specify the custom group in which new breakpoints will be automatically placed:
+RenameBreakpointGroupAction.0=Rename CUstom Group
+RenameBreakpointGroupAction.1=&Specify the new name for the custom group:
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByProjectAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByProjectAction.java
deleted file mode 100644
index 2106ddc73..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByProjectAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- *
- */
-public class SelectBreakpointsByProjectAction extends AbstractSelectBreakpointsAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.breakpointGroups.AbstractSelectBreakpointsAction#breakpointsMatch(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.debug.core.model.IBreakpoint)
- */
- public boolean breakpointsMatch(IBreakpoint breakpointOne, IBreakpoint breakpointTwo) {
- IMarker marker= breakpointOne.getMarker();
- if (marker != null) {
- IProject projectOne = marker.getResource().getProject();
- if (projectOne != null) {
- marker= breakpointTwo.getMarker();
- if (marker != null) {
- IProject projectTwo = marker.getResource().getProject();
- if (projectTwo != null) {
- return projectOne.equals(projectTwo);
- }
- }
- }
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByResourceAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByResourceAction.java
deleted file mode 100644
index 32c338497..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByResourceAction.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- *
- */
-public class SelectBreakpointsByResourceAction extends AbstractSelectBreakpointsAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.breakpointGroups.AbstractSelectBreakpointsAction#breakpointsMatch(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.debug.core.model.IBreakpoint)
- */
- public boolean breakpointsMatch(IBreakpoint breakpointOne, IBreakpoint breakpointTwo) {
- IMarker markerOne = breakpointOne.getMarker();
- IMarker markerTwo = breakpointTwo.getMarker();
- if (markerOne != null && markerTwo != null) {
- return markerOne.getResource().equals(markerTwo.getResource());
- }
- return false;
- }
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByTypeAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByTypeAction.java
deleted file mode 100644
index d76c2da66..000000000
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointsByTypeAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.breakpointGroups;
-
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.model.IBreakpoint;
-
-/**
- *
- */
-public class SelectBreakpointsByTypeAction extends AbstractSelectBreakpointsAction {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.actions.breakpointGroups.AbstractSelectBreakpointsAction#breakpointsMatch(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.debug.core.model.IBreakpoint)
- */
- public boolean breakpointsMatch(IBreakpoint breakpointOne, IBreakpoint breakpointTwo) {
- IMarker markerOne = breakpointOne.getMarker();
- IMarker markerTwo = breakpointTwo.getMarker();
- if (markerOne != null && markerTwo != null) {
- try {
- return markerOne.getType().equals(markerTwo.getType());
- } catch (CoreException e1) {
- }
- }
- return false;
- }
-
-
-
-}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFileContainerFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFileContainerFactory.java
index d87894b55..13b499aaa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFileContainerFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFileContainerFactory.java
@@ -21,6 +21,9 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
@@ -29,6 +32,8 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
public class BreakpointFileContainerFactory extends AbstractBreakpointContainerFactory {
private ILabelProvider fImageProvider= new WorkbenchLabelProvider();
+ // Handle to the image for the "other" container. Maintained so it can be disposed.
+ private Image fOtherImage= null;
public BreakpointFileContainerFactory() {
}
@@ -96,6 +101,8 @@ public class BreakpointFileContainerFactory extends AbstractBreakpointContainerF
this,
"(no file)",
parentId);
+ fOtherImage= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
+ container.setImage(fOtherImage);
containers.add(container);
}
return (IBreakpointContainer[]) containers.toArray(new IBreakpointContainer[containers.size()]);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointProjectContainerFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointProjectContainerFactory.java
index bf7c500d2..4eb41ab3c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointProjectContainerFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointProjectContainerFactory.java
@@ -20,6 +20,9 @@ import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE.SharedImages;
import org.eclipse.ui.model.WorkbenchLabelProvider;
/**
@@ -28,6 +31,8 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
public class BreakpointProjectContainerFactory extends AbstractBreakpointContainerFactory {
private ILabelProvider fImageProvider= new WorkbenchLabelProvider();
+ // Handle to the image for the "other" container. Maintained so it can be disposed.
+ private Image fOtherImage= null;
public BreakpointProjectContainerFactory() {
}
@@ -76,6 +81,8 @@ public class BreakpointProjectContainerFactory extends AbstractBreakpointContain
this,
"(no project)",
parentId);
+ fOtherImage= PlatformUI.getWorkbench().getSharedImages().getImage(SharedImages.IMG_OBJ_PROJECT);
+ container.setImage(fOtherImage);
containers.add(container);
}
return (IBreakpointContainer[]) containers.toArray(new IBreakpointContainer[containers.size()]);
@@ -83,6 +90,9 @@ public class BreakpointProjectContainerFactory extends AbstractBreakpointContain
public void dispose() {
fImageProvider.dispose();
+ if (fOtherImage != null) {
+ fOtherImage.dispose();
+ }
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
index a34c635a7..fe0d94a72 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
@@ -42,6 +42,7 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTreeViewer;
import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -116,10 +117,27 @@ public class BreakpointsView extends AbstractDebugView implements ISelectionList
viewer.setLabelProvider(new DelegatingModelPresentation() {
public Image getImage(Object item) {
if (item instanceof IBreakpointContainer) {
+ Image image= DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_GROUP);
IBreakpointContainer container= (IBreakpointContainer) item;
- Image image = container.getContainerImage();
- if (image == null) {
- image= DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_GROUP);
+ Image containerImage = container.getContainerImage();
+ if (container instanceof BreakpointGroupContainer) {
+ // First, set to the "disabled group" image
+ containerImage= DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_BREAKPOINT_GROUP_DISABLED);
+ IBreakpoint[] breakpoints = container.getBreakpoints();
+ for (int i = 0; i < breakpoints.length; i++) {
+ try {
+ if (breakpoints[i].isEnabled()) {
+ // If any child breakpoints are enabled, reset to the
+ // default (enabled) image.
+ containerImage= image;
+ }
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
+ }
+ if (containerImage != null) {
+ image= containerImage;
}
return image;
}
@@ -333,8 +351,11 @@ public class BreakpointsView extends AbstractDebugView implements ISelectionList
ITreeContentProvider contentProvider= getTreeContentProvider();
try {
breakpoint.setEnabled(enable);
- updateParentsCheckedState(breakpoint, enable);
viewer.update(breakpoint, null);
+ // updateParents will also be called from the breakpointChanged callback,
+ // but we include it here so that the feedback is immediate when the user
+ // toggles a breakpoint within the view.
+ updateParents(breakpoint, enable);
} catch (CoreException e) {
String titleState= enable ? DebugUIViewsMessages.getString("BreakpointsView.6") : DebugUIViewsMessages.getString("BreakpointsView.7"); //$NON-NLS-1$ //$NON-NLS-2$
String messageState= enable ? DebugUIViewsMessages.getString("BreakpointsView.8") : DebugUIViewsMessages.getString("BreakpointsView.9"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -347,13 +368,13 @@ public class BreakpointsView extends AbstractDebugView implements ISelectionList
}
/**
- * Updates the checked state of the given object's container
+ * Updates the checked state and icon of the given object's container
* assuming that the child element has changed to the given
* enabled state.
* @param object
* @param enable
*/
- public void updateParentsCheckedState(Object object, boolean enable) {
+ public void updateParents(Object object, boolean enable) {
Object parent= getTreeContentProvider().getParent(object);
if (!(parent instanceof IBreakpointContainer)) {
return;
@@ -378,7 +399,8 @@ public class BreakpointsView extends AbstractDebugView implements ISelectionList
} catch (CoreException e) {
}
}
- updateParentsCheckedState(parent, enable);
+ viewer.update(container, new String[] { IBasicPropertyConstants.P_IMAGE });
+ updateParents(parent, enable);
}
/**
@@ -402,6 +424,10 @@ public class BreakpointsView extends AbstractDebugView implements ISelectionList
DebugUIPlugin.log(e);
}
}
+ // updateParents will also be called from the breakpointChanged callback,
+ // but we include it here so that the feedback is immediate when the user
+ // toggles a breakpoint within the view.
+ updateParents(container, enable);
if (!DebugPlugin.getDefault().getBreakpointManager().isEnabled()) {
viewer.setGrayed(container, true);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java
index a11126361..9820a35b0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewEventHandler.java
@@ -96,7 +96,7 @@ public class BreakpointsViewEventHandler implements IBreakpointsListener, IActiv
if (viewer.getChecked(breakpoint) != enabled) {
viewer.setChecked(breakpoint, breakpoint.isEnabled());
}
- fView.updateParentsCheckedState(breakpoint, enabled);
+ fView.updateParents(breakpoint, enabled);
if (!DebugPlugin.getDefault().getBreakpointManager().isEnabled()) {
fView.updateViewerBackground();
@@ -167,25 +167,16 @@ public class BreakpointsViewEventHandler implements IBreakpointsListener, IActiv
try {
boolean enabled= breakpoint.isEnabled();
if (viewer.getChecked(breakpoint) != enabled) {
- String group= breakpoint.getGroup();
- if (group != null) {
- groupsToUpdate.add(group);
- }
viewer.setChecked(breakpoint, breakpoint.isEnabled());
- viewer.update(breakpoint, null);
+ viewer.update(breakpoint, null);
}
+ fView.updateParents(breakpoint, enabled);
} catch (CoreException e) {
DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), DebugUIViewsMessages.getString("BreakpointsViewEventHandler.1"), DebugUIViewsMessages.getString("BreakpointsViewEventHandler.2"), e); //$NON-NLS-1$ //$NON-NLS-2$
DebugUIPlugin.log(e);
}
}
}
- // Update the checked/grayed state of groups whose children changed
- Iterator iter= groupsToUpdate.iterator();
- while (iter.hasNext()) {
- String group = (String) iter.next();
- fView.updateGroupCheckedState(group);
- }
fView.updateObjects();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
index adf2d528d..118096257 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
@@ -405,6 +405,9 @@ public interface IDebugUIConstants {
/** Breakpoint group image identifier. */
public static final String IMG_OBJS_BREAKPOINT_GROUP = "IMG_OBJS_BREAKPOINT_GROUP"; //$NON-NLS-1$
+
+ /** Disabled breakpoint group image identifier. */
+ public static final String IMG_OBJS_BREAKPOINT_GROUP_DISABLED = "IMG_OBJS_BREAKPOINT_GROUP_DISABLED"; //$NON-NLS-1$
/**
* Enabled watchpoint image identifier (access & modification).

Back to the top