Bug 14626 - Breakpoint ruler menu contributions not updating properly
Summary: Breakpoint ruler menu contributions not updating properly
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 44575 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-25 11:48 EDT by Nick Edgar CLA
Modified: 2003-12-15 16:31 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-04-25 11:48:50 EDT
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.
Comment 1 Darin Swanson CLA 2002-04-25 15:17:18 EDT
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.
Comment 2 Darin Swanson CLA 2002-04-25 15:17:38 EDT
Please verify (DarinW).
Comment 3 Nick Edgar CLA 2002-04-25 21:10:16 EDT
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.
Comment 4 Darin Wright CLA 2002-04-26 16:54:27 EDT
Re-opening for consideration. Rather than using the marker def, we should query 
the IBreakpoint object.
Comment 5 Darin Wright CLA 2002-04-29 17:38:56 EDT
*** Bug 14838 has been marked as a duplicate of this bug. ***
Comment 6 Darin Swanson CLA 2002-04-29 17:51:33 EDT
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?
Comment 7 Nick Edgar CLA 2002-04-30 11:47:56 EDT
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.
 
Comment 8 Darin Wright CLA 2002-05-31 17:45:57 EDT
Defered
Comment 9 Darin Swanson CLA 2002-06-26 11:16:42 EDT
Resolving to later.
Comment 10 Darin Wright CLA 2003-05-12 15:48:40 EDT
re-open for 3.0
Comment 11 Darin Swanson CLA 2003-10-22 13:21:50 EDT
*** Bug 44575 has been marked as a duplicate of this bug. ***
Comment 12 Jared Burns CLA 2003-12-10 20:20:27 EST
Java Debug UI does exist. It's loaded when the marker is drawn in the ruler.
Comment 13 Jared Burns CLA 2003-12-11 12:19:08 EST
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?
Comment 14 Jared Burns CLA 2003-12-11 12:22:27 EST
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".
Comment 15 Jared Burns CLA 2003-12-13 13:49:46 EST
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.
Comment 16 Darin Swanson CLA 2003-12-15 16:31:32 EST
Good enough for me :-)
Verified.