How to open identical views side by side ? [message #496917] |
Wed, 11 November 2009 18:02 |
Marc T. 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 |
Wim Jongman 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03230 seconds