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


Java IStatus.getChildren方法代码示例

本文整理汇总了Java中org.eclipse.core.runtime.IStatus.getChildren方法的典型用法代码示例。如果您正苦于以下问题:Java IStatus.getChildren方法的具体用法?Java IStatus.getChildren怎么用?Java IStatus.getChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.runtime.IStatus的用法示例。


在下文中一共展示了IStatus.getChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: logError

import org.eclipse.core.runtime.IStatus; //导入方法依赖的package包/类
/**
 * Dispatches given status with {@link Logger#error} and to the {@code STD_ERR} of used output stream. If provided
 * status {@link IStatus#getChildren() has children} it will log them recursively.
 */
public void logError(final IStatus status) {
	logError(status.getMessage(), status.getException());
	final IStatus[] children = status.getChildren();
	if (!Arrays2.isEmpty(children)) {
		for (final IStatus child : children) {
			logError(child);
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:14,代码来源:NpmLogger.java

示例2: runIteration

import org.eclipse.core.runtime.IStatus; //导入方法依赖的package包/类
private void runIteration(String cim, String cosem, String substation, int index, String changeSet, String runIndex, String phase, TransformationExecutor executor, ExecutionContextImpl context) {

		List<ModelExtent> modelExtents = new ArrayList<ModelExtent>();
		long loadModelsstart = System.nanoTime();
		modelExtents.add(this.createModelExtent(cim));
		if ("outagePrevention".equals(this.transformation)) {
			modelExtents.add(this.createModelExtent(substation));
		}
		modelExtents.add(this.createModelExtent(cosem));
		long loadModelsEnd = System.nanoTime();
		if (phase == "Initial") {
			System.out.println("ModelJoin;" + this.transformation + ";" + changeSet + ";" + runIndex + ";" + Integer.toString(index) + ";" + phase + ";Time;" + Long.toString(loadModelsEnd-loadModelsstart));
		}
		ModelExtent output = new BasicModelExtent();
		modelExtents.add(output);
		modelExtents.add(new BasicModelExtent());

		long start = System.nanoTime();
		ExecutionDiagnostic result = executor.execute(context,
				modelExtents.toArray(new ModelExtent[modelExtents.size()]));
		long end = System.nanoTime();

		if (result.getSeverity() == Diagnostic.OK) {
			// the output objects got captured in the output extent
			XMIResource outResource = (XMIResource) rs
					.createResource(URI.createFileURI(new File(this.transformation + ".xmi").getAbsolutePath()));
			outResource.getContents().addAll(output.getContents());
			try {
				outResource.save(null);
				System.out.println("ModelJoin;" + this.transformation + ";" + changeSet + ";" + runIndex + ";" + Integer.toString(index) + ";" + phase + ";Time;" + Long.toString(end-start));
				System.out.println("ModelJoin;" + this.transformation + ";" + changeSet + ";" + runIndex + ";" + Integer.toString(index) + ";" + phase + ";Elements;" + Integer.toString(outResource.getContents().size()));
			} catch (IOException e) {
				e.printStackTrace();
			}
		} else {
			IStatus status = BasicDiagnostic.toIStatus(result);
			StringBuilder s = new StringBuilder();
			s.append("Failed to execute ");
			s.append(this.transformation);
			s.append(": ");
			s.append(status.getMessage());
			for (IStatus child : status.getChildren()) {
				s.append("\n " + child.getMessage());
			}
			System.err.println(s);
		}
	}
 
开发者ID:georghinkel,项目名称:ttc2017smartGrids,代码行数:48,代码来源:App.java


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