public void validate(ToggleEditor editor) {
TransUnitId transUnitId = editor.getId();
Optional<String> sourceContent =
sourceContentsPresenter.getSourceContent(transUnitId);
if (sourceContent.isPresent()) {
RunValidationEvent event =
new RunValidationEvent(sourceContent.get(),
editor.getText(), false);
// widget that displays red outline
event.addWidget(editor);
// widget that displays warnings
Optional<TargetContentsDisplay> targetDisplay =
Finds.findDisplayById(displayList, transUnitId);
if (targetDisplay.isPresent()) {
event.addWidget(targetDisplay.get());
}
eventBus.fireEvent(event);
}
}