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

Bug 313088

Summary: API Usage: SnapshotDetailsView illegally extends ContentOutline
Product: [Tools] MAT Reporter: Krum Tsvetkov <krum.tsvetkov>
Component: GUIAssignee: Project Inbox <mat.core-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 313085    

Description Krum Tsvetkov CLA 2010-05-17 05:24:54 EDT
As revealed in the API report to bug 313085 the class
org.eclipse.mat.ui.internal.views.SnapshotDetailsView extends org.eclipse.ui.views.contentoutline.ContentOutline, which is marked with @noextend
Comment 1 Andrew Johnson CLA 2013-05-17 08:47:13 EDT
The reason for this class is to override isImportant, which for ContentOutline just returns 
return (part instanceof IEditorPart);

whereas SnapshotDetailsView returns
 (part instanceof MultiPaneEditor) || (part instanceof SnapshotHistoryView)
 
i.e. the outline page should be used for our heap editor or for the history view, which as a view, not an editor, wouldn't be noticed by ContentOutline. Without this override clicking on the history view will not bring up details of the selected dump.

One idea would be to make the history view an editor, but this might have the side effect that the inspector view etc. would change when the history view/editor was active.

Another would be to make SnapshotHistoryView also implement IEditorPart (to pass the test in ContentOutline), but leave it instantiated as a view.
Comment 2 Krum Tsvetkov CLA 2015-06-26 03:10:47 EDT
I think we can leave things as they are.