createPartControl [message #467018] |
Mon, 23 January 2006 01:25 |
Eclipse User |
|
|
|
Originally posted by: mohansl.gmail.com
Hi,
I wish to call a view as follows(basically to set view content and open
it in performFinish of wizard) :
IWorkbenchWindow wdc =
PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = wdc.getActivePage();
MyView myview = new MyView(viewContent);
myview.createPartControl(parent);
IViewPart part =(IViewPart) myview.getViewSite() ;
page.activate(part) ;
However how do I set the 'parent' in myview.createPartControl(parent)?
Regards,
mohansl
|
|
|
|
Re: createPartControl [message #467022 is a reply to message #467020] |
Mon, 23 January 2006 03:34 |
Eclipse User |
|
|
|
Originally posted by: mohansl.gmail.com
Hi,
I could do that, however I wish to set the view content from the wizard
via the view constructor and then show the view, So how do I go about
doing it?
Regards,
mohansl
|
|
|
Re: createPartControl [message #467026 is a reply to message #467018] |
Mon, 23 January 2006 15:12 |
|
mohansl wrote:
>
> Hi,
> I wish to call a view as follows(basically to set view content and
> open it in performFinish of wizard) :
>
> IWorkbenchWindow wdc =
> PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> IWorkbenchPage page = wdc.getActivePage();
>
> MyView myview = new MyView(viewContent);
> myview.createPartControl(parent);
> IViewPart part =(IViewPart) myview.getViewSite() ;
> page.activate(part) ;
>
> However how do I set the 'parent' in myview.createPartControl(parent)?
The short answer is you can't. Views don't work that way.
Your best bet is to have your view start up with a blank screen or
message (like the Content Outline view) and respond to another message
that causes it to update it's contents. ex:
IViewPart part = page.showView("id");
// the view now updates its composites
part.setViewContents(viewContent);
page.activate(part); // probably not necessary
The other (less good :-) option would be to have your performFinish()
put something in a singleton somewhere, and have your view always check
for information in it's IViewPart#init(*) method when it starts up.
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03367 seconds