Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to open another view from a customized View class?
How to open another view from a customized View class? [message #444812] Tue, 21 February 2006 10:04 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: How to open another view from a customized View class? [message #444846 is a reply to message #444812] Wed, 22 February 2006 08:49 Go to previous message
Eclipse UserFriend
In views, your view site is your "link" back to the framework for most
things (this will become even more important in 3.2 when the concept of
local services are introduced).

In your view, you can use getSite().getPage() to get the page you belong to.

Later,
PW
Previous Topic:RCP and Java Webstart
Next Topic:3.2m5 "os x" plugin dir?
Goto Forum:
  


Current Time: Sun Aug 31 00:07:45 EDT 2025

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

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

Back to the top