当前位置: 首页>>代码示例>>Java>>正文


Java ThreadGuiResources类代码示例

本文整理汇总了Java中org.pentaho.di.ui.util.ThreadGuiResources的典型用法代码示例。如果您正苦于以下问题:Java ThreadGuiResources类的具体用法?Java ThreadGuiResources怎么用?Java ThreadGuiResources使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ThreadGuiResources类属于org.pentaho.di.ui.util包,在下文中一共展示了ThreadGuiResources类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.pentaho.di.ui.util.ThreadGuiResources; //导入依赖的package包/类
/**
 * This is the main procedure for Spoon.
 * 
 * @param a
 *            Arguments are available in the "Get System Info" step.
 */
public static void main(String[] a) throws KettleException {
	try {
		// Do some initialization of environment variables
		EnvUtil.environmentInit();

		List<String> args = new ArrayList<String>(java.util.Arrays.asList(a));

		Display display = new Display();

		Splash splash = new Splash(display);

		CommandLineOption[] commandLineOptions = getCommandLineArgs(args);

		initLogging(commandLineOptions);
		initPlugins();

		PropsUI.init(display, Props.TYPE_PROPERTIES_SPOON); // things to //
		// remember...

		staticSpoon = new Spoon(display);
		staticSpoon.init(null);
		SpoonFactory.setSpoonInstance(staticSpoon);
		staticSpoon.setDestroy(true);
		GUIFactory.setThreadDialogs(new ThreadGuiResources());

		if (LogWriter.getInstance().isBasic()) {
			LogWriter.getInstance().logBasic(APP_NAME, Messages.getString("Spoon.Log.MainWindowCreated"));// Main window is created.
		}

		// listeners
		//
		try {
			staticSpoon.lcsup.onStart(staticSpoon);
		} catch (LifecycleException e) {
			// if severe, we have to quit
			MessageBox box = new MessageBox(staticSpoon.shell, (e.isSevere() ? SWT.ICON_ERROR : SWT.ICON_WARNING) | SWT.OK);
			box.setMessage(e.getMessage());
			box.open();
		}

		staticSpoon.setArguments(args.toArray(new String[args.size()]));
		staticSpoon.start(splash, commandLineOptions);
	} catch (Throwable t) {
		// avoid calls to Messages i18n method getString() in this block
		// We do this to (hopefully) also catch Out of Memory Exceptions
		//
		LogWriter.getInstance().logError(APP_NAME, "Fatal error : " + Const.NVL(t.toString(), Const.NVL(t.getMessage(), "Unknown error"))); //$NON-NLS-1$ //$NON-NLS-2$
		LogWriter.getInstance().logError(APP_NAME, Const.getStackTracker(t));
		// inform the user with a dialog when possible
		new ErrorDialog(staticSpoon.shell, Messages.getString("Spoon.Dialog.FatalError"), "Fatal error : " + Const.NVL(t.toString(), Const.NVL(t.getMessage(), "Unknown error")), t); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	}

	// Kill all remaining things in this VM!
	System.exit(0);
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:62,代码来源:Spoon.java

示例2: main

import org.pentaho.di.ui.util.ThreadGuiResources; //导入依赖的package包/类
/**
 * This is the main procedure for Spoon.
 * 
 * @param a
 *            Arguments are available in the "Get System Info" step.
 */
public static void main(String[] a) throws KettleException {
  
  try {
    // Bootstrap Kettle
    //
    //  We start Sleak if the VM argument RUN_SLEAK was provided
    Display display = null;
    if (System.getProperties().containsKey("SLEAK")) {
       DeviceData data = new DeviceData();
       data.tracking = true;
       display = new Display(data);
       Sleak sleak = new Sleak();
       sleak.open();
    }
    else {
       display = new Display();
    }

    // The core plugin types don't know about UI classes. Add them in now
    // before the PluginRegistry inits.
    splash = new Splash(display);

    registerUIPluginObjectTypes();

    KettleEnvironment.init();

    List<String> args = new ArrayList<String>(java.util.Arrays.asList(a));

    CommandLineOption[] commandLineOptions = getCommandLineArgs(args);

    initLogging(commandLineOptions);

    PropsUI.init(display, Props.TYPE_PROPERTIES_SPOON);

    CentralLogStore.init(
        PropsUI.getInstance().getMaxNrLinesInLog(), 
        PropsUI.getInstance().getMaxLogLineTimeoutMinutes());

    // remember...

    staticSpoon = new Spoon(display);
    staticSpoon.init(null);
    SpoonFactory.setSpoonInstance(staticSpoon);
    staticSpoon.setDestroy(true);
    GUIFactory.setThreadDialogs(new ThreadGuiResources());

    // listeners
    //
    try {
      staticSpoon.lifecycleSupport.onStart(staticSpoon);
    } catch (LifecycleException e) {
      // if severe, we have to quit
      MessageBox box = new MessageBox(staticSpoon.shell, (e.isSevere() ? SWT.ICON_ERROR : SWT.ICON_WARNING) | SWT.OK);
      box.setMessage(e.getMessage());
      box.open();
    }

    staticSpoon.setArguments(args.toArray(new String[args.size()]));
    staticSpoon.start(commandLineOptions);
  } catch (Throwable t) {
    // avoid calls to Messages i18n method getString() in this block
    // We do this to (hopefully) also catch Out of Memory Exceptions
    //
    t.printStackTrace();
    if (staticSpoon != null) {
      log.logError("Fatal error : " + Const.NVL(t.toString(), Const.NVL(t.getMessage(), "Unknown error"))); //$NON-NLS-1$ //$NON-NLS-2$
      log.logError(Const.getStackTracker(t));
    }
  }

  // Kill all remaining things in this VM!
  System.exit(0);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:80,代码来源:Spoon.java


注:本文中的org.pentaho.di.ui.util.ThreadGuiResources类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。