當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。