Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to align views
How to align views [message #448723] Sun, 30 April 2006 13:17 Go to next message
Eclipse UserFriend
Originally posted by: uwe.pressler.t-online.de

Hi,

I have build an application with one perspective with three folders and fife
views in it.
Here is the code:

String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
IFolderLayout selectionLeftFolder = layout.createFolder("selectionLeft",
IPageLayout.LEFT, 0.25f, editorArea);
IFolderLayout editorFolder = layout.createFolder("editors",IPageLayout.LEFT,
0.7f, editorArea);
IFolderLayout selectionRightFolder = layout.createFolder("selectionRight",
IPageLayout.LEFT, 0.25f, editorArea);
selectionLeftFolder.addPlaceholder(View1.ID + ":*");
selectionLeftFolder.addPlaceholder(View2.ID + ":*");
editorFolder.addPlaceholder(EditorView.ID + ":*");
selectionRightFolder.addPlaceholder(View3.ID + ":*");
selectionRightFolder.addPlaceholder(View4.ID + ":*");
selectionLeftFolder.addView(View1.ID);
selectionLeftFolder.addView(View2.ID);
selectionRightFolder.addView(View3.ID);
selectionRightFolder.addView(View4.ID);

When I start the application the views are dispayed tabbed.
I can then arrange it by dragging.
But the next time I start the application the views are again shown tabbed.

Here my questions:
1) How can I set the initial alignment so that the views are shown among
each other.
2) How can I store the alignment of the views if the user has rearranged
it and restore it on the next start of the application?

Regards
Uwe
Re: How to align views [message #448738 is a reply to message #448723] Mon, 01 May 2006 11:41 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Uwe Pressler wrote:
> Hi,
>
> I have build an application with one perspective with three folders and
> fife views in it.
> Here is the code:
>
> String editorArea = layout.getEditorArea();
> layout.setEditorAreaVisible(false);
> IFolderLayout selectionLeftFolder = layout.createFolder("selectionLeft",
> IPageLayout.LEFT, 0.25f, editorArea);
> IFolderLayout editorFolder =
> layout.createFolder("editors",IPageLayout.LEFT, 0.7f, editorArea);
> IFolderLayout selectionRightFolder =
> layout.createFolder("selectionRight", IPageLayout.LEFT, 0.25f, editorArea);
> selectionLeftFolder.addPlaceholder(View1.ID + ":*");
> selectionLeftFolder.addPlaceholder(View2.ID + ":*");
> editorFolder.addPlaceholder(EditorView.ID + ":*");
> selectionRightFolder.addPlaceholder(View3.ID + ":*");
> selectionRightFolder.addPlaceholder(View4.ID + ":*");
> selectionLeftFolder.addView(View1.ID);
> selectionLeftFolder.addView(View2.ID);
> selectionRightFolder.addView(View3.ID);
> selectionRightFolder.addView(View4.ID);
>
> When I start the application the views are dispayed tabbed. I can then
> arrange it by dragging. But the next time I start the application the
> views are again shown tabbed.
>
> Here my questions:
> 1) How can I set the initial alignment so that the views are shown among
> each other.

What? They're shown in the "alignment" specified by your layout. You
want a different alignment, change the layout. You can add views
directly to the page layout, relative to each other. You don't have to
add them to folders.

> 2) How can I store the alignment of the views if the user has rearranged
> it and restore it on the next start of the application?

IIRC, you can use IWorkbenchConfigurer#setSaveAndRestore(*). Then the
workbench will reload your last perspective state.

Later,
PW


Previous Topic:is it possible to only open one editor at a time
Next Topic:IViewPart & ContentOutline
Goto Forum:
  


Current Time: Fri Dec 06 20:30:09 GMT 2024

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

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

Back to the top