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

Bug 352771

Summary: Add extension point for contributing variable adapters
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Justin Spadea <jspadea>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 346247, 352021    

Description Justin Spadea CLA 2011-07-21 10:47:03 EDT
The EGL Java debugger runs off generated code, and extensions to the base generator might implement variables differently. For example generator A might implement a dictionary as a Java class "org.foo.Dictionary" while generator B might implement it as a Java class "com.bar.DictionaryField". The underlying object differs between implementations, so we can't be hard-coding anything for either type in the debugger. Rather the debugger should support a set of variable adapters that take care of figuring out how to display an object in the Variables view (including its children).

In addition to defining the extension point and supporting the contributions in the debugger, we'll want to provide some adapters for the base EDT Java runtime (e.g. arrays).

If multiple adapters will work for a given IJavaVariable, the first one invoked will be used, and the order in which Eclipse returns the extension points is non-deterministic. But this should hopefully not be an issue, since it's unlikely multiple adapters will exist for some "com.foo.Bar" class.
Comment 1 Justin Spadea CLA 2011-07-21 10:57:19 EDT
Note that this adapter is not necessarily required to make a new type work in the Variables view. You may choose to include SMAP information in the class. The adapter framework will exist for those cases where this is not possible (or not desirable).

For example, records generated by the base EDT generator produce SMAP information so that you only see the record's children as defined in the EGL (no internal variables are displayed, and the EGL names are shown instead of the generated names - e.g. "class" gets generated as "eze_class" since it's a Java keyword).
Comment 2 Justin Spadea CLA 2011-08-01 10:42:32 EDT
Adapters can now be contributed via the org.eclipse.edt.debug.core.variableAdapters extension point. Classes must implement org.eclipse.edt.debug.core.java.IVariableAdapter.

An example is provided in the org.eclipse.edt.debug.core plug-in.
Comment 3 Justin Spadea CLA 2011-09-07 16:28:40 EDT
Verified