Example usage for com.vaadin.ui TextField TextField

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

Introduction

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

Prototype

public TextField() 

Source Link

Document

Constructs an empty TextField with no caption.

Usage

From source file:br.com.anteros.mobileserver.app.form.ApplicationForm.java

License:Apache License

private void createFields() {
    fldId = new TextField();
    fldId.setCaption("Id");
    fldId.setWidth("100px");
    fldId.setStyleName("small");

    fldName = new TextField();
    fldName.setCaption("Nome da aplicao");
    fldName.setWidth("200px");
    fldName.setRequired(true);/*from   w ww  .j av  a2 s  .  com*/
    fldName.setRequiredError("Informe o nome da aplicao.");
    fldName.setStyleName("small");

    fldDescription = new TextField();
    fldDescription.setCaption("Descrio da aplicao");
    fldDescription.setWidth("500px");
    fldDescription.setRequired(true);
    fldDescription.setRequiredError("Informe a descrio da aplicao.");
    fldDescription.setStyleName("small");

    cbDialect = new ComboBox();
    cbDialect.setImmediate(false);
    cbDialect.setWidth("-1px");
    cbDialect.setHeight("-1px");
    cbDialect.addItem(MobileServerContext.H2);
    cbDialect.addItem(MobileServerContext.ORACLE);
    cbDialect.addItem(MobileServerContext.MYSQL);
    cbDialect.addItem(MobileServerContext.FIREBIRD);
    cbDialect.addItem(MobileServerContext.POSTGRESQL);
    cbDialect.setRequired(true);
    cbDialect.setCaption("Dialeto");
    cbDialect.setRequiredError("Informe a dialeto da aplicao.");
    cbDialect.setStyleName("small");

    cbCharset = new ComboBox();
    cbCharset.setImmediate(false);
    cbCharset.setWidth("157px");
    cbCharset.setHeight("-1px");
    cbCharset.addItem(AnterosStandardsCharsets.ISO_8859_1.name());
    cbCharset.addItem(AnterosStandardsCharsets.US_ASCII.name());
    cbCharset.addItem(AnterosStandardsCharsets.UTF_16.name());
    cbCharset.addItem(AnterosStandardsCharsets.UTF_16BE.name());
    cbCharset.addItem(AnterosStandardsCharsets.UTF_16LE.name());
    cbCharset.addItem(AnterosStandardsCharsets.UTF_8.name());
    cbCharset.setRequired(true);
    cbCharset.setCaption("Charset");
    cbCharset.setRequiredError("Informe o charset da aplicao.");
    cbCharset.setStyleName("small");

    fldURL = new TextField();
    fldURL.setImmediate(false);
    fldURL.setWidth("458px");
    fldURL.setHeight("-1px");
    fldURL.setCaption("URL");
    fldURL.setRequired(true);
    fldURL.setRequiredError("Informe a URL de conexo com o banco de dados.");

    fldUser = new TextField();
    fldUser.setImmediate(false);
    fldUser.setWidth("157px");
    fldUser.setHeight("-1px");
    fldUser.setCaption("Usurio");
    fldUser.setRequired(true);
    fldUser.setRequiredError("Informe o usurio para conexo com o banco de dados.");

    fldPassword = new PasswordField();
    fldPassword.setImmediate(false);
    fldPassword.setWidth("157px");
    fldPassword.setHeight("-1px");
    fldPassword.setCaption("Senha");

    cbPoolType = new ComboBox();
    cbPoolType.setImmediate(false);
    cbPoolType.setWidth("-1px");
    cbPoolType.setHeight("-1px");
    cbPoolType.addItem(PoolDatasource.POOL_C3P0);
    cbPoolType.addItem(PoolDatasource.POOL_TOMCAT);
    cbPoolType.addItem(PoolDatasource.POOL_JNDI);
    cbPoolType.addItem(PoolDatasource.JDBC_WITHOUT_PO0L);
    cbPoolType.setRequired(true);
    cbPoolType.setCaption("Gerenciador conexes");
    cbPoolType.setRequiredError("Informe o gerenciador de conexes da aplicao.");
    cbPoolType.setStyleName("small");

    fldJNDI = new TextField();
    fldJNDI.setImmediate(false);
    fldJNDI.setWidth("250px");
    fldJNDI.setHeight("-1px");
    fldJNDI.setCaption("Recurso JNDI");
    fldJNDI.setRequired(false);
    fldJNDI.setRequiredError("Informe o nome do recurso JNDI.");

    fldInitPoolSize = new TextField();
    fldInitPoolSize.setImmediate(false);
    fldInitPoolSize.setWidth("157px");
    fldInitPoolSize.setHeight("-1px");
    fldInitPoolSize.setCaption("Tamanho Inicial do Pool");
    fldInitPoolSize.setRequired(true);
    fldInitPoolSize.setRequiredError("Informe o tamanho inicial para o pool de conexes da aplicao.");

    fldMinPoolSize = new TextField();
    fldMinPoolSize.setImmediate(false);
    fldMinPoolSize.setWidth("157px");
    fldMinPoolSize.setHeight("-1px");
    fldMinPoolSize.setCaption("Tamanho mnimo do Pool");
    fldMinPoolSize.setRequired(true);
    fldMinPoolSize.setRequiredError("Informe o tamanho mnimo para o pool de conexes da aplicao.");

    fldMaxPoolSize = new TextField();
    fldMaxPoolSize.setImmediate(false);
    fldMaxPoolSize.setWidth("157px");
    fldMaxPoolSize.setHeight("-1px");
    fldMaxPoolSize.setCaption("Tamanho mximo do Pool");
    fldMaxPoolSize.setRequired(true);
    fldMaxPoolSize.setRequiredError("Informe o tamanho mximo para o pool de conexes da aplicao.");

    fldAcquireIncrement = new TextField();
    fldAcquireIncrement.setImmediate(false);
    fldAcquireIncrement.setWidth("157px");
    fldAcquireIncrement.setHeight("-1px");
    fldAcquireIncrement.setCaption("Incremento do Pool");
    fldAcquireIncrement.setRequired(true);
    fldAcquireIncrement
            .setRequiredError("Informe o tamanho para incremento do pool de conexes da aplicao.");

    fldCatalog = new TextField();
    fldCatalog.setImmediate(false);
    fldCatalog.setWidth("157px");
    fldCatalog.setHeight("-1px");
    fldCatalog.setCaption("Catalog");

    fldSchema = new TextField();
    fldSchema.setImmediate(false);
    fldSchema.setWidth("157px");
    fldSchema.setHeight("-1px");
    fldSchema.setCaption("Schema");

    chActive = new CheckBox();
    chActive.setCaption("Ativa?");
    chActive.setImmediate(false);
    chActive.setWidth("-1px");
    chActive.setHeight("-1px");

    applicationForm.addField("fldId", fldId);
    applicationForm.addField("fldName", fldName);
    applicationForm.addField("fldDescription", fldDescription);
    applicationForm.addField("cbDialect", cbDialect);
    applicationForm.addField("cbPoolType", cbPoolType);
    applicationForm.addField("fldJNDI", fldJNDI);
    applicationForm.addField("fldURL", fldURL);
    applicationForm.addField("fldUser", fldUser);
    applicationForm.addField("fldPassword", fldPassword);
    applicationForm.addField("cbCharset", cbCharset);
    applicationForm.addField("fldInitPoolSize", fldInitPoolSize);
    applicationForm.addField("fldMinPoolSize", fldMinPoolSize);
    applicationForm.addField("fldMaxPoolSize", fldMaxPoolSize);
    applicationForm.addField("fldAcquireIncrement", fldAcquireIncrement);
    applicationForm.addField("fldCatalog", fldCatalog);
    applicationForm.addField("fldSchema", fldSchema);
    applicationForm.addField("chActive", chActive);
}

