I found a possible implementation by looking at the source code of the Label widget.
The key point is that the composite widget must implement the HasText interface. therefore, in the declaration and in the body:
public class XTextBox extends Composite implements HasText ...
...
@UiField TextBox textBox;
...
public void setText(String text) {
textBox.setText(text);
}
public String getText() {
return textBox.getText();
}
...
source
share