How to open another view from a customized View class? [message #444812] |
Tue, 21 February 2006 10:04  |
Eclipse User |
|
|
|
Originally posted by: gaoyuxiang.gmail.com
I'm trying to implement an RCP application with Eclipse Forms.
In my view class, I created an org.eclipse.ui.forms.widgets.Hyperlink,
registered a Listener with it, and in that Listener's run() method I
tried to find a way to open another view.
Read somewhere this can be done in the following manner, where "window"
refers an instance of IWorkbenchWindow:
window.getActivePage().showView(viewId, Integer.toString(instanceNum++),
IWorkbenchPage.VIEW_ACTIVATE);
But it seems within the View class, there's no easily noticable way to
get either the IWorkbenchWindow instance, or the IWorkbenchPage instance
that could be accessed by calling getActivePage() on IWorkbenchWindow.
Can anyone help me out? Am I missing something here?
Thanks & Regards,
Sean
|
|
|
Re: How to open another view from a customized View class? [message #444815 is a reply to message #444812] |
Tue, 21 February 2006 10:14   |
Eclipse User |
|
|
|
I don't whether this ok to do so - but it works ;-)
YourPlugin.getDefault().getWorkbench().getActiveWorkbenchWin dow()
Regards,
Stefan
Sean GAO schrieb:
> I'm trying to implement an RCP application with Eclipse Forms.
>
> In my view class, I created an org.eclipse.ui.forms.widgets.Hyperlink,
> registered a Listener with it, and in that Listener's run() method I
> tried to find a way to open another view.
>
> Read somewhere this can be done in the following manner, where "window"
> refers an instance of IWorkbenchWindow:
>
> window.getActivePage().showView(viewId, Integer.toString(instanceNum++),
> IWorkbenchPage.VIEW_ACTIVATE);
>
> But it seems within the View class, there's no easily noticable way to
> get either the IWorkbenchWindow instance, or the IWorkbenchPage instance
> that could be accessed by calling getActivePage() on IWorkbenchWindow.
> Can anyone help me out? Am I missing something here?
>
>
>
> Thanks & Regards,
> Sean
|
|
|
Re: How to open another view from a customized View class? [message #444818 is a reply to message #444815] |
Tue, 21 February 2006 10:27   |
Eclipse User |
|
|
|
Originally posted by: gaoyuxiang.gmail.com
Thank you so much for the info. Yes, it works!
Regards,
Sean
Stefan Zugal wrote:
> I don't whether this ok to do so - but it works ;-)
>
> YourPlugin.getDefault().getWorkbench().getActiveWorkbenchWin dow()
>
> Regards,
> Stefan
>
> Sean GAO schrieb:
>> I'm trying to implement an RCP application with Eclipse Forms.
>>
>> In my view class, I created an org.eclipse.ui.forms.widgets.Hyperlink,
>> registered a Listener with it, and in that Listener's run() method I
>> tried to find a way to open another view.
>>
>> Read somewhere this can be done in the following manner, where
>> "window" refers an instance of IWorkbenchWindow:
>>
>> window.getActivePage().showView(viewId,
>> Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
>>
>> But it seems within the View class, there's no easily noticable way to
>> get either the IWorkbenchWindow instance, or the IWorkbenchPage
>> instance that could be accessed by calling getActivePage() on
>> IWorkbenchWindow. Can anyone help me out? Am I missing something here?
>>
>>
>>
>> Thanks & Regards,
>> Sean
|
|
|
|
Powered by
FUDForum. Page generated in 0.04053 seconds