熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java開源技術 >> 正文

實現向eclipse控制台輸入消息

2013-11-23 20:48:32  來源: Java開源技術 

//orgeclipseuiconsole


MessageConsoleStream console = thisopenLogConsole(RCP
Informatiol
orgeclipseworkbenchuiide);
consoleprintln(new Date(SystemcurrentTimeMillis())
+ :selected!);

public MessageConsoleStream openLogConsole(String domainName
String stationId String applicationId) {
Systemerrprintln(openLogConsole(domain= + domainName +
station=
+ stationId + app= + applicationId + ));
/*
* get console name and create a new console
*/
StringBuffer consoleName = new StringBuffer(domainName);
if (stationId != null) {
consoleNameappend(> + stationId);
if (applicationId != null) {
consoleNameappend(> + applicationId);
}
}

MessageConsole console = new
MessageConsole(consoleNametoString()
null);
final MessageConsoleStream consoleStream =
consolenewMessageStream();
consoleStreamsetColor(DisplaygetDefault()getSystemColor(
SWTCOLOR_BLUE));
/*
* show view
*/
IConsoleManager manager = (IConsoleManager)
ConsolePlugingetDefault()
getConsoleManager();
manager
addConsoles(new orgeclipseuiconsoleIConsole[] {
(orgeclipseuiconsoleIConsole) console });
managershowConsoleView (console);
return consoleStream;
}


From:http://tw.wingwit.com/Article/program/Java/ky/201311/29115.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.