From source file:br.com.anteros.mobileserver.app.form.ConfigurationForm.java

License:Apache License

private AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);/*from  w  ww.j  a v  a2s  .co  m*/
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    mainLayout.setMargin(false);

    // top-level component properties
    setWidth("100%");
    setHeight("100%");

    // cbDialect
    cbDialect = new ComboBox();
    cbDialect.setImmediate(false);
    cbDialect.setWidth("-1px");
    cbDialect.setHeight("-1px");
    cbDialect.addItem(MobileServerContext.H2);
    cbDialect.addItem(MobileServerContext.ORACLE);
    cbDialect.addItem(MobileServerContext.MYSQL);
    cbDialect.addItem(MobileServerContext.FIREBIRD);
    cbDialect.addItem(MobileServerContext.POSTGRESQL);

    // lblDialect
    lblDialect = new Label();
    lblDialect.setImmediate(false);
    lblDialect.setWidth("-1px");
    lblDialect.setHeight("-1px");
    lblDialect.setValue("Dialeto");

    // cbCharset
    cbCharset = new ComboBox();
    cbCharset.setImmediate(false);
    cbCharset.setWidth("-1px");
    cbCharset.setHeight("-1px");
    cbCharset.addItem(AnterosStandardsCharsets.ISO_8859_1.name());
    cbCharset.addItem(AnterosStandardsCharsets.US_ASCII.name());
    cbCharset.addItem(AnterosStandardsCharsets.UTF_16.name());
    cbCharset.addItem(AnterosStandardsCharsets.UTF_16BE.name());
    cbCharset.addItem(AnterosStandardsCharsets.UTF_16LE.name());
    cbCharset.addItem(AnterosStandardsCharsets.UTF_8.name());

    // lblCharset
    lblCharset = new Label();
    lblCharset.setImmediate(false);
    lblCharset.setWidth("-1px");
    lblCharset.setHeight("-1px");
    lblCharset.setValue("Charset");

    // fldURL
    fldURL = new TextField();
    fldURL.setImmediate(false);
    fldURL.setWidth("458px");
    fldURL.setHeight("-1px");

    // lblURL
    lblURL = new Label();
    lblURL.setImmediate(false);
    lblURL.setWidth("-1px");
    lblURL.setHeight("-1px");
    lblURL.setValue("Url conexo");

    // fldUser
    fldUser = new TextField();
    fldUser.setImmediate(false);
    fldUser.setWidth("157px");
    fldUser.setHeight("-1px");

    // lblUser
    lblUser = new Label();
    lblUser.setImmediate(false);
    lblUser.setWidth("-1px");
    lblUser.setHeight("-1px");
    lblUser.setValue("Usurio");

    // fldPassword
    fldPassword = new PasswordField();
    fldPassword.setImmediate(false);
    fldPassword.setWidth("157px");
    fldPassword.setHeight("-1px");

    // lblPassword
    lblPassword = new Label();
    lblPassword.setImmediate(false);
    lblPassword.setWidth("-1px");
    lblPassword.setHeight("-1px");
    lblPassword.setValue("Senha");

    // fldCatalog
    fldCatalog = new TextField();
    fldCatalog.setImmediate(false);
    fldCatalog.setWidth("157px");
    fldCatalog.setHeight("-1px");

    // lblCatalog
    lblCatalog = new Label();
    lblCatalog.setImmediate(false);
    lblCatalog.setWidth("-1px");
    lblCatalog.setHeight("-1px");
    lblCatalog.setValue("Catalog");

    // fldSchema
    fldSchema = new TextField();
    fldSchema.setImmediate(false);
    fldSchema.setWidth("157px");
    fldSchema.setHeight("-1px");

    // lblSchema
    lblSchema = new Label();
    lblSchema.setImmediate(false);
    lblSchema.setWidth("-1px");
    lblSchema.setHeight("-1px");
    lblSchema.setValue("Schema");

    // imgAnteros
    imgAnteros = new Embedded();
    imgAnteros.setImmediate(false);
    imgAnteros.setWidth("165px");
    imgAnteros.setHeight("45px");
    imgAnteros.setSource(new ThemeResource("images/anteros_mobile_server45.png"));
    imgAnteros.setType(1);
    imgAnteros.setMimeType("image/png");

    // fldInitPoolSize
    fldInitPoolSize = new TextField();
    fldInitPoolSize.setImmediate(false);
    fldInitPoolSize.setWidth("157px");
    fldInitPoolSize.setHeight("-1px");

    // lblPool
    lblPool = new Label();
    lblPool.setImmediate(false);
    lblPool.setWidth("-1px");
    lblPool.setHeight("-1px");
    lblPool.setValue("<b>Pool de conexes</b>");
    lblPool.setContentMode(3);

    // label_2
    label_2 = new Label();
    label_2.setImmediate(false);
    label_2.setWidth("-1px");
    label_2.setHeight("-1px");
    label_2.setValue("<b>Pool de conexes</b>");
    label_2.setContentMode(3);

    // lblInitialPoolSize
    lblInitialPoolSize = new Label();
    lblInitialPoolSize.setImmediate(false);
    lblInitialPoolSize.setWidth("-1px");
    lblInitialPoolSize.setHeight("-1px");
    lblInitialPoolSize.setValue("Tamanho inicial");

    // fldMinPoolSize
    fldMinPoolSize = new TextField();
    fldMinPoolSize.setImmediate(false);
    fldMinPoolSize.setWidth("157px");
    fldMinPoolSize.setHeight("-1px");

    // lblMinPoolSize
    lblMinPoolSize = new Label();
    lblMinPoolSize.setImmediate(false);
    lblMinPoolSize.setWidth("-1px");
    lblMinPoolSize.setHeight("-1px");
    lblMinPoolSize.setValue("Tamanho Mnimo");

    // lblMaxPoolSize
    lblMaxPoolSize = new Label();
    lblMaxPoolSize.setImmediate(false);
    lblMaxPoolSize.setWidth("-1px");
    lblMaxPoolSize.setHeight("-1px");
    lblMaxPoolSize.setValue("Tamanho Mximo");

    // fldMaxPoolSize
    fldMaxPoolSize = new TextField();
    fldMaxPoolSize.setImmediate(false);
    fldMaxPoolSize.setWidth("157px");
    fldMaxPoolSize.setHeight("-1px");

    // fldAcquireIncrement
    fldAcquireIncrement = new TextField();
    fldAcquireIncrement.setImmediate(false);
    fldAcquireIncrement.setWidth("157px");
    fldAcquireIncrement.setHeight("-1px");

    // lblAcquireIncrement
    lblAcquireIncrement = new Label();
    lblAcquireIncrement.setImmediate(false);
    lblAcquireIncrement.setWidth("-1px");
    lblAcquireIncrement.setHeight("-1px");
    lblAcquireIncrement.setValue("Incremento");

    // chShowSql
    chShowSql = new CheckBox();
    chShowSql.setCaption("Mostrar SQL's no log");
    chShowSql.setImmediate(false);
    chShowSql.setWidth("-1px");
    chShowSql.setHeight("-1px");

    // chFormatSql
    chFormatSql = new CheckBox();
    chFormatSql.setCaption("Formatar SQL's ");
    chFormatSql.setImmediate(false);
    chFormatSql.setWidth("-1px");
    chFormatSql.setHeight("-1px");

    // btnOk
    btnOk = new Button();
    btnOk.setCaption("Ok");
    btnOk.setIcon(new ThemeResource("icons/16/ok.png"));
    btnOk.setImmediate(true);
    btnOk.setWidth("-1px");
    btnOk.setHeight("-1px");

    // btnCancel
    btnCancel = new Button();
    btnCancel.setCaption("Cancela");
    btnCancel.setIcon(new ThemeResource("icons/16/cancel.png"));
    btnCancel.setImmediate(true);
    btnCancel.setWidth("-1px");
    btnCancel.setHeight("-1px");

    // imgConfiguration
    imgConfiguration = new Embedded();
    imgConfiguration.setImmediate(false);
    imgConfiguration.setWidth("48px");
    imgConfiguration.setHeight("48px");
    imgConfiguration.setSource(new ThemeResource("images/configuration.png"));
    imgConfiguration.setType(1);
    imgConfiguration.setMimeType("image/png");

    // lblAccessControl
    lblAccessControl = new Label();
    lblAccessControl.setImmediate(false);
    lblAccessControl.setWidth("-1px");
    lblAccessControl.setHeight("-1px");
    lblAccessControl.setValue("<b>Controle de acesso</b>");
    lblAccessControl.setContentMode(3);

    // lblAccessUser
    lblAccessUser = new Label();
    lblAccessUser.setImmediate(false);
    lblAccessUser.setWidth("-1px");
    lblAccessUser.setHeight("-1px");
    lblAccessUser.setValue("Usurio");

    // fldAccessUser
    fldAccessUser = new TextField();
    fldAccessUser.setImmediate(false);
    fldAccessUser.setWidth("157px");
    fldAccessUser.setHeight("-1px");

    // lblAccessPassword
    lblAccessPassword = new Label();
    lblAccessPassword.setImmediate(false);
    lblAccessPassword.setWidth("-1px");
    lblAccessPassword.setHeight("-1px");
    lblAccessPassword.setValue("Senha");

    // fldAccessPassword
    fldAccessPassword = new PasswordField();
    fldAccessPassword.setImmediate(false);
    fldAccessPassword.setWidth("157px");
    fldAccessPassword.setHeight("-1px");

    // cbTipoPool
    cbTipoPool = new ComboBox();
    cbTipoPool.setImmediate(false);
    cbTipoPool.setWidth("100.0%");
    cbTipoPool.setHeight("-1px");
    cbTipoPool.addItem(PoolDatasource.POOL_C3P0);
    cbTipoPool.addItem(PoolDatasource.POOL_TOMCAT);
    cbTipoPool.addItem(PoolDatasource.POOL_JNDI);
    cbTipoPool.addItem(PoolDatasource.JDBC_WITHOUT_PO0L);

    // lblTipoPool
    lblTipoPool = new Label();
    lblTipoPool.setImmediate(false);
    lblTipoPool.setWidth("103px");
    lblTipoPool.setHeight("-1px");
    lblTipoPool.setValue("Gerenciador pool");

    // fldJNDI
    fldJNDI = new TextField();
    fldJNDI.setImmediate(false);
    fldJNDI.setWidth("300px");
    fldJNDI.setHeight("-1");

    // lblJNDI
    lblJNDI = new Label();
    lblJNDI.setImmediate(false);
    lblJNDI.setWidth("-1px");
    lblJNDI.setHeight("-1px");
    lblJNDI.setValue("Recurso JNDI");

    // lblQueryTimeout
    lblQueryTimeout = new Label();
    lblQueryTimeout.setImmediate(false);
    lblQueryTimeout.setWidth("-1px");
    lblQueryTimeout.setHeight("-1px");
    lblQueryTimeout.setValue("Timeout query");

    // fldMaxPoolSize
    fldQueryTimeout = new TextField();
    fldQueryTimeout.setImmediate(false);
    fldQueryTimeout.setWidth("100px");
    fldQueryTimeout.setHeight("-1px");

    // lblQueryTimeoutSeconds
    lblQueryTimeoutSeconds = new Label();
    lblQueryTimeoutSeconds.setImmediate(false);
    lblQueryTimeoutSeconds.setWidth("-1px");
    lblQueryTimeoutSeconds.setHeight("-1px");
    lblQueryTimeoutSeconds.setValue("segundos");

    mainLayout.addComponent(cbDialect, "top:20.0px;left:269.0px;");
    mainLayout.addComponent(lblDialect, "top:17.0px;left:223.0px;");
    mainLayout.addComponent(cbCharset, "top:20.0px;left:569.0px;");
    mainLayout.addComponent(lblCharset, "top:17.0px;left:519.0px;");
    mainLayout.addComponent(fldURL, "top:44.0px;left:269.0px;");
    mainLayout.addComponent(lblURL, "top:41.0px;left:195.0px;");
    mainLayout.addComponent(fldUser, "top:69.0px;left:269.0px;");
    mainLayout.addComponent(lblUser, "top:69.0px;left:218.0px;");
    mainLayout.addComponent(fldPassword, "top:69.0px;left:571.0px;");
    mainLayout.addComponent(lblPassword, "top:69.0px;left:529.0px;");
    mainLayout.addComponent(fldCatalog, "top:94.0px;left:269.0px;");
    mainLayout.addComponent(lblCatalog, "top:94.0px;left:216.0px;");
    mainLayout.addComponent(fldSchema, "top:94.0px;left:571.0px;");
    mainLayout.addComponent(lblSchema, "top:93.0px;left:519.0px;");
    mainLayout.addComponent(imgAnteros, "top:5.0px;left:5.0px;");
    mainLayout.addComponent(cbTipoPool, "top:159.0px;right:230.0px;left:269.0px;");
    mainLayout.addComponent(lblTipoPool, "top:156.0px;left:165.0px;");
    mainLayout.addComponent(lblJNDI, "top:197.0px;left:184.0px;");
    mainLayout.addComponent(fldJNDI, "top:197.0px;left:269.0px;");
    mainLayout.addComponent(fldInitPoolSize, "top:221.0px;left:269.0px;");
    mainLayout.addComponent(lblPool, "top:130.0px;left:269.0px;");
    mainLayout.addComponent(label_2, "top:130.0px;left:269.0px;");
    mainLayout.addComponent(lblInitialPoolSize, "top:221.0px;left:172.0px;");
    mainLayout.addComponent(fldMinPoolSize, "top:246.0px;left:269.0px;");
    mainLayout.addComponent(lblMinPoolSize, "top:247.0px;left:164.0px;");
    mainLayout.addComponent(lblMaxPoolSize, "top:273.0px;left:162.0px;");
    mainLayout.addComponent(fldMaxPoolSize, "top:272.0px;left:269.0px;");
    mainLayout.addComponent(fldAcquireIncrement, "top:297.0px;left:269.0px;");
    mainLayout.addComponent(lblAcquireIncrement, "top:298.0px;left:200.0px;");
    mainLayout.addComponent(chShowSql, "top:234.0px;left:571.0px;");
    mainLayout.addComponent(chFormatSql, "top:250.0px;left:571.0px;");
    mainLayout.addComponent(lblQueryTimeout, "top:297.0px;left:480.0px;");
    mainLayout.addComponent(fldQueryTimeout, "top:298.0px;left:571.0px;");
    mainLayout.addComponent(lblQueryTimeoutSeconds, "top:297.0px;left:675.0px;");
    mainLayout.addComponent(imgConfiguration, "top:153.0px;left:30.0px;");
    mainLayout.addComponent(lblAccessControl, "top:328.0px;left:180.0px;");
    mainLayout.addComponent(lblAccessUser, "top:350.0px;left:220.0px;");
    mainLayout.addComponent(fldAccessUser, "top:350.0px;left:269.0px;");
    mainLayout.addComponent(lblAccessPassword, "top:349.0px;left:529.0px;");
    mainLayout.addComponent(fldAccessPassword, "top:348.0px;left:571.0px;");
    mainLayout.addComponent(btnOk, "top:394.0px;left:580.0px;");
    mainLayout.addComponent(btnCancel, "top:394.0px;left:648.0px;");

    return mainLayout;
}

