Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 183488 Details for
Bug 308078
[breakpoints] Breakpoint detail pane condition not applied until focus is changed from condition text box
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch
edit-condition-2.patch (text/plain), 17.58 KB, created by
Darin Wright
on 2010-11-19 12:39:10 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2010-11-19 12:39:10 EST
Size:
17.58 KB
patch
obsolete
>### 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 19 Nov 2010 17:37:56 -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); >@@ -339,7 +353,7 @@ > */ > public void doSave() throws CoreException { > if (fBreakpoint != null && isDirty()) { >- fBreakpoint.setCondition(fViewer.getDocument().get().trim()); >+ fBreakpoint.setCondition(fViewer.getDocument().get()); > fBreakpoint.setConditionEnabled(fConditional.getSelection()); > fBreakpoint.setConditionSuspendOnTrue(fWhenTrue.getSelection()); > setDirty(false); >Index: ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AbstractDetailPane.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.debug.ui/ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AbstractDetailPane.java,v >retrieving revision 1.6 >diff -u -r1.6 AbstractDetailPane.java >--- ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AbstractDetailPane.java 19 Feb 2010 16:18:05 -0000 1.6 >+++ ui/org/eclipse/jdt/internal/debug/ui/breakpoints/AbstractDetailPane.java 19 Nov 2010 17:37:56 -0000 >@@ -15,7 +15,10 @@ > > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.ListenerList; >+import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.jobs.Job; > import org.eclipse.debug.internal.ui.SWTFactory; > import org.eclipse.debug.ui.IDetailPane3; > import org.eclipse.jdt.internal.debug.ui.JDIDebugUIPlugin; >@@ -36,6 +39,7 @@ > import org.eclipse.ui.IWorkbenchPartConstants; > import org.eclipse.ui.IWorkbenchPartSite; > import org.eclipse.ui.part.EditorActionBarContributor; >+import org.eclipse.ui.progress.WorkbenchJob; > > /** > * Common detail pane function. >@@ -48,8 +52,10 @@ > private String fDescription; > private String fId; > private AbstractJavaBreakpointEditor fEditor; >+ private Control fControl; > private Set fAutoSaveProperties = new HashSet(); > private IWorkbenchPartSite fSite; >+ private Job fSaveJob; > > // property listeners > private ListenerList fListeners = new ListenerList(); >@@ -124,6 +130,7 @@ > * @see org.eclipse.debug.ui.IDetailPane#dispose() > */ > public void dispose() { >+ fControl = null; > fEditor = null; > fSite = null; > fListeners.clear(); >@@ -153,16 +160,74 @@ > fEditor.addPropertyListener(new IPropertyListener() { > public void propertyChanged(Object source, int propId) { > if (fAutoSaveProperties.contains(new Integer(propId))) { >+ scheduleSaveJob(); >+ } else { >+ firePropertyChange(IWorkbenchPartConstants.PROP_DIRTY); >+ } >+ } >+ }); >+ fControl = fEditor.createControl(fEditorParent); >+ return fControl; >+ } >+ >+ /** >+ * Schedules the save job to run for this detail pane based on this pane's delay. >+ * >+ * @since 3.7 >+ */ >+ protected void scheduleSaveJob() { >+ Job job = getSaveJob(); >+ job.cancel(); // cancel existing job >+ job.schedule(getSaveDelay()); >+ } >+ >+ /** >+ * Returns the job to save the detail pane >+ * >+ * @return update job >+ * @since 3.7 >+ */ >+ private Job getSaveJob() { >+ if (fSaveJob == null) { >+ fSaveJob = createSaveJob(); >+ fSaveJob.setSystem(true); >+ } >+ return fSaveJob; >+ } >+ >+ /** >+ * Creates and returns a job used to save this detail pane. >+ * Subclasses may override. >+ * >+ * @return job to save this detail pane >+ * @since 3.7 >+ */ >+ protected Job createSaveJob() { >+ return new WorkbenchJob(fControl.getDisplay(), "Save Java Breakpoint Details") { //$NON-NLS-1$ >+ public IStatus runInUIThread(IProgressMonitor monitor) { >+ if (fControl != null && !fControl.isDisposed()) { > try { > fEditor.doSave(); >- return; > } catch (CoreException e) { > } > } >- firePropertyChange(IWorkbenchPartConstants.PROP_DIRTY); >+ return Status.OK_STATUS; > } >- }); >- return fEditor.createControl(fEditorParent); >+ public boolean shouldRun() { >+ return fControl != null && !fControl.isDisposed(); >+ } >+ }; >+ } >+ >+ /** >+ * Return the time delay that should be used when scheduling the >+ * save job. Subclasses may override. >+ * >+ * @return a time delay in milliseconds before the job should run >+ * @since 3.7 >+ */ >+ protected long getSaveDelay() { >+ return 200; > } > > /** >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 19 Nov 2010 17:37:56 -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 19 Nov 2010 17:37:56 -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 19 Nov 2010 17:37:56 -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 19 Nov 2010 17:37:56 -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 19 Nov 2010 17:37:56 -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 19 Nov 2010 17:37:56 -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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 308078
:
183432
| 183488