Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » 3-view layout. Ratio override.
3-view layout. Ratio override. [message #463863] Sat, 17 February 2007 15:59 Go to next message
Eclipse UserFriend
I'm having basic trouble with IPageLayout. I need three views distributed
across the page using .25/.50/.25 ratios, but I'm getting ratios closer to
35/.20/.45. The javadocs for IPageLayout provide no explanation. I
noticed that ratio values should range from .05 to .95. I've modified my
ratios so they add up to .95, but that had no effect.

public void createInitialLayout(IPageLayout layout) {
layout.setEditorAreaVisible(false);
String editorArea = layout.getEditorArea();
layout.addStandaloneView(OutboundConsolListView.ID, false,
IPageLayout.LEFT, 0.25f,
editorArea);
IFolderLayout center=layout.createFolder("center", IPageLayout.RIGHT,
0.50f,
OutboundConsolListView.ID);
center.addView(PlaceholderView.ID);
layout.addStandaloneView(OutboundShipmentListView.ID, false,
IPageLayout.RIGHT, 0.25f,
"center");

}
Re: 3-view layout. Ratio override. [message #463864 is a reply to message #463863] Sat, 17 February 2007 16:03 Go to previous messageGo to next message
Eclipse UserFriend
Appreciate an explanation of what may be happening behind the scenes or
suggestions on how to gain better layout control.

thanks!
Octavio
Re: 3-view layout. Ratio override. [message #463887 is a reply to message #463864] Mon, 19 February 2007 11:21 Go to previous messageGo to next message
Eclipse UserFriend
A layout is always splitting the "relativeTo" view into 2.

For example, if you wanted an editor area on the right, and 3 views on
the left, all 33%, you could code it:

layout.addView("view1.id", IPageLayout.LEFT, 0.25f,
IPageLayout.ID_EDITOR_AREA);
// the 33% is applied to the view on "top", "view1.id"
layout.addView("view2.id", IPageLayout.BOTTOM, 0.33f, "view1.id");
// this just splits that 66% area in half
layout.addView("view3.id", IPageLayout.BOTTOM, 0.5f, "view2.id");


Later,
PW
Re: 3-view layout. Ratio override. +Re-sizing [message #463900 is a reply to message #463887] Mon, 19 February 2007 22:23 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Paul.

I got it to work. I know we have limited control over view layout, but
what's the best way to prevent views from re-sizing when another view is
closed?

In the java perspective, for example, the package explorer view does not
take over the entire Page when all editors are closed. How does this
happen?

In my case I have a folder with multiple views. When all the views in the
folder are closed, I don't want views outside the folder to take over the
folder space.

The only way to control this --that I can think of-- is through a view
listener and a blank view that will open if there are no views in the
folder. I would have to close the 'blank view' if views open in the
folder.

If I should be looking at a simpler work-around to gain control over view
re-sizing, I would appreciate your suggestions.

Thanks once again!

Octavio
Re: 3-view layout. Ratio override. +Re-sizing [message #463974 is a reply to message #463900] Wed, 21 February 2007 10:22 Go to previous message
Eclipse UserFriend
Octavio Berlanga wrote:
> Thanks Paul.
>
> I got it to work. I know we have limited control over view layout, but
> what's the best way to prevent views from re-sizing when another view is
> closed?
>
> In the java perspective, for example, the package explorer view does not
> take over the entire Page when all editors are closed. How does this
> happen?

The editor area is a special part stack, which can remain open and
empty. All views go into normal view stacks, which disappear when empty

There's isn't really a workaround, unless you do like you suggest and
keep an empty view open.

Later,
PW
Previous Topic:formatter option for text editor
Next Topic:Stop editor from closing without saving
Goto Forum:
  


Current Time: Mon Mar 17 08:06:02 EDT 2025

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

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

Back to the top