Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » how does one set height of contributed part (view)
how does one set height of contributed part (view) [message #495445] Wed, 04 November 2009 22:15 Go to next message
Dave Combs is currently offline Dave CombsFriend
Messages: 21
Registered: July 2009
Junior Member
I'm trying a layout where I have a control area (unfortunately can't use a toolbar) that I'm representing with a View. I'd like that control area to butt up against a "main" area below it, where the control area is to be exactly 100 pixels high. I've created my Application.xmi with a

<children policy="VerticalComposite">
<children xsi:type="application:MContributedPart"... (for the view)
</children>
<children policy="HorizontalComposite">
<children xsi:type="application:MSashForm" policy="horizontalSash">
...
</children>
</children>
</children>

The question: this automatically takes over 50% of the height with the contributed view, instead of 100 pixels. The view code internally has stuff saying that the maximum size should be 100 pixels high. I also tried setting 'height' as a CSS property for the view, but that did nothing either.

Does anybody have an idea how I can force the height of this contributed view to be fixed to 100 pixels? I *really* don't want to have to put in a SashForm and provide a weight, since that's a percentage rather than a fixed value and will let the view grow vertically.

Thanks,
Dave

[Updated on: Wed, 04 November 2009 22:16]

Report message to a moderator

Re: how does one set height of contributed part (view) [message #495456 is a reply to message #495445] Wed, 04 November 2009 22:59 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Hi,

I don't think we have an expression for this yet. Today the layout used
is simply a FillLayout => 50% for each child component.

The only idea I have right now to implement this is that we are useing a
GridLayout instead so that we could use things like widthHint/heightHint
for a CompositeRenderer, Eric?

Tom

Dave Combs schrieb:
> I'm trying a layout where I have a control area (unfortunately can't use
> a toolbar) that I'm representing with a View. I'd like that control
> area to butt up against a "main" area below it, where the control area
> is to be exactly 100 pixels high. I've created my Application.xmi with a
> <children policy="VerticalComposite">
> <children xsi:type="application:MContributedPart"... (for the view)
> </children>
> <children policy="HorizontalComposite">
> <children xsi:type="application:MSashForm" policy="horizontalSash">
> ...
> </children>
> </children>
> </children>
>
> The question: this automatically takes over 50% of the height with the
> contributed view, instead of 100 pixels. The view code internally has
> stuff saying that the maximum size should be 100 pixels high. I also
> tried setting 'height' as a CSS property for the view, but that did
> nothing either.
>
> Does anybody have an idea how I can force the height of this contributed
> view to be fixed to 100 pixels? I *really* don't want to have to put in
> a SashForm and provide a weight, since that's a percentage rather than a
> fixed value and will let the view grow vertically.
>
> Thanks,
> Dave
Re: how does one set height of contributed part (view) [message #495463 is a reply to message #495456] Thu, 05 November 2009 00:08 Go to previous messageGo to next message
Dave Combs is currently offline Dave CombsFriend
Messages: 21
Registered: July 2009
Junior Member
Tom, the GridLayout sounds like a good idea. Better yet (I'm certainly no expert, not being part of the e4 team) if possible might be an attribute to indicate the type of layout to use with the Composite. Of course, there would then need to be some sort of support to indicate how to configure the individual children (like the widthHint and heightHint you mentioned in the case of the grid layout.)

If anybody else has any ideas (both for me to get through this in the short term or for a longer-term solution) I'd love to hear them.

Thanks!
Dave
Re: how does one set height of contributed part (view) [message #495504 is a reply to message #495463] Thu, 05 November 2009 07:28 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Dave Combs schrieb:
> Tom, the GridLayout sounds like a good idea. Better yet (I'm certainly
> no expert, not being part of the e4 team) if possible might be an
> attribute to indicate the type of layout to use with the Composite. Of
> course, there would then need to be some sort of support to indicate how
> to configure the individual children (like the widthHint and heightHint
> you mentioned in the case of the grid layout.)
>
> If anybody else has any ideas (both for me to get through this in the
> short term or for a longer-term solution) I'd love to hear them.

Extend the .ecore model and inject your own renderer :-) but because the
API is not ready it's hard to do that.

I wrote some of this stuff for ESE renderers [1] (don't compile out of
the box because I have patched the e4 code and those changes haven't
been ported back) and the extended model [2].

[1]https://svn.tomsondev.com/svn/ufacekit/desktop/
[2] https://dev.eclipse.org/svnroot/eclipse/org.eclipse.ufacekit /bundles/incubation/org.eclipse.ufacekit.incubation/org.ecli pse.ufacekit.e4/org.eclipse.ufacekit.ui.core.e4/

Tom
Re: how does one set height of contributed part (view) [message #564432 is a reply to message #495456] Thu, 05 November 2009 00:08 Go to previous message
Dave Combs is currently offline Dave CombsFriend
Messages: 21
Registered: July 2009
Junior Member
Tom, the GridLayout sounds like a good idea. Better yet (I'm certainly no expert, not being part of the e4 team) if possible might be an attribute to indicate the type of layout to use with the Composite. Of course, there would then need to be some sort of support to indicate how to configure the individual children (like the widthHint and heightHint you mentioned in the case of the grid layout.)

If anybody else has any ideas (both for me to get through this in the short term or for a longer-term solution) I'd love to hear them.

Thanks!
Dave
Re: how does one set height of contributed part (view) [message #564471 is a reply to message #564432] Thu, 05 November 2009 07:28 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Dave Combs schrieb:
> Tom, the GridLayout sounds like a good idea. Better yet (I'm certainly
> no expert, not being part of the e4 team) if possible might be an
> attribute to indicate the type of layout to use with the Composite. Of
> course, there would then need to be some sort of support to indicate how
> to configure the individual children (like the widthHint and heightHint
> you mentioned in the case of the grid layout.)
>
> If anybody else has any ideas (both for me to get through this in the
> short term or for a longer-term solution) I'd love to hear them.

Extend the .ecore model and inject your own renderer :-) but because the
API is not ready it's hard to do that.

I wrote some of this stuff for ESE renderers [1] (don't compile out of
the box because I have patched the e4 code and those changes haven't
been ported back) and the extended model [2].

[1]https://svn.tomsondev.com/svn/ufacekit/desktop/
[2] https://dev.eclipse.org/svnroot/eclipse/org.eclipse.ufacekit /bundles/incubation/org.eclipse.ufacekit.incubation/org.ecli pse.ufacekit.e4/org.eclipse.ufacekit.ui.core.e4/

Tom
Previous Topic:Stack elements being something other than an MItemPart?
Next Topic:site manifest editor (web ui)
Goto Forum:
  


Current Time: Fri Dec 19 00:33:02 GMT 2014

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

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