@Override
public void valueChange(ValueChangeEvent event) {
Integer h = ((Integer) hAlign.getValue()).intValue();
int v = ((Integer) vAlign.getValue()).intValue();
updateAlignments(new Alignment(h + v));
}
};
hAlign.setValue(new Integer(Bits.ALIGNMENT_LEFT));
vAlign.addListener(alignmentChangeListener);
hAlign.addListener(alignmentChangeListener);
vAlign.setValue(new Integer(Bits.ALIGNMENT_TOP));
controls.addComponent(new Label("layout alignment"));
final NativeSelect lAlign = new NativeSelect();
controls.addComponent(lAlign);
lAlign.setNullSelectionAllowed(false);
lAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
lAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
lAlign.setItemCaption(
new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");
lAlign.addListener(new Property.ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
testPanelLayout.setComponentAlignment(
testedLayout,
new Alignment(((Integer) lAlign.getValue())
.intValue() + Bits.ALIGNMENT_TOP));
}
});
}