Disable lazy loading of pages [message #900055] |
Fri, 03 August 2012 13:25  |
Eclipse User |
|
|
|
Hi,
I have an Eclipse editor which has several form pages each of whom have their own controls.
When my plugin starts up (ie. when the user opens it) I need to be able to actually create the form content on each form page so that I can use the EMF bindings they create - and this has to be done once which is why I want them done on editor startup, not when a page is opened.
Does anyone know if it's possible to disable the lazy loading aspect of FormPages so that all the controls are created on startup?
Thanks.
|
|
|
|
|
|
|
|
Re: Disable lazy loading of pages [message #900356 is a reply to message #900350] |
Mon, 06 August 2012 11:26  |
Eclipse User |
|
|
|
I had no issues when I added pages to the editor this way. I put a system.out statement in the createFormContent(...) method of the FormPage and it prints out before the tab is selected, which indicates the controls where created before the tab was ever selected.
@Override protected void addPages() {
try {
addPage(new WelcomePage (this, "welcome", "Welcome");
addPage(1, new OverviewPage(this, "overview", "Overview"), OverviewEditorInput.INSTANCE);
...
} catch (PartInitException e) {
Logger.INSTANCE.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
}
}
I then invoke it this way:
FormEditor editor = (FormEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(DashboardEditorInput.INSTANCE, AwsDashboardEditor.ID);
editor.setActivePage(activePageID);
I can fool around with it later when I get home to see if I can replicate the StackOverflowError you're getting.
|
|
|
Powered by
FUDForum. Page generated in 0.07388 seconds