本文整理汇总了Java中org.eclipse.ui.console.MessageConsoleStream.close方法的典型用法代码示例。如果您正苦于以下问题:Java MessageConsoleStream.close方法的具体用法?Java MessageConsoleStream.close怎么用?Java MessageConsoleStream.close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.console.MessageConsoleStream
的用法示例。
在下文中一共展示了MessageConsoleStream.close方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeToConsole
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
/**
* Displays the specified text at the console, followed by a line
* separator string.
*
* @param text message to display
* @param lineBreak <tt>true</tt> if a linebreak shall be inserted after the message.
* @return <tt>true</tt> if the message was successfully displayed inside the console.
*/
public boolean writeToConsole(String text, boolean lineBreak) {
boolean isWritten = false;
if (this.msgConsole != null) {
MessageConsoleStream out = this.msgConsole.newMessageStream();
if (lineBreak) {
out.println(text);
} else {
out.print(text);
}
try {
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return isWritten;
}
示例2: 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);
}
示例3: print
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public void print(String line) throws IOException {
final MessageConsoleStream output = messageConsole.newMessageStream();
output.print(line);
output.close();
}
示例4: println
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public void println(String line) throws IOException {
final MessageConsoleStream output = messageConsole.newMessageStream();
output.println(line);
output.close();
}
示例5: maybeGetDevJarPath
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
/**
* Returns the path to the gwt-dev-xxx.jar in the event that the launch configuration depends on a
* GWT Contributor Runtime. Otherwise, returns the empty string.
*/
private static String maybeGetDevJarPath(IJavaProject project) {
/*
* In order to figure out whether or not to add the -Dgwt.devjar argument to the list of VM
* args, we have to figure out the runtime that this launch configuration depends on. If the
* project is one of the GWT Runtime projects, then we'll definitely have to add the
* -Dgwt.devjar argument to the launch configuration.
*/
try {
if (GWTProjectsRuntime.isGWTRuntimeProject(project)) {
// Synthesize a temporary contributor SDK so that we can use it
// to compute the devjar path
GwtSdk tempContribSDK = GWTProjectsRuntime.syntheziseContributorRuntime();
if (tempContribSDK.validate().isOK()) {
return tempContribSDK.getDevJar().getAbsolutePath();
} else {
return "";
}
}
GwtSdk sdk = GwtSdk.findSdkFor(project);
if (sdk == null) {
MessageConsole messageConsole =
MessageConsoleUtilities.getMessageConsole(project.getProject().getName() + "-GWT", null);
messageConsole.activate();
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {messageConsole});
final ConsoleColorProvider consoleColorProvider = new ConsoleColorProvider();
final MessageConsoleStream console = messageConsole.newMessageStream();
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
console.setColor(consoleColorProvider.getColor(IDebugUIConstants.ID_STANDARD_ERROR_STREAM));
}
});
console.println("GWT SDK not installed.");
try {
console.close();
} catch (IOException e) {
GWTPluginLog.logError(e, "Unable to close output stream to console");
}
return "";
} else if (sdk.usesGwtDevProject()) {
File gwtDevJarFile = sdk.getDevJar();
return gwtDevJarFile.getAbsolutePath();
}
} catch (SdkException sdke) {
GWTPluginLog.logError(sdke, "Unable to extract gwt dev jar argument from GWTProjectsRuntime");
} catch (JavaModelException jme) {
GWTPluginLog.logError(jme, "Unable to extract gwt dev jar argument from GWTProjectsRuntime");
}
return "";
}