Search in sources :

Example 71 with SafeHtml

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);
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) SafeUri(com.google.gwt.safehtml.shared.SafeUri)

Example 72 with SafeHtml

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);
}
Also used : SchemaImporterV3(org.activityinfo.ui.client.page.config.design.importer.SchemaImporterV3) PastedTable(org.activityinfo.ui.client.component.importDialog.model.source.PastedTable) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) Test(org.junit.Test)

Example 73 with SafeHtml

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);
}
Also used : SchemaImporterV3(org.activityinfo.ui.client.page.config.design.importer.SchemaImporterV3) PastedTable(org.activityinfo.ui.client.component.importDialog.model.source.PastedTable) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) Test(org.junit.Test)

Example 74 with SafeHtml

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;
}
Also used : DiffElement(edu.stanford.bmir.protege.web.shared.diff.DiffElement) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) WebProtegeShortFormProvider(edu.stanford.bmir.protege.web.server.shortform.WebProtegeShortFormProvider) WebProtegeIRIShortFormProvider(edu.stanford.bmir.protege.web.server.shortform.WebProtegeIRIShortFormProvider) ShortFormProvider(org.semanticweb.owlapi.util.ShortFormProvider) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) OWLObjectRenderer(org.semanticweb.owlapi.io.OWLObjectRenderer)

Example 75 with SafeHtml

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();
}
Also used : SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder)

Aggregations

SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)129 Test (org.junit.Test)38 ImageResource (com.google.gwt.resources.client.ImageResource)25 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)25 UpdateColumnAuditLogEntry (org.drools.workbench.models.guided.dtable.shared.auditlog.UpdateColumnAuditLogEntry)14 BaseColumnFieldDiff (org.drools.workbench.models.guided.dtable.shared.model.BaseColumnFieldDiff)14 Column (com.google.gwt.user.cellview.client.Column)11 AbstractTextColumn (org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn)9 ArrayList (java.util.ArrayList)8 Cell (com.google.gwt.cell.client.Cell)7 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)7 HTML (com.google.gwt.user.client.ui.HTML)6 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)6 ConfirmDialog (org.eclipse.che.ide.api.dialogs.ConfirmDialog)6 LinkedHashMap (java.util.LinkedHashMap)5 Map (java.util.Map)4 ConfirmCallback (org.eclipse.che.ide.api.dialogs.ConfirmCallback)4 ClickableTextCell (com.google.gwt.cell.client.ClickableTextCell)3 Element (com.google.gwt.dom.client.Element)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)3