how to display multiple instances of same form? [message #336922] |
Tue, 14 July 2009 03:48  |
Eclipse User |
|
|
|
Originally posted by: yoduderoo.netscape.net
Hi,
I display an Eclipse form, works fine. Then I try to display the same
form with different data but the second form does not appear. No
exception thrown. I close the first form and try again. The form
displays with the different data. It is as though the form were some
kind of singleton.
I would like to have multiple form views opened. The same form class,
but populated with its own data.
Is that possible?
Here is the corresponding snippet from plugin.xml :
<extension point="org.eclipse.ui.views">
<view allowMultiple="true"
class="test.ResultForm"
icon="icons/view.gif"
category="test.category"
name="Import Result"
id="ResultForm"/>
</extension>
In my perspective factory, I create placeholder for the view:
public void createInitialLayout(IPageLayout layout) {
// ...
// import results
layout.addPlaceholder(MY_VIEWID,
IPageLayout.TOP,
0.60f,
IPageLayout.ID_EDITOR_AREA);
// ...
}
Any tips?
Thanks, yo
|
|
|
Re: how to display multiple instances of same form? [message #336936 is a reply to message #336922] |
Tue, 14 July 2009 15:36  |
Eclipse User |
|
|
|
Originally posted by: yoduderoo.netscape.net
Dear Self,
Using showView() with secondaryId solves the problem:
view = page.showView(MY_VIEWID,
"id-1",
IWorkbenchPage.VIEW_CREATE);
Thanks,
Yo
Yo wrote:
> Hi,
> I display an Eclipse form, works fine. Then I try to display the same
> form with different data but the second form does not appear. No
> exception thrown. I close the first form and try again. The form
> displays with the different data. It is as though the form were some
> kind of singleton.
>
> I would like to have multiple form views opened. The same form class,
> but populated with its own data.
>
> Is that possible?
>
> Here is the corresponding snippet from plugin.xml :
>
> <extension point="org.eclipse.ui.views">
> <view allowMultiple="true"
> class="test.ResultForm"
> icon="icons/view.gif"
> category="test.category"
> name="Import Result"
> id="ResultForm"/>
> </extension>
>
> In my perspective factory, I create placeholder for the view:
>
> public void createInitialLayout(IPageLayout layout) {
> // ...
>
> // import results
> layout.addPlaceholder(MY_VIEWID,
> IPageLayout.TOP,
> 0.60f,
> IPageLayout.ID_EDITOR_AREA);
>
> // ...
> }
> Any tips?
>
> Thanks, yo
|
|
|
Powered by
FUDForum. Page generated in 0.05488 seconds