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


Java MessageConsoleStream.println方法代码示例

本文整理汇总了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;
}
 
开发者ID:alexander-bergmayr,项目名称:caml2tosca,代码行数:26,代码来源:C2TRunHandler.java

示例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();
	}

}
 
开发者ID:FutureProcessing,项目名称:RFRunnerPlugin,代码行数:27,代码来源:StopTestAction.java

示例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;
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:27,代码来源:EclipseConsole.java

示例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();
	}
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:28,代码来源:BasicNodeOpenEditPolicy.java

示例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);
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:14,代码来源:ConsoleUtils.java

示例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();
	}
}
 
开发者ID:FutureProcessing,项目名称:RFRunnerPlugin,代码行数:29,代码来源:StreamWrapper.java

示例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);
	}
}
 
开发者ID:FutureProcessing,项目名称:RFRunnerPlugin,代码行数:41,代码来源:RunTestAction.java

示例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);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:15,代码来源:ViewHelper.java

示例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");
    }
}
 
开发者ID:reprogrammer,项目名称:checker-framework,代码行数:37,代码来源:CommandlineJavacRunner.java

示例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));
        }
    }
 
开发者ID:reprogrammer,项目名称:checker-framework,代码行数:8,代码来源:CommandlineJavacRunner.java

示例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();
}
 
开发者ID:smaccm,项目名称:smaccm,代码行数:8,代码来源:TestCaseGeneratorMenuListener.java

示例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();
}
 
开发者ID:smaccm,项目名称:smaccm,代码行数:8,代码来源:AgreeMenuListener.java

示例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();
}
 
开发者ID:d-case,项目名称:d-case_editor,代码行数:39,代码来源:DcaseNodeEditPart.java

示例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;
}
 
开发者ID:jplandrain,项目名称:djeclipse,代码行数:11,代码来源:Activator.java

示例15: consoleWrite

import org.eclipse.ui.console.MessageConsoleStream; //导入方法依赖的package包/类
public static void consoleWrite(String msg) {
    console = getConsole();
    MessageConsoleStream out = console.newMessageStream();
    out.println(msg);
}
 
开发者ID:Ericsson,项目名称:CodeCheckerEclipsePlugin,代码行数:6,代码来源:ConsoleFactory.java


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