VerticalPanel vp = new VerticalPanel();
vp.setSpacing(4);
vp.setHorizontalAlignment(ALIGN_CENTER);
final MyDialog popup = new MyDialog(vp);
popup.setText("Available versions for " +oi.getUnversionedUri());
IOntologyTable ontologyTable = OntologyTableCreator.create(PortalControl.getInstance().getQuickInfo(), true);
ontologyTable.setIncludeVersionInLinks(true);
final boolean sortDown = true; // (version, true) = most recent version first.
ontologyTable.setSortColumn("version", sortDown);
// this is to hide the popup when the user clicks one of the links:
ontologyTable.addClickListenerToHyperlinks(
new ClickListener() {
public void onClick(Widget sender) {
popup.hide();
}
}
);
vp.add(ontologyTable.getWidget());
ontologyTable.setOntologyInfos(ontologyInfos, pctrl.getLoginResult());
// close the popup if history changes:
History.addHistoryListener(new HistoryListener() {
public void onHistoryChanged(String historyToken) {
popup.setAnimationEnabled(false);
popup.hide();
}
});
// popup.center();
// popup.show();
popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
public void setPosition(int offsetWidth, int offsetHeight) {
int left = (Window.getClientWidth() - offsetWidth) / 3;
int top = (Window.getClientHeight() - offsetHeight) / 3;
popup.setPopupPosition(left, top);
}
});
}