Limiting dimensions of view folders / views [message #520998] |
Tue, 16 March 2010 03:03  |
Eclipse User |
|
|
|
Hi,
In my RCP application, I would like to constrain min/max width for specific vertically oriented view folders. Similarly, I would like to constrain min/max height for specific horizontally oriented view folders / views. The effect to the user should be such that it is impossible to drag the sash separating the parts / part folders outside of these constraints.
Ideally, I would like to be able to impose these constraints dynamically in a way that would let me veto resizes based on the current state of my UI. In absence of that, I could live with hard constraints in pixels or ratios between relevant part dimensions.
Possibly of relevance, my application uses a custom presentation.
I have done a fair amount of digging in the platform code and searching but so far to no avail. Would appreciate the help from the community. Any pointers are welcome.
Thanks a lot!
|
|
|
|
Re: Limiting dimensions of view folders / views [message #521281 is a reply to message #521091] |
Wed, 17 March 2010 00:42  |
Eclipse User |
|
|
|
Thanks Paul, your ISizeProvider suggestion got me on the right track.
For posterity, your custom presentation must be overriding getSizeFlags() and computePreferredSize() off the org.eclipse.ui.ISizeProvider. The contract is somewhat dense but the key is that (for example, in the case of constraining min/max width) the max dimension must be returned for the computePreferredSize(true, INFINITE, someWidth, INFINITE) invocation, and the min dimension must be returned for the computePreferredSize(true, INFINITE, someWidth, 0) invocation. The getSizeFlags(true) must return SWT.MIN | SWT.MAX.
|
|
|
Powered by
FUDForum. Page generated in 0.03501 seconds