Community
Participate
Working Groups
Reproducible with Controls Demo -> TableViewer Tab on first run (text estimation). 1. Set a bigger font on the table - add in TableViewerTab (line 469): viewer.getTable().setFont( Graphics.getFont( "Times", 22, SWT.BOLD | SWT.ITALIC ) ); 2. Run the Controls Demo -> TableViewer tab 3. Enable cell editors 4. Click on the "Donald" - the cell editor for "Albert" appears and it is misaligned. The reason for this issue is the following: 1. Table#getItemHeight is using Graphics#getCharHeight 2. The MeasurementOperator#readMeasuredFontProbeSizes is executed in two places - MeasurementListener#handleMeasurementResults and MeasurementListener#handleStartupProbeMeasurementResults 3. MeasurementListener#handleStartupProbeMeasurementResults is executed before the PREPARE_UI_ROOT phase ( *before* the "preserveValues" ) on *every* request (PREPARE_UI_ROOT phase exists in RWTLifeCycle#PHASE_ORDER_SUBSEQUENT). As a result, preserving a value, that depends on char height (measured font size) will not be rendered on the client. Client and server are out of sync.
Two questions come to my mind: 1. Do we really need a PREPARE_UI_ROOT phase in RWTLifeCycle#PHASE_ORDER_SUBSEQUENT? 2. Do we need to handle "handleStartupProbeMeasurementResults" separately from "handleMeasurementResults"? Is handleStartupProbeMeasurementResults really needed?
Created attachment 202075 [details] Patch After discussion with Frank, we agreed to introduce a boolean field ( isStartupProbeMeasurementPerformed ) in the MeasurementOperator that ensure that handleStartupProbeMeasurementResults is executed only once (in PREPARE_UI_ROOT phase of the first request only).
Applied patch to CVS HEAD.
Applied patch to v14_Maintenance branch too.