Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 321968

Summary: [search] provide ability to add breakpoints from a (string) search view
Product: [Eclipse Project] JDT Reporter: Ankur Sharma <ankur_sharma>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, darin.eclipse, deepakazad, markus.kell.r
Version: 3.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Ankur Sharma CLA 2010-08-06 07:01:37 EDT
1. Use Search -> File... to do a search.
2. The results that are located in .java files, right click to see context menu

It will be very helpful to b able to set breakpoints from the search results.

Use Case:
I often have to do searches on strings like "setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS,"

That is where all a particular attribute is set. AFAIK it can not be get from java search. If so, please enlighten me and close this request:)
Comment 1 Dani Megert CLA 2010-08-06 07:09:22 EDT
Darin, is there API in Debug Core or UI that would allow us to do this in JDT UI?
Comment 2 Darin Wright CLA 2010-08-06 08:32:50 EDT
There a factory methods to create breakpoints in JDIDebugModel, for example:

org.eclipse.jdt.debug.core.JDIDebugModel.createLineBreakpoint(IResource, String, int, int, int, int, boolean, Map)
Comment 3 Dani Megert CLA 2010-08-06 08:36:43 EDT
OK, so we would have to add a new dependency on JDT Debug Core but that's not an issue since we already indirectly require it via JDT Launching.
Comment 4 Markus Keller CLA 2010-08-08 12:16:01 EDT
I think JDT/UI is not the right place for this. o.e.search should make LineElement API (or an interface with enough information).

Then, o.e.jdt.debug.ui can add an object contribution for "Toggle Line Breakpoint" (like it already does e.g. for "Toggle Method Breakpoint" on IMethods). A problem is that the file search result page is language-agnostic, so Debug should either add this in a language-agnostic way too, or it should make sure that the action only appears in *.java files.

Moving to JDT/Debug. Please file a bug for Platform/Search if you intend to work on this and need the suggested API.