Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 376045 - a Area in a SashPart throws an Exception in SashLayout
Summary: a Area in a SashPart throws an Exception in SashLayout
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: 4.2 RC3   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-04 05:53 EDT by Tom K. CLA
Modified: 2012-06-06 05:24 EDT (History)
5 users (show)

See Also:


Attachments
Example Project with Product (14.90 KB, application/x-zip-compressed)
2012-04-04 05:55 EDT, Tom K. CLA
no flags Details
Proposed patch (970 bytes, patch)
2012-04-04 17:20 EDT, Nobody - feel free to take it CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom K. CLA 2012-04-04 05:53:45 EDT
Build Identifier: M6 Build

When you put an Area in a SashPart and try to Resize the Sahs we get the Exception below:


org.eclipse.swt.widgets.Composite incompatible with org.eclipse.swt.graphics.Rectangle
	at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout.getRectangle(SashLayout.java:207)
	at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout.adjustWeights(SashLayout.java:167)
	at org.eclipse.e4.ui.workbench.renderers.swt.SashLayout$2.mouseMove(SashLayout.java:90)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:212)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)

Reproducible: Always

Steps to Reproduce:
1. Open Example in IDE
2. Start Product
3. Resize the Parts - you'll get the exception
Comment 1 Tom K. CLA 2012-04-04 05:55:11 EDT
Created attachment 213558 [details]
Example Project with Product
Comment 2 Nobody - feel free to take it CLA 2012-04-04 17:20:14 EDT
Created attachment 213607 [details]
Proposed patch

In SashLayout the private method getRectangle throws this CCE because it supposes that the method getWidget() of an instance of MGenericTile *always* returns an instance of Rectangle, which is not the case. Proposed some modifications which make it work properly.
Comment 3 Eric Moffatt CLA 2012-04-09 13:35:37 EDT
Sopot, I've made the change you suggest (thanks a lot!). I haven't yet 'pushed' it because I'm working on some other defects related to DnD and sashes. I'll remember to update this defect when I do the push of my other changes...

Tom can you verify that your code works correctly with the change suggested by Sopot ?
Comment 4 Nobody - feel free to take it CLA 2012-04-09 15:04:57 EDT
(In reply to comment #3)
> Sopot, I've made the change you suggest (thanks a lot!). I haven't yet 'pushed'
> it because I'm working on some other defects related to DnD and sashes. I'll
> remember to update this defect when I do the push of my other changes...

I've also another patch pending review relating to DnD and sashes here https://bugs.eclipse.org/bugs/show_bug.cgi?id=375194 if you have time to review it.
Comment 5 Tom K. CLA 2012-06-05 07:30:55 EDT
Is there any progress in this case ?
Comment 6 Paul Webster CLA 2012-06-05 08:04:34 EDT
(In reply to comment #3)
> Tom can you verify that your code works correctly with the change suggested by
> Sopot ?

awaiting your comment ....
PW
Comment 7 Eric Moffatt CLA 2012-06-05 09:41:13 EDT
I'm fairly sure that this has been fixed. At least the sample project no longer throws exceptions...

Tom, try RC3 and if it's not fixed feel free to re-open this and we'll take another look.
Comment 8 Eric Moffatt CLA 2012-06-05 09:41:56 EDT
Verified in I20120603-1910 using the provided project (thanks!)
Comment 9 Tom K. CLA 2012-06-06 05:24:36 EDT
Thanks !