Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » how to display multiple instances of same form?
how to display multiple instances of same form? [message #336922] Tue, 14 July 2009 07:48 Go to next message
Eclipse UserFriend
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 19:36 Go to previous message
Eclipse UserFriend
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
Previous Topic:working with text positions
Next Topic:Other views
Goto Forum:
  


Current Time: Fri Mar 29 02:29:42 GMT 2024

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

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

Back to the top