Example usage for com.vaadin.v7.ui TextField setWidth

List of usage examples for com.vaadin.v7.ui TextField setWidth

Introduction

In this page you can find the example usage for com.vaadin.v7.ui TextField setWidth.

Prototype

public void setWidth(String width);

Source Link

Document

Sets the width of the component using String presentation.

Usage

From source file:org.jpos.qi.components.QIFieldFactory.java

License:Open Source License

@Override
public <T extends Field> T createField(Class<?> dataType, Class<T> fieldType) {
    Field f;/*from   w  w w  .ja v  a  2  s  .  co m*/
    if (BigDecimal.class.equals(dataType)) {
        f = (Field) new BigDecimalField();
    } else {
        f = super.createField(dataType, fieldType);
    }
    if (f instanceof TextField) {
        TextField tf = (TextField) f;
        tf.setWidth("80%");
        tf.setNullRepresentation("");
        tf.setImmediate(true);
        return (T) tf;
    }
    return (T) f;
}