Home » Eclipse Projects » Rich Client Platform (RCP) » Force view to initialize before focus?
Force view to initialize before focus? [message #462289] |
Thu, 25 January 2007 17:58 |
Jason Messages: 45 Registered: July 2009 |
Member |
|
|
Ok, I'm fairly new to RCP, so this might an obvious question:
I've built my RCP app, which is pretty basic. I have several views that fill the left hand side of the screen that are arranged in a tab folder.
What I have noticed is that a view class is not actually initiated until I click on on the tab that actually gives it focus. That is probably normal lazy instantiation by design, but it actually creates a problem for me. My problem is that when I load that view, I do some initial loading of information that requires classes (via extension points) from other plug-ins that I've developed that feed into the view.
Because the View doesn't init() until I click on it, all of those external plug-ins get loaded when I click on the tab to give that view the focus. The problem with that is that I don't want the user to wait for the plug-ins to load when they click on the tab. Instead, when the app loads (and this view is part of the initial workbench), I want to initialize the view there so that the plug-ins are loaded at startup (perceived performance boost).
Is that possible? I can get into more detail if need be, but I tried to make the question as simplistic as possible...
P.S. Just in case someone else thinks of removing the lazy instantiation of the plug-ins, I can't do that. Not ALL of my plug-ins need to be loaded to contribute to this view. The number of plug-ins I need is variable to which perspective I'm in.
|
|
| |
Re: Force view to initialize before focus? [message #462359 is a reply to message #462289] |
Sat, 27 January 2007 17:36 |
Ilya Shinkarenko Messages: 22 Registered: July 2009 |
Junior Member |
|
|
Hi Jason,
in addition to Paul's comments: maybe it is worth looking at extension
point "org.eclipse.ui.startup"
Ilya
Jason wrote:
> Ok, I'm fairly new to RCP, so this might an obvious question:
>
> I've built my RCP app, which is pretty basic. I have several views that fill the left hand side of the screen that are arranged in a tab folder.
>
> What I have noticed is that a view class is not actually initiated until I click on on the tab that actually gives it focus. That is probably normal lazy instantiation by design, but it actually creates a problem for me. My problem is that when I load that view, I do some initial loading of information that requires classes (via extension points) from other plug-ins that I've developed that feed into the view.
>
> Because the View doesn't init() until I click on it, all of those external plug-ins get loaded when I click on the tab to give that view the focus. The problem with that is that I don't want the user to wait for the plug-ins to load when they click on the tab. Instead, when the app loads (and this view is part of the initial workbench), I want to initialize the view there so that the plug-ins are loaded at startup (perceived performance boost).
>
> Is that possible? I can get into more detail if need be, but I tried to make the question as simplistic as possible...
>
> P.S. Just in case someone else thinks of removing the lazy instantiation of the plug-ins, I can't do that. Not ALL of my plug-ins need to be loaded to contribute to this view. The number of plug-ins I need is variable to which perspective I'm in.
|
|
| | | |
Re: Force view to initialize before focus? [message #462585 is a reply to message #462289] |
Tue, 30 January 2007 21:58 |
Eclipse User |
|
|
|
Originally posted by: askme.fake.net
On Thu, 25 Jan 2007 12:58:31 -0500, Jason wrote:
> Ok, I'm fairly new to RCP, so this might an obvious question:
>
> I've built my RCP app, which is pretty basic. I have several views that
> fill the left hand side of the screen that are arranged in a tab folder.
>
> What I have noticed is that a view class is not actually initiated until
> I click on on the tab that actually gives it focus. That is probably
> normal lazy instantiation by design, but it actually creates a problem
> for me. My problem is that when I load that view, I do some initial
> loading of information that requires classes (via extension points) from
> other plug-ins that I've developed that feed into the view.
>
> Because the View doesn't init() until I click on it, all of those
> external plug-ins get loaded when I click on the tab to give that view
> the focus. The problem with that is that I don't want the user to wait
> for the plug-ins to load when they click on the tab. Instead, when the
> app loads (and this view is part of the initial workbench), I want to
> initialize the view there so that the plug-ins are loaded at startup
> (perceived performance boost).
>
> Is that possible? I can get into more detail if need be, but I tried to
> make the question as simplistic as possible...
>
> P.S. Just in case someone else thinks of removing the lazy instantiation
> of the plug-ins, I can't do that. Not ALL of my plug-ins need to be
> loaded to contribute to this view. The number of plug-ins I need is
> variable to which perspective I'm in.
Sure many ways. One of my views loads templates before it can show. I
load the data when the plugin is started as opposed to when when the view
is initialized. Your going to take the hit somewhere, you just need to
decide where.
Also you want to try and keep the hit out of the GUI thread so the user
wont have any GUI unresponsivenesss. Plus you can use a job so if your
user wonders WTH is all that disk thrashing, he can look at the progress
bar and see...
|
|
|
Goto Forum:
Current Time: Wed Sep 11 20:04:25 GMT 2024
Powered by FUDForum. Page generated in 0.04255 seconds
|