Bug 44986 - Support for Breakpoint groups
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AddBreakpointToGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AddBreakpointToGroupAction.java
index c4d5a42..3159c23 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AddBreakpointToGroupAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AddBreakpointToGroupAction.java
@@ -42,6 +42,8 @@
 	private Object[] fBreakpoints= null;
 	private BreakpointsView fView= null;
 	
+	private static String fgLastValue= null;
+	
 	/**
 	 * A dialog that sets the focus to the text area.
 	 */
@@ -75,7 +77,11 @@
 			return area;
 		}
 		protected void okPressed() {
-		    fView.setAutoGroup(getValue());
+		    String value= getValue();
+		    if (fAutoAddToGroup.getSelection()) {
+		        fView.setAutoGroup(value);
+		    }
+		    fgLastValue= value;
 			super.okPressed();
 		}
 	}
@@ -85,6 +91,9 @@
 	 */
 	public void run(IAction action) {
 		String initialValue= fView.getAutoGroup();
+		if (initialValue == null) {
+		    initialValue= fgLastValue;
+		}
 		BreakpointGroupDialog dialog = new BreakpointGroupDialog(null, "Add To Group", "Specify the name of the group", initialValue, null);
 		int dialogResult = dialog.open();
 		if (dialogResult == Window.OK) {
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 b12326d..4b95747 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
@@ -74,7 +74,7 @@
 	// Persistance constants
 	private static String KEY_IS_TRACKING_SELECTION= "isTrackingSelection"; //$NON-NLS-1$
 	private static String KEY_VALUE="value"; //$NON-NLS-1$
-	private String fAutoGroup;
+	private String fAutoGroup= null;
 	
 	/**
 	 * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
@@ -193,9 +193,9 @@
 	
 	/**
 	 * Returns the group that new breakpoints will be automatically
-	 * added to.
+	 * added to or <code>null</code> if none.
 	 * @return the group that new breakpoints will be automatically
-	 *  added to
+	 *  added to or <code>null</code> if none
 	 */
 	public String getAutoGroup() {
 		return fAutoGroup;