mitrakov

GWT Textbox Dialog

Sep 28th, 2019
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. import com.google.gwt.user.client.ui.TextBox;
  2. import java.util.function.BiConsumer;
  3.  
  4. public class TextBoxDialog extends OkCancelDialog<TextBox> { // see https://pastebin.com/e3ThyE40
  5.     public TextBoxDialog(String title, String defaultValue, BiConsumer<TextBox, OkCancelDialog<TextBox>> onClick) {
  6.         super(title, new TextBox(), onClick);
  7.         widget.setText(defaultValue);
  8.     }
  9.  
  10.     @Override
  11.     public void show() {
  12.         super.show();
  13.         widget.selectAll();
  14.     }
  15. }
Add Comment
Please, Sign In to add comment