Community
Participate
Working Groups
Java 6.0 VMs may support the 'all instances' feature. We should allow users to inspect all instances of types when debugging. The action "All Instances..." should be available in: * The variables view (visible only when an object is selected): - should open a popup inspector on all instances of the actual type of the selected variable - could be an 'object contribution' for IJavaVariable * The Java editor (visible only when debugging): - opens all instances in a popup inspector of the selected type (i.e. selected type name). - contributed to class file and CU editor context menus * The Java editor outline (visible only when debugging): - opens all instances in a popup inspector when a type is selected in the outline. - could be an 'object contribution' for IType The inspector can create a temp array variable containing all instances. We should guard against large instance counts (but I'm not sure what the heuristic shuold be yet).
Should create an "All Instances" command bound to something like CTRL-Shift-A.
first run see AllInstancesActionDelegate, JDIAllInstancesValue did not provide java editor or java outline compatibility. implemented as a popup in the same fashion as the all references first run.
The "All Instances..." action in the Java editor does not enable for me. For example, when I select any instance of "TestAllInstances" in the given code (while debugging it), the action is disabled. public class TestAllInstances { public static void main(String[] args) { new TestAllInstances().foo(); } private void foo() { System.out.println("foo"); // BREAKPOINT HERE } }
As it should be :) That is actually some testing code that should not have made it into the build... It should only work for now in the variables view like all references does.
Created attachment 56833 [details] workin progress This is a work in progress for adding all instances to the outline view. All instances can be queried from the view with this patch, but runWithEvent seems to always return the coords {0, 0} so the popup always shows up in the top left corner of the window....
Created attachment 59014 [details] Updated patch Updated patch to work against HEAD. Adds support to browse all instances from editor outline, when a class is selected. Pending bug 174233, we can release this code. Still need to add support for selecting class names in the editor.
Released 'All Instances...' support to editor outline. Still needs to be integrated into editor (i.e. foe a selected type name).
Created attachment 60491 [details] All Instances in Editor Patch adds support for all instances action in java editors. The start of the selection (or the location of the caret if there is no selection) must be inside a java type. - Pretty much complete, but still a few issues, more testing needed next week. - If there is an easy way to get it to work when a constructor is selected that would be useful, as it is easy to get confused when you select part of Vector() and you the error says you haven't selected a java type. - There is also a problem with getting the anchor when working in the outline view. The editor anchor defaults to the caret, and the variables view correctly gets the location of the selected element, but the outline uses the default anchor which ends up in the variables view. - If an icon is produced for instance/reference entries, we should use it to replace the blue triangles currently used. - The action's help hasn't been created. Doesn't work if a constructor is selected (slightly confusing since Vector and Vector()
Created attachment 60675 [details] Patch for review
Comment on attachment 60675 [details] Patch for review Updated patch for review.
Mike, please review the patch
Created attachment 60698 [details] Updated Patch Updated patch to resolve conflicts with HEAD.
The feature works as it should, but the popup does not show in the correct location in the outline view. This is because there is no way to get a handle to the current control in the view, and therefore we cannot determine where to open the popup. I will release the patch, and file the appropriate bugs against jdt.ui for a control adapter in the outline view
verified