From source file:br.com.anteros.mobileserver.app.form.ExecuteForm.java

License:Apache License

private void createForm() {
    if (actionSynchronism.getItems() != null) {

        Label lblTitle = new Label("Parmetros de execuo Ao " + actionSynchronism.getName() + " ("
                + actionSynchronism.getId() + ")");
        lblTitle.setStyleName("h2 color");
        lblTitle.setImmediate(false);/*w w  w  .j a v a2s  . c  o m*/
        addComponent(lblTitle);
        setComponentAlignment(lblTitle, Alignment.TOP_LEFT);

        Synchronism synchronism = actionSynchronism.getItems().iterator().next();
        executeForm = new Form();
        fields.clear();
        ParameterSynchronism[] parameters = null;
        if (synchronism instanceof TableSynchronism)
            parameters = ((TableSynchronism) synchronism).getParameters();
        if (synchronism instanceof ProcedureSynchronism)
            parameters = ((ProcedureSynchronism) synchronism).getParameters();
        for (ParameterSynchronism param : parameters) {
            if (param.getParameterType().intValue() == ParameterSynchronism.INPUT
                    || param.getParameterType().intValue() == ParameterSynchronism.SUBSTITUITION) {
                String value = FieldTypes.getFieldTypes().get(param.getParameterDataType().intValue() + "");
                if (value != null) {
                    if (FieldTypes.UNKNOW.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("400px");
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.INTEGER.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.VARCHAR.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("400px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.FLOAT.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.NUMERIC.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.DATE.equalsIgnoreCase(value)) {
                        PopupDateField field = new PopupDateField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        field.setResolution(PopupDateField.RESOLUTION_DAY);
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.TIME.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    } else if (FieldTypes.TIMESTAMP.equalsIgnoreCase(value)) {
                        TextField field = new TextField();
                        field.setCaption(param.getName());
                        field.setWidth("150px");
                        field.setRequired(true);
                        field.setRequiredError("Informe o valor para o campo " + param.getName());
                        executeForm.addField(param.getName(), field);
                        fields.add(field);
                    }
                }
            }
        }

        panelForm = new Panel();
        panelForm.setHeight("100%");
        panelForm.setWidth("100%");
        panelForm.setScrollable(true);
        addComponent(panelForm);
        executeForm.setImmediate(true);
        executeForm.setWidth("100%");
        panelForm.addComponent(executeForm);

        executeCommit = new CheckBox("Executar COMMIT no final do processo?");
        addComponent(executeCommit);

        HorizontalLayout buttons = new HorizontalLayout();
        buttons.setImmediate(false);
        buttons.setWidth("600px");
        buttons.setHeight("-1px");
        buttons.setMargin(false);
        buttons.setSpacing(true);
        addComponent(buttons);

        btnExecute = new Button();
        btnExecute.setCaption("Executar");
        btnExecute.setIcon(new ThemeResource("icons/16/run.png"));
        btnExecute.addListener(clickListener);
        buttons.addComponent(btnExecute);
        buttons.setComponentAlignment(btnExecute, Alignment.MIDDLE_RIGHT);
        buttons.setExpandRatio(btnExecute, 1);

        btnClose = new Button();
        btnClose.setCaption("Fechar");
        btnClose.setIcon(new ThemeResource("icons/16/doorOut.png"));
        btnClose.addListener(clickListener);
        buttons.addComponent(btnClose);

        buttons.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);
        buttons.setMargin(true, false, true, false);
        addComponent(buttons);

        pageControl = new TabSheet();
        pageControl.setImmediate(true);
        pageControl.setWidth("100.0%");
        pageControl.setHeight("100.0%");

        textPanel = new Panel();
        textPanel.setImmediate(true);
        textPanel.setWidth("100%");
        textPanel.setHeight("100%");
        pageControl.addTab(textPanel, "Resultado", null);
        addComponent(pageControl);
        setExpandRatio(pageControl, 1.0f);
    }
}

