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


Java MessageConsoleStream.setColor方法代码示例

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


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

示例1: getConsoleOutputStream

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public OutputStream getConsoleOutputStream(boolean isError) {
	final MessageConsoleStream output = messageConsole.newMessageStream();
	output.setActivateOnWrite(false);
	
	final int colorId;
	if (!isError) {
		colorId = SWT.COLOR_BLACK;
	} else {
		colorId = SWT.COLOR_RED;
	}
	
	/* we must set the color in the UI thread */
	Runnable runnable = new Runnable() {
		public void run() {
			org.eclipse.swt.graphics.Color color = Display.getCurrent()
					.getSystemColor(colorId);
			output.setColor(color);
		}
	};
	Display.getDefault().syncExec(runnable);
	
	return output;
}
 
开发者ID:kwin,项目名称:cppcheclipse,代码行数:24,代码来源:Console.java

示例2: getNewMessageConsoleStream

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
private MessageConsoleStream getNewMessageConsoleStream(int msgKind)
{     
    int swtColorId = SWT.COLOR_DARK_GREEN;
    
    switch (msgKind) {
        case MSG_INFORMATION:
            swtColorId = SWT.COLOR_BLACK;
            break;
            
        case MSG_ERROR:
            swtColorId = SWT.COLOR_RED;
            break;
            
        case MSG_WARNING:
            swtColorId = SWT.COLOR_DARK_BLUE;
            break;
            
        default:          
            swtColorId = SWT.COLOR_DARK_MAGENTA;
    }  
    
    MessageConsoleStream msgConsoleStream = getMessageConsole().newMessageStream();     
    msgConsoleStream.setColor(Display.getCurrent().getSystemColor(swtColorId));
    return msgConsoleStream;
}
 
开发者ID:Elphel,项目名称:vdt-plugin,代码行数:26,代码来源:ConsoleView.java

示例3: getNewMessageConsoleStream

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
private MessageConsoleStream getNewMessageConsoleStream(int msgKind) {
	int swtColorId = SWT.COLOR_BLACK;

	switch (msgKind) {
	case MSG_LOG:
		swtColorId = SWT.COLOR_BLACK;
		break;
	case MSG_INFORMATION:
		swtColorId = SWT.COLOR_DARK_GRAY;
		break;
	case MSG_ERROR:
		swtColorId = SWT.COLOR_DARK_MAGENTA;
		break;
	case MSG_WARNING:
		swtColorId = SWT.COLOR_DARK_YELLOW;
		break;
	case MSG_SUCCESS:
		swtColorId = SWT.COLOR_DARK_GREEN;
		break;
	default:
		swtColorId = SWT.COLOR_BLACK;
		break;
	}

	MessageConsoleStream msgConsoleStream = messageConsole.newMessageStream();
	msgConsoleStream.setColor(Display.getCurrent().getSystemColor(swtColorId));

	return msgConsoleStream;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:30,代码来源:XpectConsole.java

示例4: ConsoleContext

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public ConsoleContext ( final MessageConsole messageConsole )
{
    this.writerStream = messageConsole.newMessageStream ();

    final MessageConsoleStream errorStream = messageConsole.newMessageStream ();
    errorStream.setColor ( Display.getDefault ().getSystemColor ( SWT.COLOR_RED ) );
    this.errorPrintWriter = new PrintWriter ( new OutputStreamWriter ( errorStream ) );

    this.logStream = messageConsole.newMessageStream ();
    this.logStream.setColor ( Display.getDefault ().getSystemColor ( SWT.COLOR_GRAY ) );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:ConsoleContext.java

示例5: launchDeployJob

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
private void launchDeployJob(IProject project, Credential credential)
    throws IOException, CoreException {
  AnalyticsPingManager.getInstance().sendPing(AnalyticsEvents.APP_ENGINE_DEPLOY,
      analyticsDeployEventMetadataKey);

  IPath workDirectory = createWorkDirectory();
  DeployPreferences deployPreferences = getDeployPreferences(project);

  DeployConsole messageConsole =
      MessageConsoleUtilities.createConsole(getConsoleName(deployPreferences.getProjectId()),
                                            new DeployConsole.Factory());
  IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
  consoleManager.showConsoleView(messageConsole);
  ConsoleColorProvider colorProvider = new ConsoleColorProvider();
  MessageConsoleStream outputStream = messageConsole.newMessageStream();
  MessageConsoleStream errorStream = messageConsole.newMessageStream();
  outputStream.setActivateOnWrite(true);
  errorStream.setActivateOnWrite(true);
  outputStream.setColor(colorProvider.getColor(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM));
  errorStream.setColor(colorProvider.getColor(IDebugUIConstants.ID_STANDARD_ERROR_STREAM));

  StagingDelegate stagingDelegate = getStagingDelegate(project);

  DeployJob deploy = new DeployJob(deployPreferences, credential, workDirectory,
      outputStream, errorStream, stagingDelegate);
  messageConsole.setJob(deploy);
  deploy.addJobChangeListener(new JobChangeAdapter() {

    @Override
    public void done(IJobChangeEvent event) {
      if (event.getResult().isOK()) {
        AnalyticsPingManager.getInstance().sendPing(AnalyticsEvents.APP_ENGINE_DEPLOY_SUCCESS,
            analyticsDeployEventMetadataKey);
      }
      launchCleanupJob();
    }
  });
  deploy.schedule();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:40,代码来源:DeployCommandHandler.java

示例6: printError

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
/**
 * Prints error message to the console.
 * 
 * @param message error message to print
 */
public static void printError(final String message) {
	final Display display = PlatformUI.getWorkbench().getDisplay();
	final MessageConsoleStream consoleStream = getConsoleStream();
	final Color color = new Color(display, new RGB(255, 0, 0));
	
	consoleStream.setColor(color);
	consoleStream.println(message);
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:14,代码来源:ConsoleUtils.java

示例7: 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


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