use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project webprotege by protegeproject.
the class ChoiceFieldCheckBoxEditor method setChoices.
@Override
public void setChoices(List<ChoiceDescriptor> choices) {
container.clear();
checkBoxes.clear();
for (ChoiceDescriptor choiceDescriptor : choices) {
CheckBox checkBox = new CheckBox(new SafeHtmlBuilder().appendHtmlConstant(choiceDescriptor.getLabel()).toSafeHtml());
checkBoxes.put(checkBox, choiceDescriptor);
container.add(checkBox);
checkBox.getElement().getStyle().setDisplay(Style.Display.BLOCK);
checkBox.addValueChangeHandler(checkBoxValueChangedHandler);
checkBox.addStyleName(WebProtegeClientBundle.BUNDLE.style().noFocusBorder());
checkBox.addFocusHandler(event -> {
checkBox.addStyleName(WebProtegeClientBundle.BUNDLE.style().focusBorder());
checkBox.removeStyleName(WebProtegeClientBundle.BUNDLE.style().noFocusBorder());
});
checkBox.addBlurHandler(event -> {
checkBox.addStyleName(WebProtegeClientBundle.BUNDLE.style().noFocusBorder());
checkBox.removeStyleName(WebProtegeClientBundle.BUNDLE.style().focusBorder());
});
}
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project webprotege by protegeproject.
the class EntityCrudKitSettingsEditorImpl method validatePrefix.
private void validatePrefix() {
int selectedIndex = suffixSelectorListBox.getSelectedIndex();
if (selectedIndex == -1) {
return;
}
String prefix = iriPrefixEditor.getText().trim();
EntityCrudKit<?> crudKit = descriptors.get(selectedIndex);
Optional<String> validationMessage = crudKit.getPrefixValidationMessage(prefix);
if (validationMessage.isPresent()) {
prefixValidatorMessage.setHTML(new SafeHtmlBuilder().appendHtmlConstant(validationMessage.get()).toSafeHtml());
prefixValidatorMessage.setVisible(true);
} else {
prefixValidatorMessage.setVisible(false);
}
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project webprotege by protegeproject.
the class CommentPostedEventView method setValue.
public void setValue(CommentPostedEvent event) {
Comment comment = event.getComment();
UserId createdBy = comment.getCreatedBy();
userNameLabel.setText(createdBy.getUserName());
userIconHolder.setWidget(UserIcon.get(createdBy));
final java.util.Optional<OWLEntityData> targetAsEntityData = event.getEntity();
if (targetAsEntityData.isPresent()) {
entityLabel.setEntity(targetAsEntityData.get());
entityLabel.setVisible(true);
} else {
entityLabel.setVisible(false);
}
timeLabel.setBaseTime(comment.getCreatedAt());
final SafeHtmlBuilder builder = new SafeHtmlBuilder();
bodyLabel.setHTML(builder.appendHtmlConstant(comment.getRenderedBody()).toSafeHtml());
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project webprotege by protegeproject.
the class CommentViewImpl method setBody.
@Override
public void setBody(String body) {
bodyField.setText(body);
bodyField.setHTML(new SafeHtmlBuilder().appendHtmlConstant(body).toSafeHtml());
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project webprotege by protegeproject.
the class MessageBox method showErrorMessage.
public static void showErrorMessage(String mainMessage, Throwable throwable) {
SafeHtmlBuilder sb = new SafeHtmlBuilder();
sb.appendEscaped("Details: ");
sb.appendEscaped(throwable.getMessage());
showAlert(mainMessage, sb.toSafeHtml().toString());
}
Aggregations