From source file:br.com.anteros.mobileserver.app.form.FieldForm.java

License:Apache License

private void createFields() {
    fldId = new TextField();
    fldId.setCaption("Id");
    fldId.setWidth("100px");
    fldId.setStyleName("small");

    fldName = new TextField();
    fldName.setCaption("Nome do campo");
    fldName.setWidth("200px");
    fldName.setRequired(true);//from   ww w .j av a  2s  . c  om
    fldName.setRequiredError("Informe o nome da campo.");
    fldName.setStyleName("small");

    fldDescription = new TextField();
    fldDescription.setCaption("Descrio do campo");
    fldDescription.setWidth("500px");
    fldDescription.setRequired(true);
    fldDescription.setRequiredError("Informe a descrio do campo.");
    fldDescription.setStyleName("small");

    fldSQLFieldName = new TextField();
    fldSQLFieldName.setCaption("Nome do campo SQL");
    fldSQLFieldName.setWidth("200px");
    fldSQLFieldName.setRequired(true);
    fldSQLFieldName.setRequiredError("Informe o nome do campo SQL.");
    fldSQLFieldName.setStyleName("small");

    fldFieldType = new ComboBox();
    fldFieldType.setCaption("Tipo de Campo");
    fldFieldType.setWidth("200px");
    fldFieldType.setRequired(true);
    fldFieldType.setRequiredError("Informe o tipo do campo.");
    fldFieldType.setStyleName("small");

    Iterator<String> it = FieldTypes.getFieldTypes().keySet().iterator();
    while (it.hasNext()) {
        String key = it.next();
        String value = (String) FieldTypes.getFieldTypes().get(key);
        fldFieldType.addItem(value);
    }

    fieldForm.addField("fldId", fldId);
    fieldForm.addField("fldName", fldName);
    fieldForm.addField("fldDescription", fldDescription);
    fieldForm.addField("fldSQLFieldName", fldSQLFieldName);
    fieldForm.addField("fldFieldType", fldFieldType);
}

