Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to open identical views side by side ?
How to open identical views side by side ? [message #496917] Wed, 11 November 2009 18:02 Go to next message
Marc T. is currently offline Marc T.Friend
Messages: 17
Registered: November 2009
Junior Member
Hello,

I have to open identical views (allowMultiple=true). Since the user should drag and drop items between those views, I would like to open them side by side, but they always open stacked in a folder.

I've tried to add a standalone Placeholder with a joker:

String editorArea = layout.getEditorArea();
String viewID="myid";
layout.addStandaloneViewPlaceholder(viewID + ":*",
IPageLayout.RIGHT, 0.25f, editorArea, true);

I've tried to add a perspectiveExtension:


<perspectiveExtension
targetID="perspectiveID">
<view
id="myid:*"
minimized="false"
ratio="0.25"
relationship="right"
relative="org.eclipse.ui.editorss"
standalone="true"
visible="false">
</view>
</perspectiveExtension>

I'm opening a new view with

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage()
.showView("myid",getSeondaryID(),WorkbenchPage.VIEW_ACTIVATE);


Nothings helped. All views opens in the same folder, the new view always on top of the other. So the user must always rearrange the views to bring them side by side for using drag & drop.

Any hint to solve this problem will be appreciated !!!

Thanks

Marc

[Updated on: Thu, 12 November 2009 07:16]

Report message to a moderator

Re: How to open identical view side by side ? [message #497145 is a reply to message #496917] Thu, 12 November 2009 15:57 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi Marc,

You have to explicitely put a view in a location. If you need only two views,
consider subclassing the view and make two distinct id's. You might even try
to use the same view twice with different ID's

Given the sample "RCP application with a view", I have specified view
multiple=true in the plugin.xml and then I changed the perspective class like
so:

package perspectivetest;

import org.eclipse.ui.IPageLayout;

public class Perspective implements IPerspectiveFactory {

public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
layout.setFixed(true);

>> this was added

layout.addStandaloneView(View.ID + ":0", false, IPageLayout.LEFT, 0.5f,
editorArea);
layout.addStandaloneView(View.ID + ":1", false, IPageLayout.RIGHT, 0.5f,
editorArea);
}

}

This works nicely.

Best regards,

Wim


> Hello,
>
> I have to open identical views (allowMultiple=true). Since the user should
drag and drop items between those views, I would like to open them side by
side, but they always open stacked in a folder.
>
> I've tried to add a standalone Placeholder with a joker:
>
> String editorArea = layout.getEditorArea();
> String viewID="myid";
> layout.addStandaloneViewPlaceholder(viewID + ":*",
> IPageLayout.RIGHT, 0.25f, editorArea, true);
>
> I've tried to add a perspectiveExtension:
>
>
> <perspectiveExtension
> targetID="perspectiveID">
> <view
> id="myid:*"
> minimized="false"
> ratio="0.25"
> relationship="right"
> relative="org.eclipse.ui.editorss"
> standalone="true"
> visible="false">
> </view>
> </perspectiveExtension>
>
> I'm opening a new view with
>
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage()
> showView("myid",getSeondaryID(),WorkbenchPage.VIEW_ACTIVATE);
>
>
> Nothings helped. All views opens in the same folder, the new view always on
top of the other. So the user must always rearrange the views to bring them
side by side for using drag & drop.
>
> Any hint to solve this problem will be appreciated !!!
>
> Thanks
>
> Marc
Re: How to open identical views side by side ? [message #497446 is a reply to message #496917] Fri, 13 November 2009 06:33 Go to previous message
Marc T. is currently offline Marc T.Friend
Messages: 17
Registered: November 2009
Junior Member
Hello,

thanks for the reply.

There may be more than just 2 views. But from the program design, there is a kind of main-view and one or more subviews.

Since the most drag&drop operations will be between the main- and the subviews, I guess, I will do as you suggest and use two different view IDs, one for the master and one for the sub-views.

This way at least the subviews will be opened beside the master view allowing immediately starting d&d operations.

Thanks

Marc
Previous Topic:Resource doesn't exist
Next Topic:Custom Splash window HELP!
Goto Forum:
  


Current Time: Fri Apr 19 21:58:03 GMT 2024

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

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

Back to the top