本文整理汇总了Java中org.eclipse.ui.console.MessageConsoleStream.println方法的典型用法代码示例。如果您正苦于以下问题:Java MessageConsoleStream.println方法的具体用法?Java MessageConsoleStream.println怎么用?Java MessageConsoleStream.println使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.console.MessageConsoleStream
的用法示例。
在下文中一共展示了MessageConsoleStream.println方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) {
try {
this.showConsole(event);
this.clearConsole();
IFile file = this.getSelectedFile(event);
String umlModelPath = file.getLocation().toFile().getAbsolutePath();
String toscaModelPath = file.getLocation().toFile().getAbsolutePath();
toscaModelPath = toscaModelPath.replace(".uml", ".tosca");
MessageConsoleStream outStream = console.newMessageStream();
outStream.println("Translating " + umlModelPath + " into " + toscaModelPath);
CAML2TOSCALauncher launcher = new CAML2TOSCALauncher();
launcher.runCAML2TOSCATemplates(umlModelPath, toscaModelPath);
outStream.println("Done ;)");
} catch (Exception e) {
throw new RuntimeException(e);
}
return null;
}
示例2: run
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public void run() {
try {
ISelection selection = treeViewer.getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj instanceof Test) {
if (((Test) obj).getStatus().equals("Actual run")) {
((Test) obj).setStatus("Not run");
treeViewer.refresh();
treeViewer.expandAll();
Runtime.getRuntime().exec("taskkill /F /IM python.exe");
MessageConsoleStream out = ConsoleManager
.getMessageConsoleStream("Console");
out.println("Test Stop");
runTestAction.setEnabled(true);
this.setEnabled(false);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
示例3: 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;
}
示例4: checkDescParameters
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
/**
* Checks Description string.
* @param name the node name.
* @param desc the description.
*/
private void checkDescParameters(String name, String desc) {
Pattern p = Pattern.compile("\\{([^\\}]+)\\}"); //$NON-NLS-1$
ArrayList<String> paramList = new ArrayList<String>();
while (true) {
Matcher m = p.matcher(desc);
if (! m.find()) {
break;
}
String parameter = m.group(1);
paramList.add(parameter);
desc = desc.replaceAll(String.format(PARAM_ITEM_REGEX_FORMAT, parameter), ""); //$NON-NLS-1$
}
// found unknown parameters.
if (paramList.size() > 0) {
MessageConsoleStream stream = DcaseNodeEditPart.getMessageConsoleStream();
stream.print(name + ": cannot found "); //$NON-NLS-1$
for (int i = 0; i < paramList.size(); i++) {
stream.print(paramList.get(i) + ((i == paramList.size()-1) ? "":",")); //$NON-NLS-1$
}
stream.println();
}
}
示例5: printError
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
/**
* Prints error message to the console.
*
* @param message error message to print
*/
public static void printError(final String message) {
final Display display = PlatformUI.getWorkbench().getDisplay();
final MessageConsoleStream consoleStream = getConsoleStream();
final Color color = new Color(display, new RGB(255, 0, 0));
consoleStream.setColor(color);
consoleStream.println(message);
}
示例6: run
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public void run() {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(
inputStream));
String line = null;
MessageConsoleStream out = ConsoleManager
.getMessageConsoleStream("Console");
while ((line = br.readLine()) != null) {
out.println(line);
actualRunTest.setEndTime(System.currentTimeMillis());
if (line.contains("PASS") || (line.contains("FAIL"))) {
if (line.contains("PASS")) {
actualRunTest.setStatus("Passed");
} else if (line.contains("FAIL")) {
actualRunTest.setStatus("Failed");
}
treeContentProvider.updateTest(actualRunTest);
runTestAction.setEnabled(true);
stopTestAction.setEnabled(false);
refresh();
}
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
}
示例7: run
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public void run() {
loadPluginSettings();
MessageConsoleStream out = ConsoleManager
.getMessageConsoleStream("Console");
out.println("");
ISelection selection = treeViewer.getSelection();
Object obj = ((IStructuredSelection) selection)
.getFirstElement();
if (obj instanceof Test) {
Runtime rt = Runtime.getRuntime();
StreamWrapper output;
try {
Test selectedTest = (Test) obj;
String testName = selectedTest.getTestName();
String filePath = selectedTest.getFile().getPath();
String pybotCommand = new StringBuilder(pybotPath)
.append(" --test ").append('"')
.append(testName).append('"').append(' ')
.append(filePath).toString();
Process proc = rt.exec(pybotCommand);
output = new StreamWrapper(proc.getInputStream(),
(Test) obj, treeViewer, treeContentProvider, this, stopTestAction);
selectedTest.setStatus("Actual run");
selectedTest.setStartTime(System.currentTimeMillis());
output.start();
treeViewer.refresh();
treeViewer.expandAll();
} catch (IOException e) {
e.printStackTrace();
}
this.setEnabled(false);
stopTestAction.setEnabled(true);
}
}
示例8: 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);
}
示例9: run
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
/**
* Write the names of all files to be checked into a file-of-file-names(fofn) and
* then call the Checker Framework in "check-only" mode to check the files
* listed in the fofn
*/
public void run()
{
try {
MessageConsoleStream out = CheckerPlugin.findConsole().newMessageStream();
final File srcFofn = PluginUtil.writeTmpSrcFofn("CFPlugin-eclipse", true, PluginUtil.toFiles(fileNames));
final File classpathFofn = PluginUtil.writeTmpCpFile("CFPlugin-eclipse", true, classpath);
final List<String> cmd = createCommand(srcFofn, processors, classpathFofn, bootClasspath, new PrintStream(out));
if (verbose) {
out.println(PluginUtil.join(" ", cmd));
out.println();
out.println("Classpath: \n\t" + classpath + "\n");
out.println("Source Files: \n\t" + PluginUtil.join("\n\t", fileNames));
}
final String [] cmdArr = cmd.toArray(new String[cmd.size()]);
checkResult = Command.exec(cmdArr);
if (verbose) {
printTrimmedOutput(out, checkResult);
out.println("\n*******************\n");
}
srcFofn.delete();
classpathFofn.delete();
} catch (IOException e) {
CheckerPlugin.logException(e, "Error calling javac");
}
}
示例10: printTrimmedOutput
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public static void printTrimmedOutput(final MessageConsoleStream out, final String output) {
List<String> lines = Arrays.asList(output.split(Util.NL));
for( final String line : lines ) {
out.println(JavacError.trimDetails(line));
}
}
示例11: printHLine
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
private void printHLine(MessageConsoleStream out, int nVars) {
out.print("--------------------------------------------------");
for (int k = 0; k < nVars; k++) {
out.print("---------------------");
}
out.println();
}
示例12: printHLine
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public static void printHLine(MessageConsoleStream out, int nVars) {
out.print("--------------------------------------------------");
for (int k = 0; k < nVars; k++) {
out.print("---------------------");
}
out.println();
}
示例13: parameterListToString
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
/**
* Converts parameter list to string.
* @param paramList the parameter list.
* @return the string of parameter list.
*/
protected String parameterListToString(List<ParameterData> paramList) {
Collections.sort(paramList, new ParameterComparator());
StringBuffer ret = new StringBuffer();
ArrayList<String> nameList = null;
int prevdist = -1;
for (int i = 0; i < paramList.size(); i++) {
ParameterData curData = paramList.get(i);
/* check duplicate parameter */
if (curData.getDistance() != prevdist) {
nameList = new ArrayList<String>();
prevdist = curData.getDistance();
}
String parameters = curData.getValues();
if (parameters == null || parameters.length() == 0) {
continue;
}
for (ParameterItem item : ParameterItem.getPatameterList(parameters)) {
String name = item.getParameterId();
if (nameList.contains(name)) {
MessageConsoleStream stream = getMessageConsoleStream();
stream.println(NLS.bind(Messages.ParameterDuplicated, name));
} else {
nameList.add(name);
}
}
ret.append(curData.getValues());
if (i < paramList.size() - 1) {
ret.append(ParameterItem.SEPARATOR);
}
}
return ret.toString();
}
示例14: printToPluginConsole
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public static boolean printToPluginConsole(String message) {
if(message == null || message.length() == 0) {
return false;
}
MessageConsole myConsole = findConsole();
MessageConsoleStream out = myConsole.newMessageStream();
out.println(message);
showPluginConsole();
return true;
}
示例15: consoleWrite
import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public static void consoleWrite(String msg) {
console = getConsole();
MessageConsoleStream out = console.newMessageStream();
out.println(msg);
}