anchor2.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent clickEvent) {
final PPopupPanel popupPanel = new PPopupPanel();
final PVerticalPanel content = new PVerticalPanel();
final PButton closeButton = new PButton("Close");
closeButton.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent clickEvent) {
popupPanel.hide();
}
});
content.add(new PLabel("A popup displayed relatively to the mouse click"));
content.add(closeButton);
content.setWidth("200px");
content.setHeight("200px");
popupPanel.setWidget(content);
popupPanel.setPopupPosition(clickEvent.getClientX(), clickEvent.getClientY());
popupPanel.show();
}
});
addLabel("A draggable popup");
final PButton anchor3 = addButton("Open");