private Shell getShell() { Object obj = document.getRootElement().getManagedObject(); Shell parent; if ( obj instanceof Shell ) { parent = (Shell) obj; } else { parent = ( (Composite) obj ).getShell(); } if ( parent == null ) { throw new IllegalStateException( "Could not get Shell reference from Xul Dialog Tree." ); } return parent; }
private boolean windowClosed() { boolean closedWindow = true; XulComponent window = document.getElementById( "general-datasource-window" ); if ( window == null ) { // window must be root window = document.getRootElement(); } if ( window instanceof XulWindow ) { closedWindow = ( (XulWindow) window ).isClosed(); } return closedWindow; }
private void close() { XulComponent window = document.getElementById( "general-datasource-window" ); if ( window == null ) { // window must be root window = document.getRootElement(); } if ( window instanceof XulDialog ) { ( (XulDialog) window ).hide(); } else if ( window instanceof XulWindow ) { ( (XulWindow) window ).close(); } }
public void init() { xulDialog = ( (XulDialog) getXulDomContainer().getDocumentRoot().getRootElement() ); if ( bf != null ) { bind(); } }
private void setReadOnly( boolean readonly ) { // set the readonly status of EVERYTHING! traverseDomSetReadOnly( document.getRootElement(), readonly ); if ( noticeLabel != null ) { noticeLabel.setVisible( readonly ); } if ( readonly ) { // now turn back on the cancel and test buttons if ( cancelButton != null ) { cancelButton.setDisabled( false ); } if ( testButton != null ) { testButton.setDisabled( false ); } noticeLabel.setValue( Messages.getString( "DatabaseDialog.label.ConnectionIsReadOnly" ) ); } }
protected void initializeXul( XulLoader loader, BindingFactory bindingFactory, XulRunner runner, Object parent ) throws XulException { bf = bindingFactory; this.runner = runner; loader.registerClassLoader( getClass().getClassLoader() ); loader.setSettingsManager( getSettingsManager() ); loader.setOuterContext( parent ); container = loader.loadXul( xulFile, getResourceBundle() ); bf.setDocument( container.getDocumentRoot() ); for ( XulEventHandler h : getEventHandlers() ) { container.addEventHandler( h ); } this.runner.addContainer( container ); // try and get the dialog xulDialog = (XulDialog) container.getDocumentRoot().getRootElement(); runner.initialize(); }
protected void initializeXul( XulLoader loader, BindingFactory bindingFactory, XulRunner runner, Object parent ) throws XulException { bf = bindingFactory; this.runner = runner; loader.registerClassLoader( getClass().getClassLoader() ); loader.setSettingsManager( getSettingsManager() ); loader.setOuterContext( parent ); container = loader.loadXul( xulFile, getResourceBundle() ); bf.setDocument( container.getDocumentRoot() ); for ( XulEventHandler h : getEventHandlers() ) { container.addEventHandler( h ); } this.runner.addContainer( container ); // try and get the dialog xulDialog = (XulDialog) container.getDocumentRoot().getRootElement(); runner.initialize(); }
xulDialogComponent = (XulDialog) container.getDocumentRoot().getRootElement();
(XulTree) xulDialogComponent.getDocument().getRootElement().getElementById( "options-parameter-tree" ); tree.getRootChildren().removeAll();
private void connectionButtonActionPerformed(ActionEvent evt) { if (connectionDialog == null) { dbMeta = getDbMeta(null); connectionDialogController = new DataHandler(); connectionDialogController.setName("dataHandler"); XulDomContainer container = null; try { XulLoader loader = new SwingXulLoader(); container = loader.loadXul( DatabaseConnectionDialog.DIALOG_DEFINITION_FILE, Messages.getBundle()); } catch (XulException e) { throw new RuntimeException("Xul failed to initialize", e); } container.addEventHandler(connectionDialogController); connectionDialogController.loadConnectionData(); connectionDialogController.setData(dbMeta); connectionDialog = (XulDialog) container.getDocumentRoot() .getRootElement(); } connectionDialog.show(); dbMeta = (DatabaseMeta) connectionDialogController.getData(); if (dbMeta.hasChanged()) { dbMeta.clearChanged(); syncToWorkspace(dbMeta); // Enforces the JDBC preferences entered throughout all schemas // currently opened in the workbench. resetWorkbench(); } }
public void help() { XulDialog xulDialog = (XulDialog) getXulDomContainer().getDocumentRoot().getRootElement().getFirstChild(); Shell shell = (Shell) xulDialog.getRootObject(); PluginInterface plugin = PluginRegistry.getInstance().findPluginWithId( JobEntryPluginType.class, jobEntry.getPluginId() ); HelpUtils.openHelpDialog( shell, plugin ); }
XulRoot xulDialog = (XulRoot) getXulDomContainer().getDocumentRoot().getRootElement(); Shell shell = (Shell) xulDialog.getRootObject(); new ErrorDialog( shell, "Error", "Unable to populate Driver Class list", e );
public void xulLoaded( GwtXulRunner gwtXulRunner ) { IModelerMessages messages = new GwtModelerMessages( (ResourceBundle) gwtXulRunner.getXulDomContainers().get( 0 ).getResourceBundles().get( 0 ) ); BogoPojo bogo = new BogoPojo(); XulDomContainer container = gwtXulRunner.getXulDomContainers().get( 0 ); GwtModelerWorkspaceHelper helper = new GwtModelerWorkspaceHelper(); ModelerWorkspace model = new ModelerWorkspace( helper ); model.setDomain( this.domain ); ModelerController controller = new ModelerController( model ); controller.setWorkspaceHelper( helper ); try { ModelerMessagesHolder.setMessages( messages ); } catch ( IllegalStateException e ) { // ignore, it was already set by someone else boolean ignore = true; } BindingFactory bf = new GwtBindingFactory( container.getDocumentRoot() ); controller.setBindingFactory( bf ); container.addEventHandler( controller ); ModelerUiHelper.configureControllers( container, model, bf, controller, new ColResolverController() ); RootPanel.get().add( (Widget) container.getDocumentRoot().getRootElement().getManagedObject() ); try { gwtXulRunner.initialize(); } catch ( XulException e ) { e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates. } }