Merge branch 'stable-2.6'

* stable-2.6:
  Handle 'Event.ONPASTE' in CreateGroupScreen
  OnEditEnabler can disable the widget
  Re-add comment why connection pooling is turned off for MySQL
  Fix issues with Prolog files in Eclipse
This commit is contained in:
Shawn Pearce
2013-05-06 07:31:51 -07:00
4 changed files with 45 additions and 3 deletions

View File

@@ -33,6 +33,7 @@ import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.FocusWidget;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.TextBoxBase;
import com.google.gwt.user.client.ui.ValueBoxBase;
import java.util.HashMap;
import java.util.Map;
@@ -139,6 +140,17 @@ public class OnEditEnabler implements KeyPressHandler, KeyDownHandler,
if (widget.isEnabled() ||
! (e.getSource() instanceof FocusWidget) ||
! ((FocusWidget) e.getSource()).isEnabled() ) {
if (e.getSource() instanceof ValueBoxBase) {
final TextBoxBase box = ((TextBoxBase) e.getSource());
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
if (box.getValue().trim().length() == 0) {
widget.setEnabled(false);
}
}
});
}
return;
}