Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » same view multiple times in perspective
same view multiple times in perspective [message #51125] Thu, 11 October 2007 09:29 Go to next message
Eclipse UserFriend
Originally posted by: s5824917.inf.tu-dresden.de

hello again,

I want to display a view multiple times in a perspective.

For a single view I simply create a folder and use the AddView(String
viewId) function to show that view. But
if I use the same view for the second folder it won't show up. No errors
show up though.


code inside the perspective.java... createInitialLayout...

String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible( false );

IFolderLayout topLeft = layout.createFolder(
"left",IPageLayout.LEFT,0.25f,editorArea );
topLeft.addView( "testview" );

IFolderLayout topRight = layout.createFolder(
"right",IPageLayout.RIGHT,0.70f,editorArea );
topRight.addPlaceholder(viewId + ":*");
topRight.addView( "testview" );



So I looked for a solution and found that you have to use some secondary ID.

IWorkbenchPage page = ...;
String id = "org.eclipse.faq.examples.BooksView";
page.showView(id, "1", IWorkbenchPage.VIEW_VISIBLE);
page.showView(id, "2", IWorkbenchPage.VIEW_ACTIVATE);


But I can't find a way to apply that to my code inside the perspective.java
Any hints would be appreciated :)
Re: same view multiple times in perspective [message #52305 is a reply to message #51125] Wed, 17 October 2007 10:59 Go to previous message
Eclipse UserFriend
Originally posted by: fappel.innoopract.com

Hi,

here is a snippet from the RAP demo which shows how multiple views normally
opened within actions

browserAction = new Action() {

public void run() {
browserIndex++;
try {
window.getActivePage()
.showView( "org.eclipse.rap.demo.DemoBrowserViewPart",
String.valueOf( browserIndex ),
IWorkbenchPage.VIEW_ACTIVATE );
} catch( PartInitException e ) {
e.printStackTrace();
}
}
};

Unfortunately I'm not aware of any method how to do this in the
IPerspectiveFactory. But I opened the multiple views in the
WorkbenchWindowAdviser#postWindowOpen() method which worked fine for me.
Maybe that will do the trick for you too.

Note that the view's extension declaration must set the flag multiple to
true.

Hope that helps

Ciao
Frank


"Stefan Lindner" <s5824917@inf.tu-dresden.de> schrieb im Newsbeitrag
news:fekqe1$n2o$1@build.eclipse.org...
> hello again,
>
> I want to display a view multiple times in a perspective.
>
> For a single view I simply create a folder and use the AddView(String
> viewId) function to show that view. But
> if I use the same view for the second folder it won't show up. No errors
> show up though.
>
>
> code inside the perspective.java... createInitialLayout...
>
> String editorArea = layout.getEditorArea();
> layout.setEditorAreaVisible( false );
>
> IFolderLayout topLeft = layout.createFolder(
> "left",IPageLayout.LEFT,0.25f,editorArea );
> topLeft.addView( "testview" );
>
> IFolderLayout topRight = layout.createFolder(
> "right",IPageLayout.RIGHT,0.70f,editorArea );
> topRight.addPlaceholder(viewId + ":*");
> topRight.addView( "testview" );
>
>
>
> So I looked for a solution and found that you have to use some secondary
> ID.
>
> IWorkbenchPage page = ...;
> String id = "org.eclipse.faq.examples.BooksView";
> page.showView(id, "1", IWorkbenchPage.VIEW_VISIBLE);
> page.showView(id, "2", IWorkbenchPage.VIEW_ACTIVATE);
>
>
> But I can't find a way to apply that to my code inside the
> perspective.java
> Any hints would be appreciated :)
>
Previous Topic:Qx not Defined
Next Topic:RAP example, looking like a website
Goto Forum:
  


Current Time: Tue Dec 03 17:18:08 GMT 2024

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

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

Back to the top