FlexCellFormatter cellFormatter = topFlexTable.getFlexCellFormatter();
topFlexTable.setCellSpacing(3);
topFlexTable.setCellPadding(3);
cellFormatter.setColSpan(0, 0, 2);
final RichTextArea area = new RichTextArea();
area.ensureDebugId("cwRichText-area");
area.setSize("750px", "100px");
topFlexTable.setWidget(0, 0, area);
/*
* Image reloadImage = new Image("/images/refresh.png");
* reloadImage.setWidth("24px"); reloadImage.setHeight("24px");
* reloadImage.addStyleName("img_button"); topFlexTable.setWidget(1, 0,
* reloadImage);
*/
Button sendButton = new Button("SendMessage");
cellFormatter.setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_RIGHT);
topFlexTable.setWidget(1, 1, sendButton);
final FlexTable flexTable = new FlexTable();
flexTable.addStyleName("cw-FlexTable");
flexTable.setWidth("100%");
flexTable.setCellSpacing(5);
flexTable.setCellPadding(3);
VerticalSplitPanel vSplit = new VerticalSplitPanel();
vSplit.ensureDebugId("cwVerticalSplitPanel");
vSplit.setSize("100%", "100%");
vSplit.setSplitPosition("155px");
vSplit.setTopWidget(topFlexTable);
vSplit.setBottomWidget(flexTable);
final MessageAsyncCallback messageAsyncCallback = new MessageAsyncCallback();
messageAsyncCallback.setFlexTable(flexTable);
greetingService.loadGreeting(messageAsyncCallback);
sendButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (area.getText() == null || area.getText().trim().length() == 0) {
Window.alert("no message need to send!!!");
} else {
greetingService.pushMessage(encrypt(encryptKey, area.getText()), messageAsyncCallback);
area.setText("");
}
}
});
/*