public XulPreviewRowsController( Shell aShell, DatabaseMeta aDatabaseMeta, String aSchema, String aTable, int aLimit ) { this.shell = aShell; this.databaseMeta = aDatabaseMeta; this.schema = aSchema; this.table = aTable; this.limit = aLimit; this.bf = new DefaultBindingFactory(); }
public XulStepFieldsController( Shell aShell, DatabaseMeta aDatabaseMeta, String schemaTableCombo, RowMetaInterface anInput ) { this.shell = aShell; this.databaseMeta = aDatabaseMeta; this.schemaTableCombo = schemaTableCombo; this.bf = new DefaultBindingFactory(); this.model = new XulStepFieldsModel(); this.rowMetaInterface = anInput; }
public XulDatabaseExplorerController( Shell shell, DatabaseMeta databaseMeta, List<DatabaseMeta> databases, boolean aLook ) { this.model = new XulDatabaseExplorerModel( databaseMeta ); this.shell = shell; this.bf = new DefaultBindingFactory(); this.databases = databases; this.dbcache = DBCache.getInstance(); this.isJustLook = aLook; }
protected FileOverwriteDialogController( XulDomContainer container, List<UIRepositoryObject> objects ) { this.container = container; this.objects = new UIRepositoryObjectsList( objects ); this.dialog = (XulDialog) this.container.getDocumentRoot().getElementById( "file-overwrite-dialog" ); this.bf = new DefaultBindingFactory(); }
public void init() throws ControllerInitializationException { bf = new DefaultBindingFactory(); bf.setDocument( this.getXulDomContainer().getDocumentRoot() ); try { messageBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ } catch ( Throwable th ) { throw new ControllerInitializationException( th ); } model = new RepositoryConfigModel(); if ( bf != null ) { createBindings(); } initializeModel(); }
public void init( Repository repository ) throws ControllerInitializationException { try { if ( repository.hasService( IAbsSecurityProvider.class ) ) { service = (IAbsSecurityProvider) repository.getService( IAbsSecurityProvider.class ); bf = new DefaultBindingFactory(); bf.setDocument( this.getXulDomContainer().getDocumentRoot() ); if ( bf != null ) { createBindings(); } setAllowed( allowedActionsContains( service, IAbsSecurityProvider.CREATE_CONTENT_ACTION ) ); } } catch ( KettleException e ) { throw new ControllerInitializationException( e ); } }
public RepositoriesDialog( Shell shell, String preferredRepositoryName, ILoginCallback callback ) { try { this.callback = callback; KettleXulLoader xulLoader = new KettleXulLoader(); xulLoader.setOuterContext( shell ); xulLoader.setSettingsManager( XulSpoonSettingsManager.getInstance() ); container = xulLoader.loadXul( "org/pentaho/di/ui/repository/xul/repositories.xul", resourceBundle ); final XulRunner runner = new SwtXulRunner(); runner.addContainer( container ); BindingFactory bf = new DefaultBindingFactory(); bf.setDocument( container.getDocumentRoot() ); repositoriesController.setBindingFactory( bf ); repositoriesController.setPreferredRepositoryName( preferredRepositoryName ); repositoriesController.setMessages( resourceBundle ); repositoriesController.setCallback( callback ); repositoriesController.setShell( getShell() ); container.addEventHandler( repositoriesController ); try { runner.initialize(); } catch ( XulException e ) { SpoonFactory.getInstance().messageBox( e.getLocalizedMessage(), "Service Initialization Failed", false, Const.ERROR ); log.error( resourceBundle.getString( "RepositoryLoginDialog.ErrorStartingXulApplication" ), e ); } } catch ( XulException e ) { log.error( resourceBundle.getString( "RepositoryLoginDialog.ErrorLoadingXulApplication" ), e ); } }
public void init( Repository repository ) throws ControllerInitializationException { try { this.repository = repository; mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" ); //$NON-NLS-1$ browseController = (BrowseController) this.getXulDomContainer().getEventHandler( "browseController" ); //$NON-NLS-1$ bf = new DefaultBindingFactory(); bf.setDocument( this.getXulDomContainer().getDocumentRoot() ); messageBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ createBindings(); } catch ( Exception e ) { if ( mainController == null || !mainController.handleLostRepository( e ) ) { throw new ControllerInitializationException( e ); } } }
@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; }
XulDomContainer container = getXulDomContainer(); bindingFactory = new DefaultBindingFactory(); bindingFactory.setDocument( container.getDocumentRoot() );
public void init( Repository rep ) throws ControllerInitializationException { try { if ( rep != null && rep.hasService( ILockService.class ) ) { repository = rep; service = (ILockService) rep.getService( ILockService.class ); } else { throw new ControllerInitializationException( BaseMessages.getString( PKG, "RepositoryLockController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE", ILockService.class ) ); //$NON-NLS-1$ } bindingFactory = new DefaultBindingFactory(); bindingFactory.setDocument( getXulDomContainer().getDocumentRoot() ); XulEventHandler eventHandler = getXulDomContainer().getEventHandler( "browseController" ); //$NON-NLS-1$ if ( eventHandler instanceof BrowseController ) { browseController = (BrowseController) eventHandler; } // Disable row dragging if it is locked and the user does not have permissions fileTable = (XulTree) getXulDomContainer().getDocumentRoot().getElementById( "file-table" ); //$NON-NLS-1$ folderTree = (XulTree) document.getElementById( "folder-tree" ); //$NON-NLS-1$ lockFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById( "file-context-lock" ); //$NON-NLS-1$ deleteFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById( "file-context-delete" ); //$NON-NLS-1$ renameFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById( "file-context-rename" ); //$NON-NLS-1$ messageBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ createBindings(); } catch ( Exception e ) { throw new RuntimeException( e ); } }
protected void init( Repository rep ) throws Exception { if ( rep != null && rep.hasService( RepositorySecurityProvider.class ) ) { service = (RepositorySecurityProvider) rep.getService( RepositorySecurityProvider.class ); } else { throw new ControllerInitializationException( BaseMessages.getString( PKG, "PermissionsController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE", RepositorySecurityManager.class ) ); //$NON-NLS-1$ } messageBox = (XulMessageBox) document.createElement( "messagebox" );//$NON-NLS-1$ viewAclsModel = new UIRepositoryObjectAcls(); manageAclsModel = new UIRepositoryObjectAclModel( viewAclsModel ); bf = new DefaultBindingFactory(); bf.setDocument( this.getXulDomContainer().getDocumentRoot() ); mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" ); confirmBox = (XulConfirmBox) document.createElement( "confirmbox" );//$NON-NLS-1$ confirmBox.setTitle( BaseMessages.getString( PKG, "PermissionsController.RemoveAclWarning" ) ); //$NON-NLS-1$ confirmBox.setMessage( BaseMessages.getString( PKG, "PermissionsController.RemoveAclWarningText" ) ); //$NON-NLS-1$ confirmBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); //$NON-NLS-1$ confirmBox.setCancelLabel( BaseMessages.getString( PKG, "Dialog.Cancel" ) ); //$NON-NLS-1$ confirmBox.addDialogCallback( new XulDialogCallback<Object>() { public void onClose( XulComponent sender, Status returnCode, Object retVal ) { if ( returnCode == Status.ACCEPT ) { viewAclsModel.removeSelectedAcls(); } } public void onError( XulComponent sender, Throwable t ) { } } ); }
BindingFactory bf = new DefaultBindingFactory(); bf.setDocument( mainSpoonContainer.getDocumentRoot() ); mainSpoonContainer.addEventHandler( this );
/** * 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(); }
/** * Initialize this dialog for the job entry instance provided. * * @param jobEntry The job entry this dialog supports. */ protected void init( AbstractAmazonJobEntry 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 ); setDialogSize(); // Load up the SWT-XUL runtime and initialize it with our container final XulRunner runner = new SwtXulRunner(); runner.addContainer( container ); runner.initialize(); }
protected void init( OozieJobExecutorJobEntry jobEntry ) throws XulException { SwtXulLoader xulLoader = new SwtXulLoader(); xulLoader.setSettingsManager( XulSpoonSettingsManager.getInstance() ); xulLoader.registerClassLoader( getClass().getClassLoader() ); // register the variable-aware text, LinkLabel, and a better checkbox box for use in XUL xulLoader.register( VARIABLETEXTBOX, ExtTextbox.class.getName() ); xulLoader.setOuterContext( shell ); // Load the XUL document with the dialog defined in it container = xulLoader.loadXul( getXulFile(), bundle ); BindingFactory bf = new DefaultBindingFactory(); bf.setDocument( container.getDocumentRoot() ); controller = createController( jobEntry, container, bf ); controller.setJobMeta( jobMeta ); String clusterName = controller.getConfig().getClusterName(); 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(); controller.selectNamedCluster( clusterName ); }
@Override protected boolean doLazyInit() { try { mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" ); } catch ( XulException e ) { return false; } try { setRepReadOnly( this.diRepository.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; }
bf = new DefaultBindingFactory(); bf.setDocument( container.getDocumentRoot() ); bf.setBindingType( Type.BI_DIRECTIONAL );
bf = new DefaultBindingFactory(); bf.setDocument( container.getDocumentRoot() ); bf.setBindingType( Type.BI_DIRECTIONAL );