From source file:br.com.anteros.mobileserver.app.form.ParameterForm.java

License:Apache License

private void createFields() {
    fldId = new TextField();
    fldId.setCaption("Id");
    fldId.setWidth("100px");
    fldId.setStyleName("small");

    fldName = new TextField();
    fldName.setCaption("Nome do parmetro");
    fldName.setWidth("200px");
    fldName.setRequired(true);/*from w ww  .  ja va 2  s  .  com*/
    fldName.setRequiredError("Informe o nome da aplicao.");
    fldName.setStyleName("small");

    fldDescription = new TextField();
    fldDescription.setCaption("Descrio do parmetro");
    fldDescription.setWidth("500px");
    fldDescription.setRequired(true);
    fldDescription.setRequiredError("Informe a descrio do parmetro.");
    fldDescription.setStyleName("small");

    fldParameterDataType = new ComboBox();
    fldParameterDataType.setCaption("Tipo de dado do parmetro");
    fldParameterDataType.setWidth("200px");
    fldParameterDataType.setRequired(true);
    fldParameterDataType.setRequiredError("Informe o tipo de dado do parmetro.");
    fldParameterDataType.setStyleName("small");
    Iterator<String> it = FieldTypes.getFieldTypes().keySet().iterator();
    while (it.hasNext()) {
        String key = it.next();
        String value = (String) FieldTypes.getFieldTypes().get(key);
        fldParameterDataType.addItem(value);
    }

    fldParameterType = new ComboBox();
    fldParameterType.setCaption("Tipo do parmetro");
    fldParameterType.setWidth("200px");
    fldParameterType.setRequired(true);
    fldParameterType.setRequiredError("Informe o tipo do parmetro.");
    fldParameterType.addItem("INPUT");
    fldParameterType.addItem("OUTPUT");
    if (objectOwner instanceof TableSynchronism)
        fldParameterType.addItem("SUBSTITUITION");
    fldParameterType.setStyleName("small");

    parameterForm.addField("fldId", fldId);
    parameterForm.addField("fldName", fldName);
    parameterForm.addField("fldDescription", fldDescription);
    parameterForm.addField("fldParameterDataType", fldParameterDataType);
    parameterForm.addField("fldParameterType", fldParameterType);
}

