final PButton anchor4 = addButton("Open");
anchor4.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent clickEvent) {
final POptionPane dialodBox = POptionPane.showConfirmDialog(new PActionHandler() {
@Override
public void onAction(final PDialogBox dialogBox, final String option) {
dialogBox.hide();
}
}, "Your custom text");
dialodBox.getDialogBox().addCloseHandler(new PCloseHandler() {
@Override
public void onClose(final PCloseEvent closeEvent) {
final DemoBusinessEvent event = new DemoBusinessEvent(this);
event.setBusinessMessage("Dialog box closed");
fireEvent(event);
}
});
}
});
addLabel("A confirm dialog listenening on the close event");
final PButton anchor5 = addButton("Open");
anchor5.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent clickEvent) {
POptionPane.showConfirmDialog(new PActionHandler() {
@Override
public void onAction(final PDialogBox dialogBox, final String option) {
dialogBox.hide();
final DemoBusinessEvent event = new DemoBusinessEvent(this);