本文整理汇总了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;
}
示例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;
}
示例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));
}
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}