public void onError( Throwable t ) { SpoonFactory.getInstance().messageBox( t.getLocalizedMessage(), resourceBundle.getString( "RepositoryConfigDialog.InitializationFailed" ), false, Const.ERROR ); //$NON-NLS-1$ log.error( resourceBundle.getString( "RepositoryConfigDialog.ErrorStartingXulApplication" ), t );//$NON-NLS-1$ }
public static String Alert( ScriptEngine actualContext, Bindings actualObject, Object[] ArgList, Object FunctionContext ) { SpoonInterface spoon = SpoonFactory.getInstance(); if ( ArgList.length == 1 && spoon != null ) { String strMessage = (String) ArgList[0]; spoon.messageBox( strMessage, "Alert", false, Const.INFO ); } return ""; }
public void run() { result[0] = SpoonFactory.getInstance().messageBox( message, text, true, Const.INFO ); } } );
JobMeta createJobMetaForNode( Node jobnode ) throws KettleXMLException { return new JobMeta( jobnode, null, false, SpoonFactory.getInstance() ); }
public static String Alert( Context actualContext, Scriptable actualObject, Object[] ArgList, Function FunctionContext ) { SpoonInterface spoon = SpoonFactory.getInstance(); if ( ArgList.length == 1 && spoon != null ) { String strMessage = Context.toString( ArgList[0] ); boolean ok = spoon.messageBox( strMessage, "Alert", true, Const.INFO ); if ( !ok ) { throw new RuntimeException( "Alert dialog cancelled by user." ); } } return ""; }
show(); } catch ( XulException e ) { SpoonFactory.getInstance().messageBox( e.getLocalizedMessage(), resourceBundle.getString( "RepositoryConfigDialog.InitializationFailed" ), false, Const.ERROR ); //$NON-NLS-1$ log.error( resourceBundle.getString( "RepositoryConfigDialog.ErrorStartingXulApplication" ), e );//$NON-NLS-1$
public AuthProviderDialog( Shell shell ) { log = new LogChannel( resourceBundle.getString( "log.name" ) ); try { SwtXulLoader xulLoader = new SwtXulLoader(); xulLoader.setOuterContext( shell ); container = xulLoader.loadXul( XUL_FILE, resourceBundle ); final XulRunner runner = new SwtXulRunner(); runner.addContainer( container ); BindingFactory bf = new SwtBindingFactory(); bf.setDocument( container.getDocumentRoot() ); controller.setBindingFactory( bf ); controller.setResourceBundle( resourceBundle ); container.addEventHandler( controller ); try { runner.initialize(); } catch ( XulException e ) { SpoonFactory.getInstance().messageBox( e.getLocalizedMessage(), resourceBundle.getString( "error.on_initialization" ), false, Const.ERROR ); log.logError( resourceBundle.getString( "error.on_initialization" ), e ); } } catch ( XulException e ) { log.logError( resourceBundle.getString( "error.on_initialization" ), e ); } }
new ErrorDialog( ( (Spoon) SpoonFactory.getInstance() ).getShell(), BaseMessages.getString( Spoon.class, "Spoon.Error" ), e.getMessage(), e ); krle = KettleRepositoryLostException.lookupStackStrace( e ); if ( krle == null ) { new ErrorDialog( ( (Spoon) SpoonFactory.getInstance() ).getShell(), BaseMessages.getString( Spoon.class, "Spoon.Error" ), e.getMessage(), e ); } else { } catch ( XulException e ) { log.error( resourceBundle.getString( "RepositoryExplorer.ErrorStartingXulApplication" ), e ); new ErrorDialog( ( (Spoon) SpoonFactory.getInstance() ).getShell(), BaseMessages.getString( Spoon.class, "Spoon.Error" ), e.getMessage(), 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 ); } }
@Override public EngineMetaInterface getActiveMeta() { if ( tabfolder == null ) { return null; } TabItem tabItem = tabfolder.getSelected(); if ( tabItem == null ) { return null; } // What transformation is in the active tab? // TransLog, TransGraph & TransHist contain the same transformation // TabMapEntry mapEntry = ( (Spoon) SpoonFactory.getInstance() ).delegates.tabs.getTab( tabfolder.getSelected() ); EngineMetaInterface meta = null; if ( mapEntry != null ) { if ( mapEntry.getObject() instanceof TransGraph ) { meta = ( mapEntry.getObject() ).getMeta(); } if ( mapEntry.getObject() instanceof JobGraph ) { meta = ( mapEntry.getObject() ).getMeta(); } } return meta; }
shell = ( ( (Spoon) SpoonFactory.getInstance() ).getShell() ); XulDomContainer container = getXulDomContainer(); } catch ( Exception e ) { log.error( BaseMessages.getString( PKG, "LockController.NoLockingSupport" ), e );//$NON-NLS-1$ new ErrorDialog( ( (Spoon) SpoonFactory.getInstance() ).getShell(), BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage(), e ); //$NON-NLS-1$
public void viewLockNote() throws Exception { if ( workingMeta != null && supportsLocking( Spoon.getInstance().getRepository() ) ) { try { RepositoryLock repoLock = fetchRepositoryLock( workingMeta ); if ( repoLock != null ) { XulMessageBox msgBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ msgBox.setTitle( BaseMessages.getString( PKG, "PurRepository.LockNote.Title" ) ); //$NON-NLS-1$ msgBox.setMessage( repoLock.getMessage() ); msgBox.setModalParent( shell ); msgBox.open(); } } catch ( Throwable th ) { log.error( BaseMessages.getString( PKG, "LockController.NoLockingSupport" ), th );//$NON-NLS-1$ new ErrorDialog( ( (Spoon) SpoonFactory.getInstance() ).getShell(), BaseMessages .getString( PKG, "Dialog.Error" ), BaseMessages.getString( PKG, "LockController.NoLockingSupport" ), th ); //$NON-NLS-1$ //$NON-NLS-2$ } } else { XulMessageBox msgBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$ msgBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); //$NON-NLS-1$ msgBox.setMessage( BaseMessages.getString( PKG, "LockController.NoLockingSupport" ) );//$NON-NLS-1$ msgBox.setModalParent( shell ); msgBox.open(); } }
} catch ( Exception e ) { if ( KettleRepositoryLostException.lookupStackStrace( e ) == null ) { new ErrorDialog( ( (Spoon) SpoonFactory.getInstance() ).getShell(), BaseMessages.getString( Spoon.class, "Spoon.Dialog.ErrorOpeningById.Message", objectId ), e.getMessage(), e ); } else { } catch ( Exception e ) { if ( KettleRepositoryLostException.lookupStackStrace( e ) == null ) { new ErrorDialog( ( (Spoon) SpoonFactory.getInstance() ).getShell(), BaseMessages.getString( Spoon.class, "Spoon.Dialog.ErrorOpeningById.Message", objectId ), e.getMessage(), e ); } else {
log.error( BaseMessages.getString( PKG, "LockController.NoLockingSupport" ), th );//$NON-NLS-1$ new ErrorDialog( ( (Spoon) SpoonFactory.getInstance() ).getShell(), BaseMessages.getString( PKG, "Dialog.Error" ), BaseMessages.getString( PKG, "LockController.NoLockingSupport" ), th ); //$NON-NLS-1$ //$NON-NLS-2$