use of eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage in project hale by halestudio.
the class DefaultTransformationReporter method importMessages.
/**
* Add all messages of the given report to this report. They may the logged
* (again) with a call to {@link #setSuccess(boolean)}.
*
* @see ReportLog#importMessages(Report)
*/
@Override
public void importMessages(Report<? extends TransformationMessage> report) {
for (TransformationMessage message : report.getErrors()) {
error.add(message);
}
int errorMore = report.getTotalErrors() - report.getErrors().size();
if (errorMore > 0) {
error.addMore(errorMore);
}
for (TransformationMessage message : report.getWarnings()) {
warn.add(message);
}
int warnMore = report.getTotalWarnings() - report.getWarnings().size();
if (warnMore > 0) {
warn.addMore(warnMore);
}
for (TransformationMessage message : report.getInfos()) {
info.add(message);
}
int infoMore = report.getTotalInfos() - report.getInfos().size();
if (infoMore > 0) {
info.addMore(infoMore);
}
}
use of eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage in project hale by halestudio.
the class TransformationReportPage method onDoubleClick.
@Override
protected void onDoubleClick(Message m) {
if (m instanceof TransformationMessage) {
TransformationMessage tm = (TransformationMessage) m;
AlignmentService as = PlatformUI.getWorkbench().getService(AlignmentService.class);
if (as != null && as.getAlignment().getCell(tm.getCellId()) != null) {
IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
// pin the property sheet if possible
IViewReference ref = activeWindow.getActivePage().findViewReference(IPageLayout.ID_PROP_SHEET);
if (ref != null) {
IViewPart part = ref.getView(false);
if (part instanceof PropertySheet) {
PropertySheet sheet = (PropertySheet) part;
if (!sheet.isPinned()) {
sheet.setPinned(true);
}
}
}
// show cell in mapping view
try {
IViewPart part = activeWindow.getActivePage().showView(MappingView.ID);
if (part instanceof MappingView) {
((MappingView) part).selectCell(tm.getCellId());
}
} catch (PartInitException e) {
// ignore
}
}
}
super.onDoubleClick(m);
}
use of eu.esdihumboldt.hale.common.align.transformation.report.TransformationMessage in project hale by halestudio.
the class TransformationTreeContentProvider method createInstanceTree.
/**
* Create a transformation tree based on a source instance.
*
* @param instance the source instance
* @param typeCell the type cell
* @param alignment the alignment
* @return the transformation tree or <code>null</code>
*/
private TransformationTree createInstanceTree(Instance instance, Cell typeCell, Alignment alignment) {
TransformationTree tree = new TransformationTreeImpl(alignment, typeCell);
ReportLog<TransformationMessage> reporter = new DefaultTransformationReporter("Transformation tree", true);
TransformationLog log = new CellLog(reporter, typeCell);
// context matching
// XXX instead through service/extension point?
ContextMatcher matcher = new AsDeepAsPossible(null);
matcher.findMatches(tree);
// process and annotate the tree
InstanceVisitor visitor = new InstanceVisitor(new FamilyInstanceImpl(instance), tree, log);
tree.accept(visitor);
// duplicate subtree as necessary
DuplicationVisitor duplicationVisitor = new DuplicationVisitor(tree, log);
tree.accept(duplicationVisitor);
duplicationVisitor.doAugmentationTrackback();
return tree;
}
Aggregations