How to align views [message #448723] |
Sun, 30 April 2006 13:17 |
Eclipse User |
|
|
|
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 |
|
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
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Powered by
FUDForum. Page generated in 0.03628 seconds