當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageConsoleStream.setActivateOnWrite方法代碼示例

本文整理匯總了Java中org.eclipse.ui.console.MessageConsoleStream.setActivateOnWrite方法的典型用法代碼示例。如果您正苦於以下問題:Java MessageConsoleStream.setActivateOnWrite方法的具體用法?Java MessageConsoleStream.setActivateOnWrite怎麽用?Java MessageConsoleStream.setActivateOnWrite使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.ui.console.MessageConsoleStream的用法示例。


在下文中一共展示了MessageConsoleStream.setActivateOnWrite方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: get

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
@Override
public CommandConsole get(String name, String title) throws IOException {
  MessageConsole console = findConsole(name);
  MessageConsoleStream stream = console.newMessageStream();
  stream.setActivateOnWrite(true);
  stream.write("*** " + title + " ***\n");
  return new CommandConsoleImpl(console);
}
 
開發者ID:bazelbuild,項目名稱:eclipse,代碼行數:9,代碼來源:CommandConsoleFactoryImpl.java

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

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

示例5: printToConsole

import org.eclipse.ui.console.MessageConsoleStream; //導入方法依賴的package包/類
/**
 * 向控製台打印一條信息,並激活控製台
 * @param message
 * @param activate  是否激活控製台
 */
public static void printToConsole(String message,boolean activate){
	MessageConsoleStream printer = ConsoleFactory.getConsole().newMessageStream();
	printer.setActivateOnWrite(activate);
	printer.println(message);
}
 
開發者ID:HuaweiSNC,項目名稱:OpsDev,代碼行數:11,代碼來源:ConsoleFactory.java


注:本文中的org.eclipse.ui.console.MessageConsoleStream.setActivateOnWrite方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。