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


Java MessageConsole类代码示例

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


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

示例1: getOrCreate

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
/**
 * Returns console associated with given name. If console with given name doesn't exists will create new one.
 */
public static XpectConsole getOrCreate(String name) {
	XpectConsole console = map.get(name);
	if (console != null) {
		return console;
	} else {
		MessageConsole lkpMessageConsole = findMessageConsole(name);
		if (lkpMessageConsole == null) {
			console = new XpectConsole(createMessageConsoleStream(name));
		} else {
			console = new XpectConsole(lkpMessageConsole);
		}
		map.put(name, console);
	}

	return console;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:ConsoleDisplayMgr.java

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

示例3: AndroidConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
public AndroidConsole() {
	console = new MessageConsole("Android", null);
	ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
	out = console.newMessageStream();
	err = console.newMessageStream();

	// set the colors
	final Display display = Display.getDefault();
	display.syncExec(new Runnable() {
		@Override
		public void run() {
			out.setColor(display.getSystemColor(SWT.COLOR_BLACK));
			err.setColor(display.getSystemColor(SWT.COLOR_RED));
		}
	});
}
 
开发者ID:dschaefer,项目名称:andmore2,代码行数:17,代码来源:AndroidConsole.java

示例4: getConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
/**
 * Get the console with the given name. If the console does not exist, then
 * a new one is created.
 * 
 * @param name
 * @return
 */
public static MessageConsole getConsole(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 console = new MessageConsole(name, null);
	conMan.addConsoles(new IConsole[] { console });

	// create a new logger handler
	Logger.addHandler(new EclipseConsoleHandler(console));

	return console;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:27,代码来源:EclipseUtils.java

示例5: findConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
/**
 * Fins the console with a given name
 * @param name, name of the console
 * @return
 */
private static MessageConsole findConsole(String name)
{
    if (name == null)
    {
        throw new IllegalArgumentException("Console name must be not null");
    }
    IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();

    IConsole[] existing = consoleManager.getConsoles();
    // try to find existing
    for (int i = 0; i < existing.length; i++)
    {
        if (name.equals(existing[i].getName()))
        {
            return (MessageConsole) existing[i];
        }
    }

    // no console found, create a new one
    MessageConsole myConsole = new MessageConsole(name, null);
    consoleManager.addConsoles(new IConsole[] { myConsole });
    return myConsole;
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:29,代码来源:ConsoleFactory.java

示例6: findConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
/**
 * Finds the console with a given name.
 * 
 * @param name, name of the console
 * @return
 */
private static MessageConsole findConsole(String name)
{
    if (name == null)
    {
        throw new IllegalArgumentException("Console name must be not null");
    }
    IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();

    IConsole[] existing = consoleManager.getConsoles();
    // try to find existing
    for (int i = 0; i < existing.length; i++)
    {
        if (name.equals(existing[i].getName()))
        {
            return (MessageConsole) existing[i];
        }
    }

    // no console found, create a new one
    MessageConsole myConsole = new MessageConsole(name, null);
    consoleManager.addConsoles(new IConsole[] { myConsole });
    return myConsole;
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:30,代码来源:TLAPMConsoleFactory.java

示例7: findConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
private MessageConsole findConsole(String name) {
	ConsolePlugin plugin = ConsolePlugin.getDefault();
	IConsoleManager conMan = plugin.getConsoleManager();
	
	// search existing consoles
	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});
	conMan.showConsoleView(myConsole);
	return myConsole;
}
 
开发者ID:alexander-bergmayr,项目名称:caml2tosca,代码行数:19,代码来源:C2TRunHandler.java

示例8: getApplicationLogConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
protected synchronized ApplicationLogConsole getApplicationLogConsole(CloudFoundryServer server,
		CloudFoundryApplicationModule appModule) {
	if (server == null || appModule == null) {
		return null;
	}

	String appUrl = getConsoleId(server.getServer(), appModule);
	ApplicationLogConsole serverLogTail = consoleByUri.get(appUrl);
	if (serverLogTail == null) {

		MessageConsole appConsole = getApplicationConsole(server, appModule);

		serverLogTail = new ApplicationLogConsole(new ConsoleConfig(appConsole, server, appModule));
		consoleByUri.put(getConsoleId(server.getServer(), appModule), serverLogTail);
	}
	return serverLogTail;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:18,代码来源:ApplicationLogConsoleManager.java

示例9: isCloudFoundryConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
protected boolean isCloudFoundryConsole(IConsole console) {
	if (console instanceof MessageConsole) {
		MessageConsole messageConsole = (MessageConsole) console;
		Object cfServerObj = messageConsole.getAttribute(ApplicationLogConsole.ATTRIBUTE_SERVER);
		Object cfAppModuleObj = messageConsole.getAttribute(ApplicationLogConsole.ATTRIBUTE_APP);
		if (cfServerObj instanceof CloudFoundryServer && cfAppModuleObj instanceof CloudFoundryApplicationModule) {
			CloudFoundryServer cfServer = (CloudFoundryServer) cfServerObj;
			CloudFoundryApplicationModule appModule = (CloudFoundryApplicationModule) cfAppModuleObj;

			CloudConsoleManager manager = ConsoleManagerRegistry.getConsoleManager(cfServer.getServer());
			if (manager != null) {
				MessageConsole existingConsole = manager.findCloudFoundryConsole(cfServer.getServer(), appModule);
				return messageConsole == existingConsole;
			}
		}
	}
	return false;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:19,代码来源:CloudFoundryConsolePageParticipant.java

示例10: createConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
protected void createConsole() {
  	Display.getDefault().syncExec(new Runnable() {
	public void run() {
    	IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
    	console = new MessageConsole(consoleName, null);
    	manager.addConsoles(new IConsole[] { console });
        try {
        	Font font = new Font(Display.getCurrent(), "simsun", 9, SWT.NORMAL);
        	console.setFont(font);
        } catch (SWTError error) {
			error.printStackTrace();
		}
        mcs = console.newMessageStream();
        black = Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
        red = Display.getCurrent().getSystemColor(SWT.COLOR_RED);
        mcs.setColor(black);
		manager.showConsoleView(console);
	}
});
  }
 
开发者ID:AlexWengh,项目名称:HMM,代码行数:21,代码来源:AbstractConsole.java

示例11: findConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

		if (ConsolePlugin.getDefault() == null)
			return null;
		ConsolePlugin plugin = ConsolePlugin.getDefault();
		IConsoleManager YangConsole = plugin.getConsoleManager();
		IConsole[] existing = YangConsole.getConsoles();
		for (int i = 0; i < existing.length; i++)
			if (name.equals(existing[i].getName())) {
				YangConsole.showConsoleView(existing[i]);
				return (MessageConsole) existing[i];
			}
		MessageConsole myConsole = new MessageConsole(name, null);
		YangConsole.addConsoles(new IConsole[] { myConsole });
		return myConsole;
	}
 
开发者ID:att,项目名称:yang-design-studio,代码行数:17,代码来源:YangToPNG.java

示例12: findConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

   if (ConsolePlugin.getDefault() == null)
    	return null;
   ConsolePlugin plugin = ConsolePlugin.getDefault();
   IConsoleManager YangConsole = plugin.getConsoleManager();
   IConsole[] existing = YangConsole.getConsoles();
   for (int i = 0; i < existing.length; i++)
      if (name.equals(existing[i].getName())) {
      	YangConsole.showConsoleView(existing[i]);
      	return (MessageConsole) existing[i];
      }
   MessageConsole myConsole = new MessageConsole(name, null);
   YangConsole.addConsoles(new IConsole[] { myConsole });
   return myConsole;
}
 
开发者ID:att,项目名称:yang-design-studio,代码行数:17,代码来源:YangToSkelxml.java

示例13: findConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

   if (ConsolePlugin.getDefault() == null)
    	return null;
   ConsolePlugin plugin = ConsolePlugin.getDefault();
   IConsoleManager YangConsole = plugin.getConsoleManager();
   IConsole[] existing = YangConsole.getConsoles();
   for (int i = 0; i < existing.length; i++)
      if (name.equals(existing[i].getName())) {
      	YangConsole.showConsoleView(existing[i]);
      	return (MessageConsole) existing[i];
      }
   // no console found, so create a new one
   MessageConsole myConsole = new MessageConsole(name, null);
   YangConsole.addConsoles(new IConsole[] { myConsole });
   return myConsole;
}
 
开发者ID:att,项目名称:yang-design-studio,代码行数:18,代码来源:YangToDsdl.java

示例14: findConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

          			if (ConsolePlugin.getDefault() == null)
          				return null;
          			ConsolePlugin plugin = ConsolePlugin.getDefault();
          			IConsoleManager YangConsole = plugin.getConsoleManager();
          			IConsole[] existing = YangConsole.getConsoles();
          			for (int i = 0; i < existing.length; i++)
          				if (name.equals(existing[i].getName())) {
          					YangConsole.showConsoleView(existing[i]);
          					return (MessageConsole) existing[i];
          				}
          			MessageConsole myConsole = new MessageConsole(name, null);
          			YangConsole.addConsoles(new IConsole[] { myConsole });
          			return myConsole;
          		}
 
开发者ID:att,项目名称:yang-design-studio,代码行数:17,代码来源:YangToTree.java

示例15: findConsole

import org.eclipse.ui.console.MessageConsole; //导入依赖的package包/类
private static MessageConsole findConsole(String name) {//Find and return console, otherwise make one

            			if (ConsolePlugin.getDefault() == null)
            				return null;
            			ConsolePlugin plugin = ConsolePlugin.getDefault();
            			IConsoleManager YangConsole = plugin.getConsoleManager();
            			IConsole[] existing = YangConsole.getConsoles();
            			for (int i = 0; i < existing.length; i++)
            				if (name.equals(existing[i].getName())) {
            					YangConsole.showConsoleView(existing[i]);
            					return (MessageConsole) existing[i];
            				}
            			MessageConsole myConsole = new MessageConsole(name, null);
            			YangConsole.addConsoles(new IConsole[] { myConsole });
            			return myConsole;
            		}
 
开发者ID:att,项目名称:yang-design-studio,代码行数:17,代码来源:YangToYin.java


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