Example usage for com.google.gwt.user.client.ui TextArea getCharacterWidth

List of usage examples for com.google.gwt.user.client.ui TextArea getCharacterWidth

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui TextArea getCharacterWidth.

Prototype

public int getCharacterWidth() 

Source Link

Document

Gets the requested width of the text box (this is not an exact value, as not all characters are created equal).

Usage

From source file:com.example.GWTOAuthLoginDemo.client.GWTOAuthLoginDemo.java

License:Open Source License

public void log(String msg) {
    if (appScreen == null) {
        return;/*from w  w w .  j  a  v  a2 s . c om*/
    }
    TextArea logTextArea = appScreen.getTextArea();
    Date d = new Date();
    String t = d.toString() + ": " + msg;
    int cW = logTextArea.getCharacterWidth();
    String currentText = logTextArea.getText();
    if (currentText.length() > 0) {
        logTextArea.setText(currentText + "\n" + t);
    } else {
        logTextArea.setText(t);

    }
    appScreen.getScrollPanel().scrollToBottom();
    Log.debug(msg);
}