use of edu.stanford.bmir.protege.web.client.library.dlg.WebProtegeDialog in project webprotege by protegeproject.
the class CsvImportPresenter method startImport.
public void startImport() {
UploadFileResultHandler uploadResultHandler = new UploadFileResultHandler() {
@Override
public void handleFileUploaded(final DocumentId fileDocumentId) {
WebProtegeDialog<CSVImportDescriptor> csvImportDialog = new WebProtegeDialog<>(new CSVImportDialogController(projectId, fileDocumentId, baseClass, dispatchServiceManager, new CSVImportViewImpl(primitiveDataEditorProvider)));
csvImportDialog.setVisible(true);
}
@Override
public void handleFileUploadFailed(String errorMessage) {
ProgressMonitor.get().hideProgressMonitor();
MessageBox.showAlert("Error uploading CSV file", errorMessage);
}
};
UploadFileDialogController controller = new UploadFileDialogController("Upload CSV", uploadResultHandler);
WebProtegeDialog.showDialog(controller);
}
use of edu.stanford.bmir.protege.web.client.library.dlg.WebProtegeDialog in project webprotege by protegeproject.
the class ShowFreshEntitySettingsHandlerImpl method showDialog.
private void showDialog(final GetEntityCrudKitSettingsResult result) {
EntityCrudKitSettingsDialogController controller = dialogControllerProvider.get();
WebProtegeDialog<EntityCrudKitSettings<?>> dlg = new WebProtegeDialog<>(controller);
dlg.getController().setDialogButtonHandler(DialogButton.OK, (data, closer) -> updateFreshEntitySettings(result.getSettings(), data, closer));
dlg.setPopupPositionAndShow((w, h) -> dlg.setPopupPosition((Window.getClientWidth() - w) / 2, 100));
controller.getEditor().setValue(result.getSettings());
}
use of edu.stanford.bmir.protege.web.client.library.dlg.WebProtegeDialog in project webprotege by protegeproject.
the class WatchPresenter method start.
public void start(final OWLEntity forEntity) {
final UserId userId = loggedInUserProvider.getCurrentUserId();
dispatchServiceManager.execute(new GetWatchesAction(projectId, userId, forEntity), new DispatchServiceCallback<GetWatchesResult>() {
@Override
public void handleSuccess(GetWatchesResult result) {
Set<Watch> watches = result.getWatches();
updateDialog(watches);
WebProtegeDialog<WatchTypeSelection> dlg = new WebProtegeDialog<>(controller);
dlg.show();
controller.setDialogButtonHandler(DialogButton.OK, (data, closer) -> {
closer.hide();
handleWatchTypeForEntity(data, forEntity);
});
}
});
}
use of edu.stanford.bmir.protege.web.client.library.dlg.WebProtegeDialog in project webprotege by protegeproject.
the class ChangeEmailAddressPresenter method showDialog.
private void showDialog(Optional<EmailAddress> emailAddress) {
final UserId userId = loggedInUserProvider.getCurrentUserId();
ChangeEmailAddressDialogController controller = new ChangeEmailAddressDialogController();
emailAddress.ifPresent(controller::setValue);
controller.setDialogButtonHandler(DialogButton.OK, (data, closer) -> {
if (data.isPresent()) {
dispatchServiceManager.execute(new SetEmailAddressAction(userId, data.get().getEmailAddress()), result -> {
if (result.getResult() == ADDRESS_ALREADY_EXISTS) {
MessageBox.showMessage("Address already taken", "The email address that you have specified is taken by another user. " + "Please specify a different email address.");
} else {
closer.hide();
}
});
} else {
MessageBox.showAlert("The specified email addresses do not match.");
}
});
WebProtegeDialog<Optional<EmailAddress>> dlg = new WebProtegeDialog<Optional<EmailAddress>>(controller);
dlg.setVisible(true);
}
Aggregations