當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。