本文整理汇总了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);
}
}
}
示例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);
}
}