layoutsLayout.addComponent(createClickableAbsoluteLayout());
layoutsLayout.addComponent(createClickableCSSLayout());
}
private Component createClickableAbsoluteLayout() {
final AbsoluteLayout al = new AbsoluteLayout();
al.setCaption("AbsoluteLayout");
al.setStyleName("borders");
al.setWidth("300px");
al.setHeight("500px");
al.addComponent(new TextField("This is its caption",
"This is a textfield"), "top: 60px; left: 0px; width: 100px;");
al.addComponent(new TextField("Another textfield caption",
"This is another textfield"),
"top: 120px; left: 20px; width: 100px;");
al.addComponent(new Button("A button with its own click listener",
new Button.ClickListener() {
@Override
public void buttonClick(
com.vaadin.ui.Button.ClickEvent event) {
log("Button " + event.getButton().getCaption()
+ " was clicked");
}
}));
al.addLayoutClickListener(new LayoutClickListener() {
@Override
public void layoutClick(LayoutClickEvent event) {
logLayoutClick("AbsoluteLayout", event);
}