Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Minimum and Maximum view size in Eclipse 4
Minimum and Maximum view size in Eclipse 4 [message #1057891] Thu, 09 May 2013 15:15 Go to next message
Joel Becker is currently offline Joel BeckerFriend
Messages: 14
Registered: December 2012
Junior Member
Hi,

Previous to e4 you could give a ViewPart a min and max size by implementing ISizeProvider. Now in e4 you don't provide your own ViewPart impl, so you can't make it implement ISizeProvider. How do you set a min/max size for a view in e4?

I did try implementing ISizeProvider in the class referenced by my PartDescriptor's Class URI, but the methods are not called.

Thanks,
Joel

[Updated on: Thu, 09 May 2013 20:14]

Report message to a moderator

Re: Minimum and Maximum view size in Eclipse 4 [message #1063798 is a reply to message #1057891] Fri, 14 June 2013 09:35 Go to previous messageGo to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
were you able to resolve this problem?

[Updated on: Fri, 14 June 2013 09:35]

Report message to a moderator

Re: Minimum and Maximum view size in Eclipse 4 [message #1063884 is a reply to message #1063798] Fri, 14 June 2013 17:36 Go to previous messageGo to next message
Joel Becker is currently offline Joel BeckerFriend
Messages: 14
Registered: December 2012
Junior Member
Unfortunately not. I spent about 6 hours trying various solutions, including hacks like reverting the size after the user attempts to re-size it beyond the min or max. Our team decided it wasn't worth spending any more time on.

[edit] I'll include my notes from my ticket:
Quote:

none of the (documented) E4 CSS attributes address control sizes.

Also tried adding a Control listener to listen for resizes and set the size, however this results in incorrect layout. It's like I need a "Sash" object to move the sash bar, but haven't been able to get one.

Also, I found how to dig the SashLayout out of the control hierarchy, but SashLayout does not allow external modification (no methods for changing size).

Also tried changing the MPartStack Container Data upon each resize, to re-set the container weight. That causes weird behavior: you can drag the sash to resize wherever you want to, then when you're done it pops back to the size I set in the code.

Also tried adding a mouse-move listener to the composite containing the sash, and restrained mouse cursor movement when the width was not within the min/max. Very clumsy and never got it working right.

[Updated on: Fri, 14 June 2013 17:38]

Report message to a moderator

Re: Minimum and Maximum view size in Eclipse 4 [message #1063920 is a reply to message #1063884] Sat, 15 June 2013 14:16 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
You could implement it your own by creating your own SashRenderer! In e4
the sashes are created by a layout so it should be really easy to
implement min/max because the resize handling is done by the layout itself!

Tom

On 14.06.13 19:36, Joel Becker wrote:
> Unfortunately not. I spent about 6 hours trying various solutions,
> including hacks like reverting the size after the user attempts to
> re-size it beyond the min or max. Our team decided it wasn't worth
> spending any more time on.
Re: Minimum and Maximum view size in Eclipse 4 [message #1064094 is a reply to message #1063884] Mon, 17 June 2013 15:27 Go to previous messageGo to next message
Eric Moffatt is currently offline Eric MoffattFriend
Messages: 118
Registered: July 2009
Senior Member

Joel, I have to ask, what effect are you trying to achieve ?

Even in 3.x there were substantial issues with the approach; what happens when two views in the same stack have conflicting requirements ?

The issue is that when you have constrained limits of views inside a sash structure you can easily end up with conflicts so if you can tell me what effect you want then perhaps we can come up with something even better than what we had.
Re: Minimum and Maximum view size in Eclipse 4 [message #1067758 is a reply to message #1064094] Wed, 10 July 2013 13:13 Go to previous message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
for me, the requirement was to create a view which has a fixed size to be displayed in all perspectives. therefore min/max size (in pixel) would be needed.
Previous Topic:Add ControlContribution to Coolbar
Next Topic:How add a new perspective with a pure RCP 4 plugin to Eclipse Juno IDE
Goto Forum:
  


Current Time: Fri Apr 19 11:17:25 GMT 2024

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

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

Back to the top