[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 ?
|
- From: Paul Webster <pwebster@xxxxxxxxxx>
- Date: Fri, 28 Oct 2005 09:32:14 -0400
- Newsgroups: eclipse.platform.rcp
- Organization: EclipseCorner
- User-agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20050929)
Genu George wrote:
You said ---
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.
---
can u give me an example how to do that ?
the unoptimized way is:
Say your action is opening the view:
ActionDelegate
public void run() {
Map options = TestPlugin.getOptions(MY_VIEW_ID);
options.clear();
options.put(VIEW_INFO, "SLOW_VIEW");
}
MyViewPart
public void init(IViewSite s) {
super(s);
Map options = TestPlugin.getOptions(MY_VIEW_ID);
goSlow = "SLOW_VIEW".equals(options.get(VIEW_INFO));
}
You'd have to make sure that the code is safe, but basically that's one way.
Later,
PW