*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a basic popup widget
final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true);
simplePopup.ensureDebugId("cwBasicPopup-simplePopup");
simplePopup.setWidth("150px");
simplePopup.setWidget(new HTML(
constants.cwBasicPopupClickOutsideInstructions()));
// Create a button to show the popup
Button openButton = new Button(constants.cwBasicPopupShowButton(),
new ClickHandler() {
public void onClick(ClickEvent event) {
// Reposition the popup relative to the button
Widget source = (Widget) event.getSource();
int left = source.getAbsoluteLeft() + 10;
int top = source.getAbsoluteTop() + 10;
simplePopup.setPopupPosition(left, top);
// Show the popup
simplePopup.show();
}
});
// Create a popup to show the full size image
Image jimmyFull = new Image(Showcase.images.jimmy());