Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Creating a detached view at startup
Creating a detached view at startup [message #436500] Fri, 09 September 2005 15:29 Go to next message
Ben Brown is currently offline Ben BrownFriend
Messages: 23
Registered: July 2009
Junior Member
I'm working on getting one of my apps to restore the workbench from a
saved session. We've had the main workbench restoring its views for
quite some time time but have not been able to figure out how to get a
detached view to restore at startup.

I'm saving the Memento from the workbench and have all the information
on the previous workbench only don't know how to bring back the detached
views

The XML from the Memento for a main window folder looks something like this

<info folder="true" part="org.eclipse.ui.internal.ViewStack@7589ae2a"
ratio="0.5" ratioLeft="506" ratioRight="506" relationship="2"
relative="org.eclipse.ui.editorss">
<folder
activePageID="com.company.client.ui.module.components.javadoc "
appearance="2" expanded="2">
<page content="com.company.client.ui.module.components.javadoc"
label="com.company.client.ui.module.components.javadoc.title " />
<presentation
id="org.eclipse.ui.presentations.WorkbenchPresentationFactory ">
<part id="0" />
</presentation>
</folder>
</info>

However, the XML for a detached window looks like

<detachedWindow height="639" width="907" x="696" y="64">
<folder
activePageID="com.company.client.ui.module.components.examples "
appearance="2" expanded="2">
<page content="com.company.client.ui.module.components.examples"
label="com.company.client.ui.module.components.examples.title " />
<page
content="com.company.client.ui.module.components.exampledetails "
label=" com.company.client.ui.module.components.exampledetails.title " />
<presentation
id="org.eclipse.ui.presentations.WorkbenchPresentationFactory ">
<part id="0" />
<part id="1" />
</presentation>
</folder>
</detachedWindow>


To create the folders in the main window is pretty simple, I just use
IFolderLayout folderLayout = pageLayout.createFolder(part, relationship,
Float.parseFloat(ratio), relative);

extracting the parameters from the XML. Then using
folderLayout.addView(module) to insert the view.

Is there something similar for adding a detached view?

Sorry for the poor formating on the XML, and thanks for the help.

--Ben
Re: Creating a detached view at startup [message #436750 is a reply to message #436500] Fri, 16 September 2005 21:09 Go to previous message
Ben Brown is currently offline Ben BrownFriend
Messages: 23
Registered: July 2009
Junior Member
Ben Brown wrote:
> I'm working on getting one of my apps to restore the workbench from a
> saved session. We've had the main workbench restoring its views for
> quite some time time but have not been able to figure out how to get a
> detached view to restore at startup.
>
> I'm saving the Memento from the workbench and have all the information
> on the previous workbench only don't know how to bring back the detached
> views
>
> The XML from the Memento for a main window folder looks something like this
>
> <info folder="true" part="org.eclipse.ui.internal.ViewStack@7589ae2a"
> ratio="0.5" ratioLeft="506" ratioRight="506" relationship="2"
> relative="org.eclipse.ui.editorss">
> <folder activePageID="com.company.client.ui.module.components.javadoc "
> appearance="2" expanded="2">
> <page content="com.company.client.ui.module.components.javadoc"
> label="com.company.client.ui.module.components.javadoc.title " />
> <presentation
> id="org.eclipse.ui.presentations.WorkbenchPresentationFactory ">
> <part id="0" />
> </presentation>
> </folder>
> </info>
>
> However, the XML for a detached window looks like
>
> <detachedWindow height="639" width="907" x="696" y="64">
> <folder
> activePageID="com.company.client.ui.module.components.examples "
> appearance="2" expanded="2">
> <page content="com.company.client.ui.module.components.examples"
> label="com.company.client.ui.module.components.examples.title " />
> <page
> content="com.company.client.ui.module.components.exampledetails "
> label=" com.company.client.ui.module.components.exampledetails.title " />
> <presentation
> id="org.eclipse.ui.presentations.WorkbenchPresentationFactory ">
> <part id="0" />
> <part id="1" />
> </presentation>
> </folder>
> </detachedWindow>
>
>
> To create the folders in the main window is pretty simple, I just use
> IFolderLayout folderLayout = pageLayout.createFolder(part, relationship,
> Float.parseFloat(ratio), relative);
>
> extracting the parameters from the XML. Then using
> folderLayout.addView(module) to insert the view.
>
> Is there something similar for adding a detached view?
>
> Sorry for the poor formating on the XML, and thanks for the help.
>
> --Ben

Well after a week of struggle it finially looks like I might have found
something that could help with the problem that I presented above.
There was a bug logged
https://bugs.eclipse.org/bugs/show_bug.cgi?id=70050 a little over a year
ago that exactly describes what I needed to do. However, the patch that
was put up is also a year old and for 3.0 instead of 3.1

I hope that this helps so people out there who are having the same
problem that I am. Hopefully, my request for an update on the bug gets
answered soon and some sort of permanent solution gets added to the API

--Ben
Previous Topic:Openning external files with the System Editor
Next Topic:ViewPart vs. EditorPart
Goto Forum:
  


Current Time: Fri Dec 06 17:20:58 GMT 2024

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

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

Back to the top