Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 36942

Summary: [plan item] Present logical view of Java objects in debugger
Product: [Eclipse Project] JDT Reporter: Jim des Rivieres <jeem>
Component: DebugAssignee: Luc Bourlier <eclipse>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P4 CC: boxall, Darin_Swanson, eclipse, eclipse, eclipse, m.a.r.k
Version: 2.1Keywords: plan
Target Milestone: 3.0 M5   
Hardware: All   
OS: All   
Whiteboard:

Description Jim des Rivieres CLA 2003-04-25 17:46:14 EDT
Present logical view of Java objects in debugger. The current debugger always 
presents the internal structure of Java objects. For instances of standard 
data structures like java.util.HashMap, the Java debugger should be able to 
present a higher level logical view of the object (i.e., to show it as a table 
of key-to value mappings). [JDT Debug]
Comment 1 Darin Wright CLA 2003-04-28 10:32:15 EDT
*** Bug 36591 has been marked as a duplicate of this bug. ***
Comment 2 Joe Szurszewski CLA 2003-04-29 11:30:59 EDT
Will investigate an approach that enhances the 'details pane'.  The idea is to 
promote this pane to a full-fledged view (as in the hierarchy view).  There will 
be an extension point where an implementation for this view can be contributed 
for a specific type.  By default, the existing String-oriented view will be used 
for all types that are not otherwise assigned.
Comment 3 Joe Szurszewski CLA 2003-06-09 12:41:01 EDT
Released first cut at infrastructure and a small set of specific filters for 
Java.  Content providers can be registered for a debug model.  When a CP is 
registered for a debug model, the variables view delegates to that CP for all 
variables belonging to that debug model.  In the case of Java, this CP in turn 
looks for CPs registered against specific Java types (classes or interfaces).  
The first matching CP found searching up in the class hierarchy is used.  The 
children returned by custom CPs are encapsulated in 'placeholder' variables, 
that are constructed from a name and an IJavaValue.  These placeholders are 
represented with a different icon in the view.  All infrastructure to quickly 
create new Java 'variable filters' (specific CPs) is public API.  
Comment 4 Joe Szurszewski CLA 2003-06-09 14:30:28 EDT
Next step is to consider how to manage variable filters.  At present, all 
registered filters (content providers) are used all the time.  Variables that 
qualify for > 1 filter will use the one nearest to them in the hierarchy.  In 
case of collisions, there is no rule as to which filter is used.

Proposal is to implement some type of dialog that allows users to have control 
over which filters are in use.  For example, have an action "Variable Filters...
" in the context menu for a selected variable in the VariablesView.  This opens 
a dialog containing a checkbox list.  All registered filters that COULD apply to 
the selected variable type are listed, and the one currently in use is checked.  
The choice made in this dialog then applies to ALL variables of the same type 
until the choice is changed in the future.  

This allows multiple, overlapping filters to be registered by many different 
plugins, with the user having the choice of which to use.
Comment 5 Joe Szurszewski CLA 2003-06-12 16:01:04 EDT
Decided to omit any sort of management feature for now, since the estimated 
number of filters is low.  Also decided to avoid any sort of optimization work 
for now since the there would be extra complexity and memory footprint for a 
small benefit.  Marking as fixed.
Comment 6 Joe Szurszewski CLA 2003-06-12 16:01:41 EDT
Please verify, Darin W.
Comment 7 Darin Wright CLA 2003-07-11 14:56:09 EDT
New interfaces need review and better documentation.
Comment 8 Darin Wright CLA 2003-08-27 09:59:11 EDT
Deferred to M4
Comment 9 Darin Swanson CLA 2003-08-27 14:37:04 EDT
How does the user know which, if any, object browsers are available?
Comment 10 Darin Wright CLA 2003-08-27 14:42:24 EDT
Currently, the user does not know which browsers are defined - you'd have to 
look at the extension points for the java debugger that contribute browsers.
Comment 11 Darin Wright CLA 2003-10-01 18:02:06 EDT
Still more work in M5 - see bug 38419, bug 43048, bug 43329
Comment 12 Darin Wright CLA 2003-10-30 16:24:17 EST
I have re-worked the way logical structures are contributed/computed - existing 
experimental "object browser" extension points have been removed. The new 
experimental story follows:

* an extension point "logicalStructureTypes" has been added to 
org.eclipse.debug.core (not yet documented - and is an internal class - see 
ILogicalStructureType, and ILogicalStructureTypeDelegate)
* A "logical structure type" provides a logical value for a raw value, for a 
specific debug model. When a value is expanded in the variables view, 
contributed logical structure types (for the applicable debug model) are 
queried to see if a logical structures (translation) is available for the value 
being displayed.
* by translating a value, rather than providing a "content provider" (as the 
first approach used), we can allow logical structures to benefit from the 
automatic array partitioning provided by the debug model. For example, a 
collection can be translated to an array, and it will be automatically 
partitioned in the UI. As well, logical strucutres are now supported in the 
expressions view.

API will remain in "experimental" mode for a while (until M5?). Need to add 
user interface for choosing a strucutre to display when more than one 
translation is available for a value.
Comment 13 Darin Wright CLA 2003-11-03 14:46:23 EST
The API has been made public:

ILogicalStructureType
ILogicalStructureTypeDelegate

new extension point:

org.eclipse.core.debug.logicalStructureTypes

UI has been added to select from available strucutre types when there is more 
than one for a selected variable. As well, the user may selectively disable 
structure types. A drop down menu/action has been added to the variables view 
that displays all available structure types for a selected variable. The 
enabled structure is checked.

Infrastrucure is in place. Marking as fixed. New bugs should be opened as 
required.
Comment 14 Darin Wright CLA 2003-11-03 14:46:38 EST
Please verify, Luc.
Comment 15 Luc Bourlier CLA 2003-11-07 13:39:58 EST
Verified.