@Override
public void onEvent(Event event) throws Exception {
// 1. Reset to normal image
btnOpenMsg.setImage("/images/icons/message2_16x16.gif");
// 2. open the message window
Window win = getMsgWindow();
Textbox t = (Textbox) win.getFellow("tb");
t.setText(getMsg());
// TODO scroll to latest message
// Clients.scrollIntoView(t);
}
});
// send message button
this.btnSendMsg = new Toolbarbutton();
this.btnSendMsg.setWidth("20px");
this.btnSendMsg.setHeight("20px");
this.btnSendMsg.setImage("/images/icons/message1_16x16.gif");
this.btnSendMsg.setTooltiptext(Labels.getLabel("common.Message.Send"));
this.btnSendMsg.setParent(div);
this.btnSendMsg.addEventListener("onClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
// open a box for inserting the message
Window win = (Window) Path.getComponent("/outerIndexWindow");
final String str = InputMessageTextBox.show(win);
EventQueues.lookup("testEventQueue", EventQueues.APPLICATION, true).publish(new Event("onTestEventQueue", null, str));
}
});