Bug 274369 - Add SWT smarts to inspector
Summary: Add SWT smarts to inspector
Status: CLOSED MOVED
Alias: None
Product: MAT
Classification: Tools
Component: GUI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Andreas Buchen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-29 14:35 EDT by Chris Grindstaff CLA
Modified: 2024-05-08 11:52 EDT (History)
5 users (show)

See Also:


Attachments
proposed patch (6.64 KB, patch)
2009-04-29 14:35 EDT, Chris Grindstaff CLA
no flags Details | Diff
swt image (340 bytes, image/gif)
2009-04-29 14:36 EDT, Chris Grindstaff CLA
no flags Details
swt disposed image (132 bytes, image/gif)
2009-04-29 14:36 EDT, Chris Grindstaff CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Grindstaff CLA 2009-04-29 14:35:31 EDT
Created attachment 133810 [details]
proposed patch

This patch updates the inspector so you can easily tell if an object is an SWT widget and whether or not the object has been disposed. I've found this useful when tracking down memory leaks related to leaking listeners and widget references.
Comment 1 Chris Grindstaff CLA 2009-04-29 14:36:06 EDT
Created attachment 133811 [details]
swt image
Comment 2 Chris Grindstaff CLA 2009-04-29 14:36:21 EDT
Created attachment 133812 [details]
swt disposed image
Comment 3 Mariot Chauvin CLA 2009-04-30 07:09:20 EDT
+1 for this feature
Comment 4 Stefan Röck CLA 2009-06-22 06:43:50 EDT
Cool feature. 
Looking at the code: why don't you call Widget#isDisposed() for the check?
Comment 5 Andreas Buchen CLA 2009-06-22 07:18:49 EDT
(In reply to comment #4)
> Looking at the code: why don't you call Widget#isDisposed() for the check?

Well the heap is always post-mortem - one cannot call methods on the objects because the objects do not live anymore. 



We'll take a look at this feature for the next service release. I did not submit the patch, because the only the image in the object inspector is changed, not in the object lists itself. I thought it might be confusing if different icons are used for one and the same object.
Comment 6 Stefan Röck CLA 2009-06-22 08:59:16 EDT
Ok, I understand. I was asking because I didn't find the code where the display instance is set to null in the Widget.java implementation of RAP. But as Benny is already on CC list, I don't worry about this anymore :-)
Comment 7 Andrew Johnson CLA 2011-03-01 08:49:04 EST
Another way of doing this would be to have an extension point which returned an icon for an object, rather like a name resolver. This could then be added to Icons.forObject and ideally Icons for object would do the adding of GC roots and inbound/outbound decorators.
Comment 8 Eclipse Webmaster CLA 2024-05-08 11:52:20 EDT
This issue has been migrated to https://github.com/eclipse-mat/org.eclipse.mat/issues/3.