Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Creating and initializing a view based on some initial data
Creating and initializing a view based on some initial data [message #990197] Tue, 11 December 2012 06:30 Go to previous message
Levente Mising name is currently offline Levente Mising name
Messages: 3
Registered: December 2010
Junior Member
Dear gurus,

When a view is created, is there a way to pass in some information based on which it can initialize its component widgets?

For example, in my application I am trying to create multiple instances of the same view, each instance showing information about a different product. One of the widgets in this view is a ComboViewer which displays the product type (stock, future, option, etc).

I would like to initialize the selection in the ComboViewer to the type of the product that is used to initialize the view.

So far I was only able to do this as a two-step process:

1. Create/show the view using IWorkbenchPage.showView(viewId, secondaryId, IWorkbenchPage.VIEW_ACTIVATE) which returns a IViewPart

2. Cast the reurned IViewPart to my view's type and explicitly call an initialization method on the view:

((MyViewType) viewPart).initialize(myProductObject)

Is there any way to do this in a single step somehow, by specifying the myProductObject to use at view creation time? Is there any way in the view's createPartControl() method to retrieve this initialization data?

I am looking for a solution that does not use a static registry.

Best regards,
Levente
 
Read Message
Read Message
Previous Topic:Evaluate the activeWhen expression at runtime
Next Topic:Creating a MultiPage Editor from a "Open Editor"
Goto Forum:
  


Current Time: Tue May 21 22:54:54 EDT 2013

Powered by FUDForum. Page generated in 0.01846 seconds