add.setLayoutAlign(VerticalAlignment.CENTER);
add.setAutoFit(true);
add.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
final Portlet portlet = new Portlet();
portlet.setTitle(I18nProvider.getSampleMessages().multipleListenersPortletTitle());
final Label label = new Label();
label.setHeight(30);
label.setContents(I18nProvider.getSampleMessages().multipleListenersPortletText() + " = ?");
portlet.setHeight(70);
portlet.addItem(label);
portalLayout.addPortlet(portlet, (column++) % 3, 0);
final Listener listener = new AbstractListener() {
public void onMouseMove(ListenerEvent event) {
label.setContents(I18nProvider.getSampleMessages().multipleListenersPortletText() + " = "
+ event.getScreenPosition());
}
};
map.addListener(listener);
portlet.addCloseClickHandler(new CloseClickHandler() {
public void onCloseClick(CloseClientEvent event) {
map.removeListener(listener);
if (map.getListeners() != null) {
SC.say(I18nProvider.getSampleMessages().multipleListenersCount(map.getListeners().size()));
}
portlet.destroy();
}
});
SC.say(I18nProvider.getSampleMessages().multipleListenersCount(map.getListeners().size()));
}
});