Information on TextSizeRecalculation process [message #1690167] |
Wed, 25 March 2015 10:31  |
Eclipse User |
|
|
|
In our application the users have two ways to customize TableViewerColumn's width :
1/ The first one is to manually specify each column width by dragging header's edge of columns.
2/ The second one is to select "autoFit" in a display subMenu, which will autosize all columns width by packing them.
The user's choices are persisted, allowing to restore the same environment across sessions.
Important Note:
When a user manually modifies the column width, "AutoFit" is automatically deActivated ( ColumnWidthChangeEvent)
All is fine until we encountered the following situation :
Regularly, when a user selects "AutoFit"
1/ We pack all columns ignoring at the same time all associated WidthChanges events from Columns.
2/ Then, an unHandled "TextSizeRecalculation.repack" occured ! Packing all columns a second time and we have no way to know if it is a user's action or not.
Is there a way to know/be informed when the TextSizeRecalculation phase is ending ?
Our current workaround, is to look for this information in the stacktrace, which is not really satisfying nor optimal.
Might the TextSizeUtil expose such a method, in the way of what is done with TextSizeUtil#isTemporaryResize() ?
|
|
|
Re: Information on TextSizeRecalculation process [message #1690282 is a reply to message #1690167] |
Thu, 26 March 2015 06:04  |
Eclipse User |
|
|
|
Hi,
the internal flag TextSizeUtil#isTemporaryResize() marks the
text-size-determination (TSD) Shell enlargement (+1000px). Evaluating
this flag in Shell resize event will ensure that you are in the TSD
resizing. The next resize event will be triggered by TSD Shell restore
and probably you want to filter it (ignore column packing).
Another thing you could try is to clear the internal TableColumn
"packed" state by setting the column width manually again, like:
column.pack();
column.setWidth( column.getWidth() );
Thus, TSD will not repack the column again as it is considered as not
packed.
HTH,
Ivan
--
Ivan Furnadjiev
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Powered by
FUDForum. Page generated in 0.02385 seconds