*/
void addExternalOntology(final String ontologyUri, final MyDialog popup) {
HorizontalPanel hp = new HorizontalPanel();
hp.setSpacing(10);
hp.add(new HTML(
"<img src=\"" +GWT.getModuleBaseURL()+ "images/loading.gif\">" +
" Loading " +ontologyUri+
"<br/>Please wait..."
));
popup.setWidget(hp);
popup.setText("Loading ontology...");
AsyncCallback<ExternalOntologyInfo> callback = new AsyncCallback<ExternalOntologyInfo>() {
public void onFailure(Throwable thr) {
popup.hide();
Orr.log("calling getExternalOntologyInfo ... failure! ");
String error = thr.getClass().getName()+ ": " +thr.getMessage();
while ( (thr = thr.getCause()) != null ) {
error += "\ncaused by: " +thr.getClass().getName()+ ": " +thr.getMessage();
}
Window.alert(error);
}
public void onSuccess(ExternalOntologyInfo ontologyInfo) {
String error = ontologyInfo.getError();
if (error != null) {
Orr.log("calling getExternalOntologyInfo ... error=" + error);
popup.setWidget(new Label(error));
Window.alert("Error while trying to load '" +ontologyUri+ "':\n\n" + error);
}
else {
Orr.log("calling getExternalOntologyInfo ... success");
popup.setWidget(new HTML("Load complete"));
notifyWorkingExternalOntologyAdded(ontSel, ontologyInfo);
}
popup.hide();
}
};