| Summary: | Retargettable all references and all instances action | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Samantha Chan <chanskw> | ||||
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | ||||||
| Version: | 3.3 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Samantha Chan
For 3.3 we will provide internal hooks to override these actions - but they won't be official API. Our plan is to have our actions test for adapters on the selected element - IAllReferences or IAllInstances. The adapters will provide an alternate action to run - #getAction(). Created attachment 59171 [details]
Proposed Fix
Proposed fix
Creates two new interfaces that extend from IObjectActionDelegate. To retarget the actions, implement one of the interfaces and add it as an adapter of the object the custom action should apply to. When the all instances/references action is called, it will check for an adapter of the appropriate type, then call setActivePart, selectionChanged and finally run (all defined in IObjectActionDelegate).
Please comment if this solution does not satisfy all requirements.
This is just an internal hook for 3.3 - Sam, please see if the solution does what you need. Note: any "retarget" action you provide will have to dispose itself after each "run", as we get a new adapter each time the action is run. Sam, please advise if we should release this... not sure if this is what you need. Hi Darin, I took a brief look at the code. I think the retargettable action does what we need. However, I have a couple of questions. When we retarget the actions, we will be responsible for showing references and instances. My question is, are there methods to allow us to fetch the references and instances from a variable? I see that IJavaObject allows us to fetch references. Can we have an util method to allow us to get to the instances? In addition the JDIAllInstancesValue and JDIReferenceListValue are internal classes. We need to have access to these in order to render the values returned. (I am not sure if we are supposed to use the JDI classes.) As discussed, I have concerns showing the references and instances in the variables view itself. I need to check with my team to see how their variables are wrappered and see if there are any problems. I think it's ok to release the code. We may need additional interfaces for getting to the references and instances... and we may need ability to hide the "show references" action in the variables view. Thanks... Sam API for instances/references does not make sense on a variable. I.e. you get references to an object (IJavaObject.getReferringObjects(long max)), and instances of a type (IJavaReferenceType.getInstances(long max)). We do not intend to expose JDIAllInstancesValue and JDIReferenceListValue as API in 3.3. This is our internal impl of the feature (we allow you to retarget as you see fit). After trying various approaches to showing references, we found that in-line in the variables view is a convenient way to combine object structures and reference graphs. Disabling the feature may be possible, but we don't have support for this yet. I think this should work differently, as the actions appear in different places (not just var view). Currently, this works by registering an adapter of the object that the action was invoked on, but the "all instances" works in the editor, outline, and variable view. I think there should be one way to override the action, rather than having to provide adapters on all possible targets. Sam, you wanted the action to work on variables that wrapper IJavaVariables... but you also want to override? If you want to override, why do you want it to work on your wrappers too? Here are the two use cases of these actions: * We want to be able to override the actions to provide our own visualizations of instances and references. While it may make sense to show these things in a popup, we may want to pop them in a view to make it more useful. We want to be able to do this with pure Java / JDT. * We need the actions to work on the wrappered Java variables. Otherwise, the actions / view may seem broken when our user debugs java code with our debugger. In the case when we did not override the action, we still want the base action to work. I haven't thought about making the "All Instances" action work in the editor or outline view. I will take a look and see if there is any issue there. Not planned for 3.3. Without a testable use case we cannot put this in 3.3. We'd need a client to test the solution we provide to ensure that it works in all scenarios. I don't believe we have this at this time (we just trying to guess at how it might work). Hi Darin, I thought we were going to have an internal hook to retarget the action. This will give us a chance to look at the API and figure out the use case scenarios? Thanks... Sam Closing for now. Please open a new bug once requirements are understood. As of now 'LATER' and 'REMIND' resolutions are no longer supported. Please reopen this bug if it is still valid for you. |