From source file:br.com.anteros.mobileserver.app.form.ProcedureForm.java

License:Apache License

private void createFields() {
    fldId = new TextField();
    fldId.setCaption("Id");
    fldId.setWidth("100px");
    fldId.setStyleName("small");

    fldName = new ComboBox();
    fldName.setCaption("Nome do procedimento");
    fldName.setWidth("400px");
    fldName.setRequired(true);// w w w. j  ava  2 s  .c o m
    fldName.setRequiredError("Informe o nome do procedimento.");
    fldName.setContainerDataSource(MobileServerData.loadAllProcedures(app));
    fldName.setItemCaptionPropertyId(MobileServerData.PROPERTY_NAME);
    fldName.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
    fldName.setItemIconPropertyId(MobileServerData.PROPERTY_ICON);
    fldName.setImmediate(true);
    fldName.addListener(this);
    fldName.setStyleName("small");

    fldDescription = new TextField();
    fldDescription.setCaption("Descrio do procedimento");
    fldDescription.setWidth("500px");
    fldDescription.setRequired(true);
    fldDescription.setRequiredError("Informe a descrio do procedimento.");
    fldDescription.setStyleName("small");

    fldParameterOut = new ComboBox();
    fldParameterOut.setCaption("Nome do parmetro retorno");
    fldParameterOut.setWidth("250px");
    fldParameterOut.setImmediate(true);
    fldParameterOut.setStyleName("small");
    fldParameterOut.setRequired(true);
    fldParameterOut.setRequiredError("Informe o nome do parmetro de retorno.");

    procedureForm.addField("fldId", fldId);
    procedureForm.addField("fldName", fldName);
    procedureForm.addField("fldDescription", fldDescription);
    procedureForm.addField("fldParameterOut", fldParameterOut);
}

