### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.debug.ui Index: ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java,v retrieving revision 1.9 diff -u -r1.9 JavaBreakpointConditionEditor.java --- ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java 3 May 2010 19:55:35 -0000 1.9 +++ ui/org/eclipse/jdt/debug/ui/breakpoints/JavaBreakpointConditionEditor.java 18 Nov 2010 21:23:57 -0000 @@ -160,71 +160,85 @@ * @exception CoreException if unable to access breakpoint attributes */ private void setBreakpoint(IJavaLineBreakpoint breakpoint) throws CoreException { - fBreakpoint = breakpoint; - if (fDocumentListener != null) { - fViewer.getDocument().removeDocumentListener(fDocumentListener); - fDocumentListener = null; - } - fViewer.unconfigure(); - IDocument document = new Document(); - JDIDebugUIPlugin.getDefault().getJavaTextTools().setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING); - fViewer.setInput(document); - String condition = null; - IType type = null; boolean controlsEnabled = false; boolean conditionEnabled = false; boolean whenTrue = true; + String condition = null; if (breakpoint != null) { controlsEnabled = true; if (breakpoint.supportsCondition()) { condition = breakpoint.getCondition(); conditionEnabled = breakpoint.isConditionEnabled(); whenTrue = breakpoint.isConditionSuspendOnTrue(); - type = BreakpointUtils.getType(breakpoint); } } - IJavaDebugContentAssistContext context = null; - if (type == null || breakpoint == null) { - context = new TypeContext(null, -1); + if (breakpoint == fBreakpoint) { + if (breakpoint != null) { + // update controls rather than destroying everything + IDocument document = fViewer.getDocument(); + if (!document.get().equals(condition)) { + document.set(condition == null ? "" : condition); //$NON-NLS-1$ + } + } } else { - String source = null; - ICompilationUnit compilationUnit = type.getCompilationUnit(); - if (compilationUnit != null && compilationUnit.getJavaProject().getProject().exists()) { - source = compilationUnit.getSource(); - } - else { - IClassFile classFile = type.getClassFile(); - if (classFile != null) { - source = classFile.getSource(); + fBreakpoint = breakpoint; + if (fDocumentListener != null) { + fViewer.getDocument().removeDocumentListener(fDocumentListener); + fDocumentListener = null; + } + fViewer.unconfigure(); + IDocument document = new Document(); + JDIDebugUIPlugin.getDefault().getJavaTextTools().setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING); + fViewer.setInput(document); + IType type = null; + if (breakpoint != null) { + if (breakpoint.supportsCondition()) { + type = BreakpointUtils.getType(breakpoint); } } - int lineNumber = breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1); - int position= -1; - if (source != null && lineNumber != -1) { - try { - position = new Document(source).getLineOffset(lineNumber - 1); + IJavaDebugContentAssistContext context = null; + if (type == null || breakpoint == null) { + context = new TypeContext(null, -1); + } else { + String source = null; + ICompilationUnit compilationUnit = type.getCompilationUnit(); + if (compilationUnit != null && compilationUnit.getJavaProject().getProject().exists()) { + source = compilationUnit.getSource(); } - catch (BadLocationException e) {JDIDebugUIPlugin.log(e);} + else { + IClassFile classFile = type.getClassFile(); + if (classFile != null) { + source = classFile.getSource(); + } + } + int lineNumber = breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1); + int position= -1; + if (source != null && lineNumber != -1) { + try { + position = new Document(source).getLineOffset(lineNumber - 1); + } + catch (BadLocationException e) {JDIDebugUIPlugin.log(e);} + } + context = new TypeContext(type, position); } - context = new TypeContext(type, position); + fCompletionProcessor = new JavaDebugContentAssistProcessor(context); + fViewer.configure(new DisplayViewerConfiguration() { + public IContentAssistProcessor getContentAssistantProcessor() { + return fCompletionProcessor; + } + }); + document.set((condition == null ? "" : condition)); //$NON-NLS-1$ + fViewer.setUndoManager(new TextViewerUndoManager(10)); + fViewer.getUndoManager().connect(fViewer); + fDocumentListener = new IDocumentListener() { + public void documentAboutToBeChanged(DocumentEvent event) { + } + public void documentChanged(DocumentEvent event) { + setDirty(PROP_CONDITION); + } + }; + fViewer.getDocument().addDocumentListener(fDocumentListener); } - fCompletionProcessor = new JavaDebugContentAssistProcessor(context); - fViewer.configure(new DisplayViewerConfiguration() { - public IContentAssistProcessor getContentAssistantProcessor() { - return fCompletionProcessor; - } - }); - document.set((condition == null ? "" : condition)); //$NON-NLS-1$ - fViewer.setUndoManager(new TextViewerUndoManager(10)); - fViewer.getUndoManager().connect(fViewer); - fDocumentListener = new IDocumentListener() { - public void documentAboutToBeChanged(DocumentEvent event) { - } - public void documentChanged(DocumentEvent event) { - setDirty(PROP_CONDITION); - } - }; - fViewer.getDocument().addDocumentListener(fDocumentListener); fConditional.setEnabled(controlsEnabled); fConditional.setSelection(conditionEnabled); fWhenTrue.setSelection(whenTrue); Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java,v retrieving revision 1.1 diff -u -r1.1 ExceptionBreakpointDetailPane.java --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java 21 Dec 2009 19:09:18 -0000 1.1 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/ExceptionBreakpointDetailPane.java 18 Nov 2010 21:23:57 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2010 IBM Corporation 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 @@ -29,6 +29,7 @@ super(BreakpointMessages.ExceptionBreakpointDetailPane_0, BreakpointMessages.ExceptionBreakpointDetailPane_0, DETAIL_PANE_EXCEPTION_BREAKPOINT); addAutosaveProperties(new int[]{ StandardJavaBreakpointEditor.PROP_HIT_COUNT_ENABLED, + StandardJavaBreakpointEditor.PROP_HIT_COUNT, StandardJavaBreakpointEditor.PROP_SUSPEND_POLICY, ExceptionBreakpointEditor.PROP_CAUGHT, ExceptionBreakpointEditor.PROP_UNCAUGHT, Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java,v retrieving revision 1.1 diff -u -r1.1 LineBreakpointDetailPane.java --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java 5 Feb 2010 22:23:42 -0000 1.1 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/LineBreakpointDetailPane.java 18 Nov 2010 21:23:57 -0000 @@ -31,7 +31,9 @@ addAutosaveProperties(new int[]{ JavaBreakpointConditionEditor.PROP_CONDITION_ENABLED, JavaBreakpointConditionEditor.PROP_CONDITION_SUSPEND_POLICY, + JavaBreakpointConditionEditor.PROP_CONDITION, StandardJavaBreakpointEditor.PROP_HIT_COUNT_ENABLED, + StandardJavaBreakpointEditor.PROP_HIT_COUNT, StandardJavaBreakpointEditor.PROP_SUSPEND_POLICY}); } Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java,v retrieving revision 1.3 diff -u -r1.3 MethodBreakpointDetailPane.java --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java 5 Feb 2010 22:23:42 -0000 1.3 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/MethodBreakpointDetailPane.java 18 Nov 2010 21:23:57 -0000 @@ -30,10 +30,12 @@ super(BreakpointMessages.StandardBreakpointDetailPane_0, BreakpointMessages.StandardBreakpointDetailPane_0, DETAIL_PANE_METHOD_BREAKPOINT); addAutosaveProperties(new int[]{ StandardJavaBreakpointEditor.PROP_HIT_COUNT_ENABLED, + StandardJavaBreakpointEditor.PROP_HIT_COUNT, StandardJavaBreakpointEditor.PROP_SUSPEND_POLICY, MethodBreakpointEditor.PROP_ENTRY, MethodBreakpointEditor.PROP_EXIT, JavaBreakpointConditionEditor.PROP_CONDITION_ENABLED, + JavaBreakpointConditionEditor.PROP_CONDITION, JavaBreakpointConditionEditor.PROP_CONDITION_SUSPEND_POLICY }); } Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java,v retrieving revision 1.1 diff -u -r1.1 StandardBreakpointDetailPane.java --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java 21 Dec 2009 19:09:18 -0000 1.1 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardBreakpointDetailPane.java 18 Nov 2010 21:23:57 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2010 IBM Corporation 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 @@ -29,6 +29,7 @@ super(BreakpointMessages.StandardBreakpointDetailPane_0, BreakpointMessages.StandardBreakpointDetailPane_0, DETAIL_PANE_STANDARD); addAutosaveProperties(new int[]{ StandardJavaBreakpointEditor.PROP_HIT_COUNT_ENABLED, + StandardJavaBreakpointEditor.PROP_HIT_COUNT, StandardJavaBreakpointEditor.PROP_SUSPEND_POLICY}); } Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java,v retrieving revision 1.10 diff -u -r1.10 StandardJavaBreakpointEditor.java --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java 24 Mar 2010 14:57:51 -0000 1.10 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/StandardJavaBreakpointEditor.java 18 Nov 2010 21:23:57 -0000 @@ -156,7 +156,10 @@ fHitCountButton.setEnabled(enabled); fHitCountButton.setSelection(enabled & hasHitCount); fHitCountText.setEnabled(hasHitCount); - fHitCountText.setText(text); + if (!text.equals(fHitCountText.getText())) { + // avoid changing cursor position if text has not changed + fHitCountText.setText(text); + } fSuspendThread.setEnabled(enabled); fSuspendVM.setEnabled(enabled); fSuspendThread.setSelection(suspendThread); Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java,v retrieving revision 1.1 diff -u -r1.1 WatchpointDetailPane.java --- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java 21 Dec 2009 19:09:17 -0000 1.1 +++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/WatchpointDetailPane.java 18 Nov 2010 21:23:57 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 IBM Corporation and others. + * Copyright (c) 2009, 2010 IBM Corporation 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 @@ -29,6 +29,7 @@ super(BreakpointMessages.WatchpointDetailPane_0, BreakpointMessages.WatchpointDetailPane_0, DETAIL_PANE_WATCHPOINT); addAutosaveProperties(new int[]{ StandardJavaBreakpointEditor.PROP_HIT_COUNT_ENABLED, + StandardJavaBreakpointEditor.PROP_HIT_COUNT, StandardJavaBreakpointEditor.PROP_SUSPEND_POLICY, WatchpointEditor.PROP_ACCESS, WatchpointEditor.PROP_MODIFICATION