[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: How do i initialize a ViewPart ?

Oh ...

Because of the way views are created (reference counted from a view factory) they're constructed and initialized by the time IWorkbenchPage#showView() returns your IViewPart. I see what you mean.

You have 2 options:

1. behave similarly to the Content Outline ... allow the view to create in a default state, and once you have the view call myView.setContents(MyContents) and allow it to be updated then.

2. Store the initialization information for your view somewhere else ... like in the plugin. Then in IViewPart#init() method go back to your plugin and initialize the internal variable from the plugin.

Later,
PW