@UiHandler(value = { "button1", "button2", "button3", "button4" })
public void onClickEvent(ClickEvent e) {
final Widget w = (Widget) e.getSource();
Transition transition = new Transition(new Quadratic(),
Type.EASE_IN_OUT) {
int initialWidth = w.getElement().getClientWidth()
- WidgetHelper.getBoxModel(w).getPaddingWidthContribution();
@Override
protected void onUpdate(double progress) {
WidgetHelper.setPreferredWidth(w,
(int) ((1.0 - progress) * initialWidth) + "px", true);
}
@Override
protected void onComplete() {
w.setVisible(false);
WidgetHelper.setPreferredWidth(w, null);
WidgetHelper.invalidate(w, true);
}
};
transition.run(250);
}