Java Code Examples for com.google.gwt.user.client.ui.TextArea#setFocus()

The following examples show how to use com.google.gwt.user.client.ui.TextArea#setFocus() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WordCloudApp.java    From swcv with MIT License 5 votes vote down vote up
private void createWordCloud()
{
    TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
    String text = textArea.getText().trim();
    if (!text.isEmpty())
    {
        createWordCloud(text);
    }
    else
    {
        textArea.setFocus(true);
    }
}
 
Example 2
Source File: ClipboardSupport.java    From jetpad-projectional-open-source with Apache License 2.0 5 votes vote down vote up
private TextArea createClipboardTextArea() {
  final TextArea pasteArea = new TextArea();
  pasteArea.setPixelSize(0, 0);
  Style style = pasteArea.getElement().getStyle();
  style.setPosition(Style.Position.FIXED);
  RootPanel.get().add(pasteArea);
  pasteArea.setFocus(true);
  return pasteArea;
}