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

Bug 525939

Summary: SashRenderer does not forceLayout when child element container data has changed
Product: [Eclipse Project] Platform Reporter: Julian Hemm <hemm.julian>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: hemm.julian, Lars.Vogel
Version: 4.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
SashRenderer.java none

Description Julian Hemm CLA 2017-10-12 09:55:36 EDT
When a MPartStack is resized using setContainerData, the parent MPartSashContainer does not redraw because forceLayout is not being invoked.

How to reproduce:

ApplicationModel:
-PartSashContainer 
--PartStack
--PartStack

Load PartSashContainer and child PartStacks via modelService and set a different containerData to PartStacks:
Expected behavior: PartStashContainer is adjusted
Actual result: Nothing happens

The problem is that SashRenderer.subscribeTopicSashWeightChanged() returns when element.getRenderer() != SashRenderer.this

Workaround:
call MPartSashContainer.setContainerData(newValue) to trigger change
Comment 1 Lars Vogel CLA 2017-10-12 10:16:08 EDT
Thanks Julian, are you available to upload a Gerrit? 

IMHO fix would look similar to:

if !(element.getParent!=null && element.getParent!= SashRenderer.this ) || element.getRenderer() == SashRenderer.this {
 return;
}

We basically need to check the parent also and see if it is a SashRenderer.
Comment 2 Julian Hemm CLA 2017-10-13 11:23:32 EDT
Created attachment 270993 [details]
SashRenderer.java

Hi,

i tried to fix the SashRenderer.
Unfortunately I have problems pushing to Gerrit and no time to fix it.

So, for review I will attach my changes here :/

I'm not pretty sure with the changes, looks quite complicated what was needed to be done so please take a look at it.

- added 3 private methods on the buttom and adapted forceLayout and subscribeTopicSashWeightChanged

Hope this helps.

regards
Julian
Comment 3 Dani Megert CLA 2017-12-05 12:10:10 EST
This bug did not get delivered for the specified target milestone. Please set the target milestone when you plan to deliver the fix.
Comment 4 Lars Vogel CLA 2019-12-17 14:16:46 EST
Sorry Julian for missing your patch. I regulary check Gerrit but didn't see that you had issue uploading a patch to Gerrit. Meanwhile we have fixed that via Bug 553811

*** This bug has been marked as a duplicate of bug 553811 ***