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 ); } } );
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 ); } }
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 ); } }