use of com.google.gwt.safehtml.shared.SafeHtml in project activityinfo by bedatadriven.
the class UnsupportedDialog method show.
public static void show() {
Template template = GWT.create(Template.class);
SafeUri downloadUri = UriUtils.fromSafeConstant("https://www.google.com/chrome/browser/desktop/?hl=" + LocaleInfo.getCurrentLocale().getLocaleName());
SafeHtml message = template.message(I18N.CONSTANTS.offlineNotSupported(), downloadUri, I18N.CONSTANTS.downloadGoogleChrome());
MessageBox.alert(I18N.CONSTANTS.offlineNotSupportedTitle(), message.asString(), null);
}
use of com.google.gwt.safehtml.shared.SafeHtml in project activityinfo by bedatadriven.
the class SchemaCsvWriterV3Test method missingReferences.
@Test
public void missingReferences() throws IOException {
PastedTable pastedTable = readExportAsTable("malformed-ref.csv");
System.out.println(pastedTable);
SchemaImporterV3 importer = new SchemaImporterV3(database.getId(), null, null);
assertTrue(importer.parseColumns(pastedTable));
boolean success = importer.processRows();
for (SafeHtml warning : importer.getWarnings()) {
System.out.println(warning);
}
assertTrue("warnings emitted", importer.getWarnings().size() == 1);
assertTrue("parsing failed", !success);
}
use of com.google.gwt.safehtml.shared.SafeHtml in project activityinfo by bedatadriven.
the class SchemaCsvWriterV3Test method missingFieldNames.
@Test
public void missingFieldNames() throws IOException {
PastedTable pastedTable = readExportAsTable("malformed.csv");
SchemaImporterV3 importer = new SchemaImporterV3(database.getId(), null, null);
assertTrue("columns found", importer.parseColumns(pastedTable));
boolean success = importer.processRows();
for (SafeHtml warning : importer.getWarnings()) {
System.out.println(warning);
}
assertTrue("warnings emitted", importer.getWarnings().size() == 2);
assertTrue("parsing failed", !success);
}
use of com.google.gwt.safehtml.shared.SafeHtml in project webprotege by protegeproject.
the class ComputeProjectMergeActionHandler method renderDiff.
private List<DiffElement<String, SafeHtml>> renderDiff(OWLOntology uploadedRootOntology, Set<OntologyDiff> diffs) {
final ShortFormProvider dualShortFormProvider = getShortFormProvider(uploadedRootOntology);
final OWLObjectRenderer renderer = getManchesterSyntaxObjectRenderer(projectRootOntology, uploadedRootOntology, dualShortFormProvider);
List<DiffElement<String, OWLAxiom>> diffElements = getDiffElements(diffs);
sortDiff(diffElements);
// Transform from OWLAxiom to SafeHtml
List<DiffElement<String, SafeHtml>> transformedDiff = new ArrayList<>();
for (DiffElement<String, OWLAxiom> element : diffElements) {
String html = renderer.render(element.getLineElement());
SafeHtml rendering = new SafeHtmlBuilder().appendHtmlConstant(html).toSafeHtml();
transformedDiff.add(new DiffElement<>(element.getDiffOperation(), element.getSourceDocument(), rendering));
}
return transformedDiff;
}
use of com.google.gwt.safehtml.shared.SafeHtml in project ovirt-engine by oVirt.
the class ErrorMessageFormatter method formatErrorMessages.
public static String formatErrorMessages(List<String> values) {
if (values.size() == 1) {
return values.get(0);
}
SafeHtmlBuilder allSb = new SafeHtmlBuilder();
// $NON-NLS-1$
allSb.append(SafeHtmlUtils.fromTrustedString("<br/><br/>"));
SafeHtml sh = buildItemList(values);
allSb.append(sh);
return allSb.toSafeHtml().asString();
}
Aggregations