List of usage examples for com.vaadin.client ServerConnector addStateChangeHandler
public HandlerRegistration addStateChangeHandler(StateChangeHandler handler);
From source file:com.mcparland.john.vaadin_mvn_arch.client.samples.ResetButtonForTextFieldConnector.java
License:Apache License
@Override protected void extend(ServerConnector serverConnector) { serverConnector.addStateChangeHandler(new StateChangeEvent.StateChangeHandler() { /**// w w w . java 2 s.c om * The serialVersionUID. */ private static final long serialVersionUID = 1L; @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { @Override public void execute() { updateResetButtonVisibility(); } }); } }); textField = (VTextField) ((ComponentConnector) serverConnector).getWidget(); textField.addStyleName(CLASSNAME + "-textfield"); resetButtonElement = DOM.createDiv(); resetButtonElement.addClassName(CLASSNAME + "-resetbutton"); textField.addAttachHandler(this); textField.addKeyUpHandler(this); }