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


Java MessageConsoleStream.close方法代码示例

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


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

示例1: writeToConsole

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
/**
 * Displays the specified text at the console, followed by a line
 * separator string.
 * 
 * @param text message to display
 * @param lineBreak <tt>true</tt> if a linebreak shall be inserted after the message.
 * @return <tt>true</tt> if the message was successfully displayed inside the console.
 */
public boolean writeToConsole(String text, boolean lineBreak) {
    boolean isWritten = false;
    if (this.msgConsole != null) {
        MessageConsoleStream out = this.msgConsole.newMessageStream();
        if (lineBreak) {
            out.println(text);
        } else {
            out.print(text);
        }
        try {
            out.flush();
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return isWritten;
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:27,代码来源:EclipseConsole.java

示例2: showConsole

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public static void showConsole(String consoleName, String content) throws IOException, PartInitException{
	IWorkbenchPage page = PlatformUI.getWorkbench()
			.getActiveWorkbenchWindow().getActivePage();
	MessageConsole console = ConsoleHelper
			.findConsole(consoleName);
	MessageConsoleStream out = console.newMessageStream();
	out.println(content);
	out.setActivateOnWrite(true);
	out.setColor(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
	out.close();
	
	IConsoleView view = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
	view.display(console);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:15,代码来源:ViewHelper.java

示例3: print

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public void print(String line) throws IOException {
	final MessageConsoleStream output = messageConsole.newMessageStream();
	output.print(line);
	output.close();
}
 
开发者ID:kwin,项目名称:cppcheclipse,代码行数:6,代码来源:Console.java

示例4: println

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public void println(String line) throws IOException {
	final MessageConsoleStream output = messageConsole.newMessageStream();
	output.println(line);
	output.close();
}
 
开发者ID:kwin,项目名称:cppcheclipse,代码行数:6,代码来源:Console.java

示例5: maybeGetDevJarPath

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的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.MessageConsoleStream.close方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。