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


Java MessageConsole.activate方法代码示例

本文整理汇总了Java中org.eclipse.ui.console.MessageConsole.activate方法的典型用法代码示例。如果您正苦于以下问题:Java MessageConsole.activate方法的具体用法?Java MessageConsole.activate怎么用?Java MessageConsole.activate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ui.console.MessageConsole的用法示例。


在下文中一共展示了MessageConsole.activate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOutputStream

import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
@Override
public OutputStream getOutputStream(final OutputStreamType type, OutputRedirection redirect) {
	if (!PlatformUI.isWorkbenchRunning()) {
		return DEFAULT.getOutputStream(type, redirect);
	}
	final MessageConsole console = consoleSupplier.get();
	boolean silent = redirect == OutputRedirection.SUPPRESS;
	if (!silent) {
		console.activate();
	}
	ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
	final MessageConsoleStream stream = console.newMessageStream();
	getDisplay().asyncExec(() -> {
		stream.setColor(toColor(type));
		showConsoleView(silent);
	});
	return stream;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:19,代码来源:ConsoleOutputStreamProvider.java

示例2: runFile

import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
@Override
protected void runFile ( final IFile file, final IProgressMonitor monitor ) throws Exception
{

    final MessageConsole mc = new MessageConsole ( String.format ( "OSCAR Validation: %s", file ), "org.eclipse.scada.configuration.oscar.validation", null, true );

    ConsolePlugin.getDefault ().getConsoleManager ().addConsoles ( new IConsole[] { mc } );
    mc.activate ();

    final File dataFile = file.getLocation ().toFile ();

    Map<String, Map<String, Map<String, String>>> data;

    if ( OscarLoader.isOscar ( dataFile ) )
    {
        data = new OscarLoader ( dataFile ).getData ();
    }
    else
    {
        try (FileInputStream stream = new FileInputStream ( dataFile ))
        {
            data = OscarLoader.loadJsonData ( stream );
        }
    }

    final PrintStream consoleStream = new PrintStream ( mc.newOutputStream () );
    try
    {
        new LoopValidator ( data, consoleStream ).validate ();
    }
    finally
    {
        consoleStream.close ();
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:36,代码来源:OscarValidatorHandler.java

示例3: findConsole

import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
public static MessageConsole findConsole(String name) {
	ConsolePlugin plugin = ConsolePlugin.getDefault();
	IConsoleManager conMan = plugin.getConsoleManager();
	IConsole[] existing = conMan.getConsoles();
	for (int i = 0; i < existing.length; i++)
		if (name.equals(existing[i].getName()))
			return (MessageConsole) existing[i];
	// no console found, so create a new one
	MessageConsole myConsole = new MessageConsole(name, null);
	conMan.addConsoles(new IConsole[] { myConsole });
	myConsole.activate();
	return myConsole;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:14,代码来源:Util.java

示例4: maybeGetDevJarPath

import org.eclipse.ui.console.MessageConsole; //导入方法依赖的package包/类
/**
 * Returns the path to the gwt-dev-xxx.jar in the event that the launch configuration depends on a
 * GWT Contributor Runtime. Otherwise, returns the empty string.
 */
private static String maybeGetDevJarPath(IJavaProject project) {

  /*
   * In order to figure out whether or not to add the -Dgwt.devjar argument to the list of VM
   * args, we have to figure out the runtime that this launch configuration depends on. If the
   * project is one of the GWT Runtime projects, then we'll definitely have to add the
   * -Dgwt.devjar argument to the launch configuration.
   */
  try {
    if (GWTProjectsRuntime.isGWTRuntimeProject(project)) {
      // Synthesize a temporary contributor SDK so that we can use it
      // to compute the devjar path
      GwtSdk tempContribSDK = GWTProjectsRuntime.syntheziseContributorRuntime();

      if (tempContribSDK.validate().isOK()) {
        return tempContribSDK.getDevJar().getAbsolutePath();
      } else {
        return "";
      }
    }

    GwtSdk sdk = GwtSdk.findSdkFor(project);
    if (sdk == null) {
      MessageConsole messageConsole =
          MessageConsoleUtilities.getMessageConsole(project.getProject().getName() + "-GWT", null);
      messageConsole.activate();
      ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {messageConsole});
      final ConsoleColorProvider consoleColorProvider = new ConsoleColorProvider();
      final MessageConsoleStream console = messageConsole.newMessageStream();
      Display.getDefault().asyncExec(new Runnable() {
        @Override
        public void run() {
          console.setColor(consoleColorProvider.getColor(IDebugUIConstants.ID_STANDARD_ERROR_STREAM));
        }
      });
      console.println("GWT SDK not installed.");
      try {
        console.close();
      } catch (IOException e) {
        GWTPluginLog.logError(e, "Unable to close output stream to console");
      }
      return "";
    } else if (sdk.usesGwtDevProject()) {
      File gwtDevJarFile = sdk.getDevJar();
      return gwtDevJarFile.getAbsolutePath();
    }
  } catch (SdkException sdke) {
    GWTPluginLog.logError(sdke, "Unable to extract gwt dev jar argument from GWTProjectsRuntime");
  } catch (JavaModelException jme) {
    GWTPluginLog.logError(jme, "Unable to extract gwt dev jar argument from GWTProjectsRuntime");
  }
  return "";
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:58,代码来源:DGwtDevJarArgumentProcessor.java


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