Community
Participate
Working Groups
Build 20020423 - new workspace - new java project Test - new class Test, with main - right click in ruler on line for main and add breakpoint - right click on breakpoint - it has: Remove Breakpoint (correct) Enable Breakpoint (wrong) Breakpoint Properties... (correct) I also got into a state where Remove Breakpoint wasn't on the menu, just Add Breakpoint, but I could not reproduce this.
The contributed actions do not exist and therefore can not update accordingly. This is only a problem when the workspace is first started and you start the Java perspective before the Java Debug perspective. I switched the initial text for enable/disable to "Toggle Breakpoint" and for add/remove to manage. Of course once the actions are invoked, things are updated correctly. The Add action exists if you are over a location where there is not already a breakpoint. The Remove action exists when you are over a location where a breakpoint exists. You should not see both in the menu at the same time.
Please verify (DarinW).
Introducing new action names is not great. If breakpoints are regular markers, and their enabled state is a marker attribute, then you should be able to target this using the IActionFilter support. See actionExpressions.html for more details. If their some other kind of object coming from Debug, then Debug can define its own IActionFilter. I suggest reopening this PR to consider better solutions.
Re-opening for consideration. Rather than using the marker def, we should query the IBreakpoint object.
*** Bug 14838 has been marked as a duplicate of this bug. ***
I really do not see how this could be accomplished. IBreakpoint is not a UI element...it cannot know about IActionFilter. Java debug ui does not "exist" yet so it cannot add the adaptable for the IBreakpoint. Does the whole IActionFilter mechanism work for selections in the ruler of an editor?
Whoever contributed the Add Breakpoint action (presumably Debug UI) must add the IActionFilter to IBreakpoint using the adapter manager. As you observe, higher level plugins may not be activated yet, so they would not get the chance to do this.
Defered
Resolving to later.
re-open for 3.0
*** Bug 44575 has been marked as a duplicate of this bug. ***
Java Debug UI does exist. It's loaded when the marker is drawn in the ruler.
Not sure this is solvable. The IActionFilter API is meant to filter actions, not change their labels. So the API doesn't actually pass in the action, it just passes in the object and an attribute name and value. You can't set the action's text with the provided objects. Anyway, we add the enable/disable action to the ruler using a viewerContribution. Reading the ISV doc on the extension point, it looked to me like it supports filters, but if I declare one in the plugin.xml, I get a warning stating that <filter ...> is not a legal child of viewerContribution. Should we just change the label to "toggle enablement" at startup?
I think what we really need to solve this problem is a way to provide another class in the XML instead of a label. This class would be used to determine the label dynamically. If other people don't have this problem, though, I'm fine with "Toggle Enabled".
Took the easy way out. The action's default label is now "Toggle Breakpoint Enabled" instead of "Enable Breakpoint". Please verify change to org.eclipse.jdt.debug.ui/plugin.properties, DarinS.
Good enough for me :-) Verified.