buttons.add(toggleLeftBtn);
final SimpleToggleButton toggleRightBtn = new SimpleToggleButton("Hide Right");
toggleRightBtn.getDownFace().setText("Show Right");
buttons.add(toggleRightBtn);
final SimpleHorizontalSplitPanel hsp = new SimpleHorizontalSplitPanel();
hsp.setSize("100%", "100%");
ScrollPanel lsp = new ScrollPanel(createContent(createVeryLongText(), "#CCFFCC"));
lsp.setSize("100%", "100%");
hsp.setLeftWidget(lsp);
ScrollPanel rsp = new ScrollPanel(createContent(createVeryLongText(), "#FFFBA3"));
rsp.setSize("100%", "100%");
hsp.setRightWidget(rsp);
hsp.setSize("100%", "100%");
toggleLeftBtn.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
hsp.setLeftWidgetVisible(!toggleLeftBtn.isDown());
toggleRightBtn.setDown(!toggleLeftBtn.isDown());
}
});
toggleRightBtn.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
hsp.setRightWidgetVisible(!toggleRightBtn.isDown());
toggleLeftBtn.setDown(!toggleRightBtn.isDown());
}
});
main.add(buttons, DockPanel.NORTH);