Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Limiting dimensions of view folders / views
Limiting dimensions of view folders / views [message #520998] Tue, 16 March 2010 07:03 Go to next message
Andrei Lissovski is currently offline Andrei LissovskiFriend
Messages: 13
Registered: July 2009
Junior Member
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 #521091 is a reply to message #520998] Tue, 16 March 2010 12:35 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can make a fixed perspective, and then the ratios won't change at
all (and there's no dragging).

There's also org.eclipse.ui.ISizeProvider which views can implement, as
a hint to the perspective layout code.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Limiting dimensions of view folders / views [message #521281 is a reply to message #521091] Wed, 17 March 2010 04:42 Go to previous message
Andrei Lissovski is currently offline Andrei LissovskiFriend
Messages: 13
Registered: July 2009
Junior Member
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.
Previous Topic:JDK 6 webstart and eclipse 3.4.2
Next Topic:Classloader not work on RCP
Goto Forum:
  


Current Time: Tue Apr 16 22:35:14 GMT 2024

Powered by FUDForum. Page generated in 1.88775 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top