From source file:br.com.anteros.mobileserver.app.form.TableForm.java

License:Apache License

private void createFields() {
    fldId = new TextField();
    fldId.setCaption("Id");
    fldId.setWidth("100px");
    fldId.setStyleName("small");

    fldName = new TextField();
    fldName.setCaption("Nome da tabela");
    fldName.setWidth("200px");
    fldName.setRequired(true);/*from   ww w  .  j a v a 2s  .c  o  m*/
    fldName.setRequiredError("Informe o nome da tabela.");
    fldName.setStyleName("small");

    fldDescription = new TextField();
    fldDescription.setCaption("Descrio da tabela");
    fldDescription.setWidth("500px");
    fldDescription.setRequired(true);
    fldDescription.setRequiredError("Informe a descrio da tabela.");
    fldDescription.setStyleName("small");

    fldTableNameMobile = new TextField();
    fldTableNameMobile.setCaption("Tabela na aplicao mvel");
    fldTableNameMobile.setWidth("100px");
    fldTableNameMobile.setStyleName("small");
    fldTableNameMobile.setRequired(true);
    fldTableNameMobile.setRequiredError("Informe o nome da tabela na aplicao mvel.");

    fldTableSQL = new TextArea();
    fldTableSQL.setCaption("SQL");
    fldTableSQL.setWidth("100%");
    fldTableSQL.setHeight("150px");
    fldTableSQL.setStyleName("small");
    fldTableSQL.setRequired(true);
    fldTableSQL.setRequiredError("Informe o SQL para seleo dos dados.");

    tableForm.addField("fldId", fldId);
    tableForm.addField("fldName", fldName);
    tableForm.addField("fldDescription", fldDescription);
    tableForm.addField("fldTableNameMobile", fldTableNameMobile);
    tableForm.addField("fldTableSQL", fldTableSQL);
}

