@Override protected boolean doLazyInit() { try { mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController"); } catch (XulException e) { return false; } try { setRepReadOnly(this.repository.getRepositoryMeta().getRepositoryCapabilities().isReadOnly()); // Load the SWT Shell from the explorer dialog shell = ((SwtDialog) document.getElementById("repository-explorer-dialog")).getShell(); bf = new DefaultBindingFactory(); bf.setDocument(this.getXulDomContainer().getDocumentRoot()); if (bf != null) { createBindings(); } enableButtons(true, false, false); return true; } catch (Exception e) { if (mainController == null || !mainController.handleLostRepository(e)) { return false; } } return false; }
protected boolean doLazyInit() { // Load the SWT Shell from the explorer dialog shell = ((SwtDialog) document.getElementById("repository-explorer-dialog")).getShell(); enableButtons(true, false, false); bf = new SwtBindingFactory(); bf.setDocument(this.getXulDomContainer().getDocumentRoot()); if (bf != null) { createBindings(); } return true; }
/** * Initialize this dialog for the job entry instance provided. * * @param jobEntry The job entry this dialog supports. */ protected void init(E jobEntry) throws XulException { SwtXulLoader swtXulLoader = new SwtXulLoader(); // Register the settings manager so dialog position and size is restored swtXulLoader.setSettingsManager(XulSpoonSettingsManager.getInstance()); swtXulLoader.registerClassLoader(getClass().getClassLoader()); // Register Kettle's variable text box so we can reference it from XUL swtXulLoader.register("VARIABLETEXTBOX", ExtTextbox.class.getName()); swtXulLoader.setOuterContext(shell); // Load the XUL document with the dialog defined in it XulDomContainer container = swtXulLoader.loadXul(getXulFile(), bundle); // Create the controller with a default binding factory for the document we just loaded BindingFactory bf = new DefaultBindingFactory(); bf.setDocument(container.getDocumentRoot()); controller = createController(container, jobEntry, bf); container.addEventHandler(controller); // Load up the SWT-XUL runtime and initialize it with our container final XulRunner runner = new SwtXulRunner(); runner.addContainer(container); runner.initialize(); }