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 03:48 Go to next message
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 Go to previous message
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
Previous Topic:working with text positions
Next Topic:Other views
Goto Forum:
  


Current Time: Wed Jul 23 20:22:48 EDT 2014

Powered by FUDForum. Page generated in 0.01460 seconds