本文整理匯總了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);
}
}