Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to keep view open when changing perspective?
How to keep view open when changing perspective? [message #484405] Mon, 07 September 2009 12:12 Go to next message
blutkind  is currently offline blutkind Friend
Messages: 25
Registered: July 2009
Junior Member
Hi,

I have two perspective that should show the same view at the bottom part
of the window. In the 'createInitialLayout()' method of both perspectives
I define a standalone placeholder like this:

layout.addStandaloneViewPlaceholder(InfoObjectsTableView.ID + "*:*",
IPageLayout.BOTTOM, 0.6f, editorAreaID, true);

However, when I open the view in one of the perspectives and then switch
to another - the view doesn't stay open. How can I make the view stay open
when a perspective is changed?

Thanks in advance,
Stanislav
Re: How to keep view open when changing perspective? [message #484414 is a reply to message #484405] Mon, 07 September 2009 12:38 Go to previous messageGo to next message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
On Mon, 07 Sep 2009 12:12:43 +0000, Stanislav Vodetskyi wrote:
> However, when I open the view in one of the perspectives and then switch
> to another - the view doesn't stay open. How can I make the view stay
> open when a perspective is changed?

You could try making your view a stickyView via the plugin.xml file.

Remy
Re: How to keep view open when changing perspective? [message #484440 is a reply to message #484414] Mon, 07 September 2009 13:17 Go to previous messageGo to next message
blutkind  is currently offline blutkind Friend
Messages: 25
Registered: July 2009
Junior Member
Thanks for reply.

I tried to use stickyView, but it didn't help - maybe I did something
wrong, though.
I already had all perspectives declared under "org.eclipse.ui.views"
extension point:
<view allowMultiple="true"
class="a.class.Name"
icon="icons/icon.gif"
id="a.class.Name">
</view>
So I added following declaration:

<stickyView
id=" de.ids.acos.et.client.views.InfoObjectsTableViewMeasuredValu e ">
</stickyView>

but it didn't work. I also tried changing first declaration from view to
stickyView, but got PartInitException.
Am I doing something wrong?

/Stanislav
Re: How to keep view open when changing perspective? [message #507259 is a reply to message #484440] Tue, 12 January 2010 16:34 Go to previous message
John Ormerod is currently offline John OrmerodFriend
Messages: 39
Registered: January 2010
Member
Hi Stanislav

This might be a bit late! I've just been searching for an answer to this. There doesn't seem to be a definite one, but as the following worked for me, I thought it might help anyone looking for an answer.

In your WorkbenchWindowAdvisor#postWindowOpen() add the following:

try {
configurer.getWindow().getActivePage().showView("id-of-sticky-view ");
} catch (PartInitException e) {
// Handle exception
}

BTW, don't attempt tp open the sticky view in any createInitialLayout() method, since this view is not associated with a perspective.

Regards, John
Previous Topic:Display problem on increasing font size
Next Topic:Welcome page for a single perspective
Goto Forum:
  


Current Time: Tue Mar 19 03:49:54 GMT 2024

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

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

Back to the top