@Override
public Integer calculate() {
int res = clientWidthProperty().get();
Padding padding = textBox.paddingProperty().get();
Border border = textBox.borderProperty().get();
if (padding != null) {
res = res - padding.getLeftPadding() - padding.getRightPadding();
}
if (border != null) {
res = res - border.getLeftBorderSize() - border.getRightBorderSize();
}
return res;
}
});
textBox.heightProperty().bind(new AExpression<Integer>() {
{
bind(clientHeightProperty(), textBox.paddingProperty(), textBox.borderProperty());
}
@Override
public Integer calculate() {
int res = clientHeightProperty().get();
Padding padding = textBox.paddingProperty().get();
Border border = textBox.borderProperty().get();
if (padding != null) {
res = (res - padding.getTopPadding()) - padding.getBottomPadding();
}
if (border != null) {
res = (res - border.getTopBorderSize()) - border.getBottomBorderSize();
}
return res;
}
});
textBox.onKeyUpEvent().addListener(new IEventListener<KeyEventArgs>() {