Community
Participate
Working Groups
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:)
Darin, is there API in Debug Core or UI that would allow us to do this in JDT UI?
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)
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.
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.