MessageListPopup popup = getMessagePopup();
if(popup!=null) popup.hide();
}
};
final DefaultButton button = new DefaultButton(Console.CONSTANTS.common_label_messages());
button.getElement().setAttribute("style", "width:100%;border-color:#cccccc;margin-right:5px;");
ClickHandler clickHandler = new ClickHandler() {
public void onClick(ClickEvent event) {
int numMessages = fetchMessages(messagePopup);
if(numMessages==0)numMessages=1;
int width = 250;
int height = numMessages*35;
messagePopup.setPopupPosition(
button.getAbsoluteLeft() - (width+10-button.getOffsetWidth()) ,
button.getAbsoluteTop() - (height+18)
);
messagePopup.show();
messagePopup.setWidth(width+"px");
messagePopup.setHeight(height+"px");
}
};
button.addClickHandler(clickHandler);
// register listener
messageCenter.addMessageListener(this);
messageDisplay = new LayoutPanel();