From source file:br.com.anteros.mobileserver.app.form.UserLoginForm.java

License:Apache License

private AbsoluteLayout buildAbsoluteLayout() {
    absoluteLayout = new AbsoluteLayout();
    absoluteLayout.setImmediate(false);// w ww . j  a v  a 2s .  c o  m
    absoluteLayout.setWidth("100.0%");
    absoluteLayout.setHeight("100.0%");
    absoluteLayout.setMargin(false);

    lblPassword = new Label();
    lblPassword.setImmediate(false);
    lblPassword.setWidth("-1px");
    lblPassword.setHeight("-1px");
    lblPassword.setValue("Usurio");
    absoluteLayout.addComponent(lblPassword, "top:20.0px;left:16.0px;");

    lblUserName = new Label();
    lblUserName.setImmediate(false);
    lblUserName.setWidth("-1px");
    lblUserName.setHeight("-1px");
    lblUserName.setValue("Senha");
    absoluteLayout.addComponent(lblUserName, "top:54.0px;left:24.0px;");

    fldUserName = new TextField();
    fldUserName.setImmediate(false);
    fldUserName.setWidth("217px");
    fldUserName.setHeight("-1px");
    fldUserName.setSecret(false);
    absoluteLayout.addComponent(fldUserName, "top:20.0px;left:83.0px;");

    fldPassword = new PasswordField();
    fldPassword.setImmediate(false);
    fldPassword.setWidth("217px");
    fldPassword.setHeight("-1px");
    absoluteLayout.addComponent(fldPassword, "top:54.0px;left:83.0px;");

    btnLogin = new Button();
    btnLogin.setCaption("Login");
    btnLogin.setImmediate(true);
    btnLogin.setWidth("100px");
    btnLogin.setHeight("-1px");
    absoluteLayout.addComponent(btnLogin, "top:100.0px;left:200.0px;");

    return absoluteLayout;
}

From source file:br.gov.frameworkdemoiselle.vaadin.util.FieldFactory.java

License:Open Source License

/**
 * Produces basic textfields./* w  w w. j ava2  s. c  o  m*/
 *
 * @param inputPrompt
 *            Prompt message.
 * @param caption
 *            Label.
 * @return Produced field.
 */
public static TextField createTextField(String inputPrompt, String caption) {
    ResourceBundle bundle = Beans.getReference(ResourceBundle.class);

    TextField field = new TextField();
    field.setNullRepresentation("");
    setBasicProperties(field, caption);

    if (Strings.isResourceBundleKeyFormat(inputPrompt)) {
        field.setInputPrompt(bundle.getString(Strings.removeBraces(inputPrompt)));
    } else {
        field.setInputPrompt(inputPrompt);
    }

    return field;
}

From source file:ch.bfh.ti.soed.hs16.srs.kandr3.view.MyUI.java

License:Open Source License

@Override
protected void init(VaadinRequest vaadinRequest) {
    final VerticalLayout layout = new VerticalLayout();

    final TextField name = new TextField();
    name.setCaption("Type your name here:");

    Button button = new Button("Click Me");
    button.addClickListener(e -> {//from w  w w  .  j av  a2 s .  c o m
        layout.addComponent(new Label("Thanks " + name.getValue() + ", it works!"));
    });

    layout.addComponents(name, button);
    layout.setMargin(true);
    layout.setSpacing(true);

    setContent(layout);
}