Example usage for com.vaadin.ui CheckBox CheckBox

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

Introduction

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

Prototype

public CheckBox() 

Source Link

Document

Creates a new checkbox.

Usage

From source file:ac.uk.icl.dell.vaadin.glycanbuilder.MassOptionsDialog.java

License:Open Source License

@Override
public void initComponents() {
    isotopeSelect = new Select();
    isotopeSelect.addStyleName("igg-mass-options-panel-item");
    isotopeSelect.setNullSelectionAllowed(false);
    isotopeSelect.setNewItemsAllowed(false);
    isotopeSelect.setWidth("120px");

    derivatizationSelect = new Select();
    derivatizationSelect.addStyleName("igg-mass-options-panel-item");
    derivatizationSelect.setNullSelectionAllowed(false);
    derivatizationSelect.setNewItemsAllowed(false);
    derivatizationSelect.setWidth("120px");

    reducingEndSelect = new Select();
    reducingEndSelect.addStyleName("igg-mass-options-panel-item");
    reducingEndSelect.setNullSelectionAllowed(false);
    reducingEndSelect.setImmediate(true);
    reducingEndSelect.setNewItemsAllowed(false);
    reducingEndSelect.setWidth("120px");

    reducingEndSelect.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1067195208212460144L;

        @Override/*from w  ww . ja  v  a 2 s  .  co  m*/
        public void valueChange(ValueChangeEvent event) {
            if (((String) reducingEndSelect.getValue()).equals("Other...")) {
                otherNameField.setEnabled(true);
                otherMassField.setEnabled(true);
            } else {
                otherNameField.setEnabled(false);
                otherMassField.setEnabled(false);
            }
        }
    });

    otherNameField = new TextField();
    otherNameField.addStyleName("igg-mass-options-panel-item");
    otherNameField.setWidth("120px");

    otherMassField = new TextField();
    otherMassField.addStyleName("igg-mass-options-panel-item");
    otherMassField.setWidth("120px");

    negativeModeField = new CheckBox();
    negativeModeField.addStyleName("igg-mass-options-panel-item");

    hIonCountSelect = new Select("#H ions");
    hIonCountSelect.addStyleName("igg-mass-options-panel-item");
    hIonCountSelect.setNewItemsAllowed(false);
    hIonCountSelect.setWidth("120px");

    naIonCountSelect = new Select("#Na ions");
    naIonCountSelect.addStyleName("igg-mass-options-panel-item");
    naIonCountSelect.setNewItemsAllowed(false);
    naIonCountSelect.setWidth("120px");

    exNAIonCountSelect = new Select("ext. #Na ions");
    exNAIonCountSelect.addStyleName("igg-mass-options-panel-item");
    exNAIonCountSelect.setNewItemsAllowed(false);
    exNAIonCountSelect.setWidth("120px");

    liIonCountSelect = new Select("#Li ions");
    liIonCountSelect.addStyleName("igg-mass-options-panel-item");
    liIonCountSelect.setNewItemsAllowed(false);
    liIonCountSelect.setWidth("120px");

    exLIIonCountSelect = new Select("ext. #Li ions");
    exLIIonCountSelect.addStyleName("igg-mass-options-panel-item");
    exLIIonCountSelect.setNewItemsAllowed(false);
    exLIIonCountSelect.setWidth("120px");

    kIonCountSelect = new Select("#K ions");
    kIonCountSelect.addStyleName("igg-mass-options-panel-item");
    kIonCountSelect.setNewItemsAllowed(false);
    kIonCountSelect.setWidth("120px");

    exKIonCountSelect = new Select("ext. #K ions");
    exKIonCountSelect.addStyleName("igg-mass-options-panel-item");
    exKIonCountSelect.setNewItemsAllowed(false);
    exKIonCountSelect.setWidth("120px");

    clIonCountSelect = new Select("#Cl ions");
    clIonCountSelect.addStyleName("igg-mass-options-panel-item");
    clIonCountSelect.setNewItemsAllowed(false);
    clIonCountSelect.setWidth("120px");

    exClIonCountSelect = new Select("ext. #Cl ions");
    exClIonCountSelect.addStyleName("igg-mass-options-panel-item");
    exClIonCountSelect.setNewItemsAllowed(false);
    exClIonCountSelect.setWidth("120px");

    h2po4IonCountSelect = new Select("#H2PO4 ions");
    h2po4IonCountSelect.addStyleName("igg-mass-options-panel-item");
    h2po4IonCountSelect.setNewItemsAllowed(false);
    h2po4IonCountSelect.setWidth("120px");

    exH2po4IonCountSelect = new Select("ext. #H2PO4 ions");
    exH2po4IonCountSelect.addStyleName("igg-mass-options-panel-item");
    exH2po4IonCountSelect.setNewItemsAllowed(false);
    exH2po4IonCountSelect.setWidth("120px");

    //column,row
    layout.addComponent(new Label("Isotope"), 0, 0, 0, 0);
    layout.addComponent(isotopeSelect, 1, 0, 1, 0);
    layout.addComponent(new Label("Derivatization"), 0, 1, 0, 1);
    layout.addComponent(derivatizationSelect, 1, 1, 1, 1);
    layout.addComponent(new Label("Reducing end"), 0, 2, 0, 2);
    layout.addComponent(reducingEndSelect, 1, 2, 1, 2);

    {
        Label nameLabel = new Label("name");
        nameLabel.setWidth("40px");
        layout.addComponent(nameLabel, 1, 3, 1, 3);
        layout.addComponent(otherNameField, 2, 3, 2, 3);

        layout.setComponentAlignment(nameLabel, Alignment.MIDDLE_RIGHT);
    }

    {
        Label massLabel = new Label("mass");
        massLabel.setWidth("40px");
        layout.addComponent(massLabel, 1, 4, 1, 4);
        layout.addComponent(otherMassField, 2, 4, 2, 4);
        layout.setComponentAlignment(massLabel, Alignment.MIDDLE_RIGHT);
    }

    int row = 5;

    {
        Label divider = new Label("<hr/>", Label.CONTENT_XHTML);

        layout.addComponent(divider, 0, row, 2, row++);
    }

    layout.addComponent(new Label("Negative mode"), 0, row, 0, row);
    layout.addComponent(negativeModeField, 1, row, 1, row++);

    layout.addComponent(hIonCountSelect, 0, row, 0, row++);

    layout.addComponent(naIonCountSelect, 0, row, 0, row);

    layout.addComponent(exNAIonCountSelect, 1, row, 1, row++);

    layout.addComponent(liIonCountSelect, 0, row, 0, row);

    layout.addComponent(exLIIonCountSelect, 1, row, 1, row++);

    layout.addComponent(kIonCountSelect, 0, row, 0, row);

    layout.addComponent(exKIonCountSelect, 1, row, 1, row++);

    {
        Label divider = new Label("<hr/>", Label.CONTENT_XHTML);

        layout.addComponent(divider, 0, row, 2, row++);
    }

    layout.addComponent(clIonCountSelect, 0, row, 0, row);

    layout.addComponent(exClIonCountSelect, 1, row, 1, row++);

    layout.addComponent(h2po4IonCountSelect, 0, row, 0, row);

    layout.addComponent(exH2po4IonCountSelect, 1, row, 1, row++);

    NativeButton update = new NativeButton("Apply mass options");
    update.addListener(new ClickListener() {
        private static final long serialVersionUID = -6188200798103156691L;

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                config.retrieveData();
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            fireMassOptionsChanged(config.getMassOptions(), glycans);
        }
    });

    layout.addComponent(update, 0, row, 0, row);
}

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   www  .  ja  va 2s .  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  w  w  .  jav a  2s  .  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.gov.frameworkdemoiselle.vaadin.util.FieldFactory.java

License:Open Source License

/**
 * Produces a CheckBox./*from   w  ww.  j a  v  a 2 s .c om*/
 *
 * @param inputPrompt
 *            Field's prompt.
 * @param caption
 *            Field's caption.
 * @return Produced field.
 */
public static CheckBox createCheckBox(String inputPrompt, String caption) {
    CheckBox field = new CheckBox();
    setBasicProperties(field, caption);
    return field;
}

From source file:com.esofthead.mycollab.mobile.module.crm.view.CrmLoginViewImpl.java

License:Open Source License

private void initUI() {
    this.setStyleName("login-view");
    this.setSizeFull();

    VerticalLayout contentLayout = new VerticalLayout();
    contentLayout.setStyleName("content-wrapper");
    contentLayout.setDefaultComponentAlignment(Alignment.TOP_CENTER);
    contentLayout.setMargin(true);//from   w ww.  j  av a2 s.  c o m
    contentLayout.setSpacing(true);
    contentLayout.setWidth("320px");

    Image mainLogo = new Image(null, new ThemeResource("icons/logo_m.png"));
    contentLayout.addComponent(mainLogo);

    Label introText = new Label(
            "MyCollab helps you do all your office jobs on the computers, phones and tablets you use");
    introText.setStyleName("intro-text");
    contentLayout.addComponent(introText);

    CssLayout welcomeTextWrapper = new CssLayout();
    welcomeTextWrapper.setStyleName("welcometext-wrapper");
    welcomeTextWrapper.setWidth("100%");
    Label welcomeText = new Label("Login to CRM");
    welcomeText.setWidth("150px");
    welcomeTextWrapper.addComponent(welcomeText);
    contentLayout.addComponent(welcomeTextWrapper);

    final EmailField emailField = new EmailField();
    emailField.setWidth("100%");
    emailField.setInputPrompt("E-mail Address");
    emailField.setStyleName("email-input");
    contentLayout.addComponent(emailField);

    final PasswordField pwdField = new PasswordField();
    pwdField.setWidth("100%");
    pwdField.setInputPrompt("Password");
    pwdField.setStyleName("password-input");
    contentLayout.addComponent(pwdField);

    final CheckBox rememberPassword = new CheckBox();
    rememberPassword.setWidth("100%");
    rememberPassword.setCaption("Remember password");
    rememberPassword.setValue(true);
    contentLayout.addComponent(rememberPassword);

    Button signInBtn = new Button("Sign In");
    signInBtn.setWidth("100%");
    signInBtn.addStyleName(UIConstants.BUTTON_BIG);
    signInBtn.addStyleName(UIConstants.COLOR_BLUE);
    signInBtn.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new CrmEvent.PlainLogin(this, new String[] {
                    emailField.getValue(), pwdField.getValue(), String.valueOf(rememberPassword.getValue()) }));
        }
    });
    contentLayout.addComponent(signInBtn);

    Button createAccountBtn = new Button("Create Account");
    createAccountBtn.setWidth("100%");
    createAccountBtn.addStyleName(UIConstants.BUTTON_BIG);
    createAccountBtn.addStyleName(UIConstants.COLOR_GRAY);
    contentLayout.addComponent(createAccountBtn);

    this.addComponent(contentLayout);
}

From source file:com.esofthead.mycollab.mobile.module.project.view.ProjectLoginViewImpl.java

License:Open Source License

private void initUI() {
    this.setStyleName("login-view");
    this.setSizeFull();

    VerticalLayout contentLayout = new VerticalLayout();
    contentLayout.setStyleName("content-wrapper");
    contentLayout.setDefaultComponentAlignment(Alignment.TOP_CENTER);
    contentLayout.setMargin(true);//from  ww w  . j  a v  a2  s .co m
    contentLayout.setSpacing(true);
    contentLayout.setWidth("320px");

    Image mainLogo = new Image(null, new ThemeResource("icons/logo_m.png"));
    contentLayout.addComponent(mainLogo);

    Label introText = new Label(
            "MyCollab helps you do all your office jobs on the computers, phones and tablets you use");
    introText.setStyleName("intro-text");
    contentLayout.addComponent(introText);

    CssLayout welcomeTextWrapper = new CssLayout();
    welcomeTextWrapper.setStyleName("welcometext-wrapper");
    welcomeTextWrapper.setWidth("100%");
    Label welcomeText = new Label("Login to Projects");
    welcomeText.setWidth("150px");
    welcomeTextWrapper.addComponent(welcomeText);
    contentLayout.addComponent(welcomeTextWrapper);

    final EmailField emailField = new EmailField();
    emailField.setWidth("100%");
    emailField.setInputPrompt("E-mail Address");
    emailField.setStyleName("email-input");
    contentLayout.addComponent(emailField);

    final PasswordField pwdField = new PasswordField();
    pwdField.setWidth("100%");
    pwdField.setInputPrompt("Password");
    pwdField.setStyleName("password-input");
    contentLayout.addComponent(pwdField);

    final CheckBox rememberPassword = new CheckBox();
    rememberPassword.setWidth("100%");
    rememberPassword.setCaption("Remember password");
    rememberPassword.setValue(true);
    contentLayout.addComponent(rememberPassword);

    Button signInBtn = new Button("Sign In");
    signInBtn.setWidth("100%");
    signInBtn.addStyleName(UIConstants.BUTTON_BIG);
    signInBtn.addStyleName(UIConstants.COLOR_BLUE);
    signInBtn.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            EventBusFactory.getInstance().post(new ProjectEvent.PlainLogin(this, new String[] {
                    emailField.getValue(), pwdField.getValue(), String.valueOf(rememberPassword.getValue()) }));
        }
    });
    contentLayout.addComponent(signInBtn);

    Button createAccountBtn = new Button("Create Account");
    createAccountBtn.setWidth("100%");
    createAccountBtn.addStyleName(UIConstants.BUTTON_BIG);
    createAccountBtn.addStyleName(UIConstants.COLOR_GRAY);
    contentLayout.addComponent(createAccountBtn);

    this.addComponent(contentLayout);
}

From source file:com.esofthead.mycollab.mobile.module.user.view.LoginViewImpl.java

License:Open Source License

private void initUI() {
    this.setStyleName("login-view");
    this.setSizeFull();

    VerticalLayout contentLayout = new VerticalLayout();
    contentLayout.setStyleName("content-wrapper");
    contentLayout.setDefaultComponentAlignment(Alignment.TOP_CENTER);
    contentLayout.setMargin(true);/*  w ww .j  a  v a2 s  .c  o m*/
    contentLayout.setSpacing(true);
    contentLayout.setWidth("320px");

    Image mainLogo = new Image(null, new ThemeResource("icons/logo_m.png"));
    contentLayout.addComponent(mainLogo);

    Label introText = new Label(
            "MyCollab helps you do all your office jobs on the computers, phones and tablets you use");
    introText.setStyleName("intro-text");
    contentLayout.addComponent(introText);

    CssLayout welcomeTextWrapper = new CssLayout();
    welcomeTextWrapper.setStyleName("welcometext-wrapper");
    welcomeTextWrapper.setWidth("100%");
    welcomeTextWrapper.setHeight("15px");
    Label welcomeText = new Label("Welcome Back!");
    welcomeText.setWidth("150px");
    welcomeTextWrapper.addComponent(welcomeText);
    contentLayout.addComponent(welcomeTextWrapper);

    final EmailField emailField = new EmailField();
    emailField.setWidth("100%");
    emailField.setInputPrompt("E-mail Address");
    emailField.setStyleName("email-input");
    contentLayout.addComponent(emailField);

    final PasswordField pwdField = new PasswordField();
    pwdField.setWidth("100%");
    pwdField.setInputPrompt("Password");
    pwdField.setStyleName("password-input");
    contentLayout.addComponent(pwdField);

    final CheckBox rememberPassword = new CheckBox();
    rememberPassword.setWidth("100%");
    rememberPassword.setCaption("Remember password");
    rememberPassword.setValue(true);
    contentLayout.addComponent(rememberPassword);

    Button signInBtn = new Button("Sign In");
    signInBtn.setWidth("100%");
    signInBtn.addStyleName(UIConstants.BUTTON_BIG);
    signInBtn.addStyleName(UIConstants.COLOR_BLUE);
    signInBtn.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(Button.ClickEvent event) {
            ShellController.doLogin(emailField.getValue(), pwdField.getValue(), rememberPassword.getValue());
        }
    });
    contentLayout.addComponent(signInBtn);

    Button createAccountBtn = new Button("Create Account");
    createAccountBtn.setWidth("100%");
    createAccountBtn.addStyleName(UIConstants.BUTTON_BIG);
    createAccountBtn.addStyleName(UIConstants.COLOR_GRAY);
    contentLayout.addComponent(createAccountBtn);

    this.addComponent(contentLayout);
}

From source file:com.esofthead.mycollab.module.project.view.kanban.AddNewColumnWindow.java

License:Open Source License

public AddNewColumnWindow(final IKanbanView kanbanView, final String type, final String fieldGroup) {
    super(AppContext.getMessage(TaskI18nEnum.ACTION_NEW_COLUMN));
    this.setWidth("800px");
    this.setModal(true);
    this.setResizable(false);
    this.center();
    MVerticalLayout layout = new MVerticalLayout().withMargin(new MarginInfo(false, false, true, false));
    GridFormLayoutHelper gridFormLayoutHelper = GridFormLayoutHelper.defaultFormLayoutHelper(1, 4);
    this.setContent(layout);

    final TextField stageField = new TextField();
    final CheckBox defaultProject = new CheckBox();
    defaultProject.setEnabled(AppContext.canBeYes(RolePermissionCollections.GLOBAL_PROJECT_SETTINGS));
    final ColorPicker colorPicker = new ColorPicker("", new com.vaadin.shared.ui.colorpicker.Color(
            DEFAULT_COLOR.getRed(), DEFAULT_COLOR.getGreen(), DEFAULT_COLOR.getBlue()));
    final TextArea description = new TextArea();

    gridFormLayoutHelper.addComponent(stageField, AppContext.getMessage(GenericI18Enum.FORM_NAME), 0, 0);
    gridFormLayoutHelper.addComponent(defaultProject,
            AppContext.getMessage(TaskI18nEnum.FORM_COLUMN_DEFAULT_FOR_NEW_PROJECT), 0, 1);
    gridFormLayoutHelper.addComponent(colorPicker, AppContext.getMessage(TaskI18nEnum.FORM_COLUMN_COLOR), 0, 2);
    gridFormLayoutHelper.addComponent(description, AppContext.getMessage(GenericI18Enum.FORM_DESCRIPTION), 0,
            3);//from  w  ww  . ja va2 s  . c o  m

    Button saveBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_SAVE), new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent clickEvent) {
            OptionVal optionVal = new OptionVal();
            optionVal.setCreatedtime(new GregorianCalendar().getTime());
            optionVal.setCreateduser(AppContext.getUsername());
            optionVal.setDescription(description.getValue());
            com.vaadin.shared.ui.colorpicker.Color color = colorPicker.getColor();
            String cssColor = color.getCSS();
            if (cssColor.startsWith("#")) {
                cssColor = cssColor.substring(1);
            }
            optionVal.setColor(cssColor);
            if (defaultProject.getValue()) {
                optionVal.setIsdefault(true);
            } else {
                optionVal.setIsdefault(false);
                optionVal.setExtraid(CurrentProjectVariables.getProjectId());
            }
            optionVal.setSaccountid(AppContext.getAccountId());
            optionVal.setType(type);
            optionVal.setTypeval(stageField.getValue());
            optionVal.setFieldgroup(fieldGroup);
            OptionValService optionService = AppContextUtil.getSpringBean(OptionValService.class);
            int optionValId = optionService.saveWithSession(optionVal, AppContext.getUsername());

            if (optionVal.getIsdefault()) {
                optionVal.setId(null);
                optionVal.setIsdefault(false);
                optionVal.setRefoption(optionValId);
                optionVal.setExtraid(CurrentProjectVariables.getProjectId());
                optionService.saveWithSession(optionVal, AppContext.getUsername());
            }
            kanbanView.addColumn(optionVal);
            close();
        }
    });
    saveBtn.setIcon(FontAwesome.SAVE);
    saveBtn.setStyleName(UIConstants.BUTTON_ACTION);

    Button cancelBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CANCEL),
            new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent clickEvent) {
                    close();
                }
            });
    cancelBtn.setStyleName(UIConstants.BUTTON_OPTION);

    MHorizontalLayout controls = new MHorizontalLayout().with(cancelBtn, saveBtn)
            .withMargin(new MarginInfo(false, true, false, false));
    layout.with(gridFormLayoutHelper.getLayout(), controls).withAlign(controls, Alignment.BOTTOM_RIGHT);
}

From source file:com.esspl.datagen.ui.SelectableResultSetTable.java

License:Open Source License

protected Table createResultsTable(ResultSet rs, List<String> columns) throws SQLException {
    ResultSetMetaData md = rs.getMetaData();
    Container c = new IndexedContainer();
    c.addContainerProperty(" ", CheckBox.class, null);
    for (int i = 0; i < md.getColumnCount(); ++i) {
        String label = md.getColumnLabel(i + 1);
        if (null == columns || columns.contains(label)) {
            Class<?> clazz = getClassForSqlType(md.getColumnClassName(i + 1));
            c.addContainerProperty(label, clazz, null);
        }//from w w  w  .j  a  va2 s  .  c o  m
    }

    int i = 0;
    while (rs.next()) {
        Item item = c.addItem(i++);
        int j = 0;
        for (Object propertyId : c.getContainerPropertyIds()) {
            if (j == 0) {
                CheckBox cb = new CheckBox();
                cb.setValue(true);
                item.getItemProperty(propertyId).setValue(cb);
            } else {
                item.getItemProperty(propertyId).setValue(rs.getObject(propertyId.toString()));
            }
            j++;
        }
    }

    final Table t = new Table(null, c);
    t.setSizeFull();
    t.setPageLength(50);
    t.setColumnReorderingAllowed(true);
    t.setColumnCollapsingAllowed(true);
    t.setSelectable(true);
    t.setColumnIcon(" ", DataGenConstant.CHECK_ALL);
    t.addListener(new HeaderClickListener() {

        @SuppressWarnings("rawtypes")
        @Override
        public void headerClick(HeaderClickEvent event) {
            String column = (String) event.getPropertyId();
            if (column.equals(" ")) {
                log.debug("SelectableResultSetTable - createResultsTable() checkbox states-" + isChecked);
                isChecked = (isChecked) ? false : true;
                Iterator iter = t.getItemIds().iterator();
                while (iter.hasNext()) {
                    int row = (Integer) iter.next();
                    Item item = t.getItem(row);
                    CheckBox cbx = (CheckBox) (item.getItemProperty(" ").getValue());
                    cbx.setValue(isChecked);
                }
            }
        }
    });
    return t;
}

From source file:com.expressui.core.view.field.FormField.java

License:Open Source License

private Field generateField() {
    Class propertyType = getPropertyType();

    if (propertyType == null) {
        return null;
    }/*from  w  w  w  .  j a  va  2  s  .c om*/

    if (Date.class.isAssignableFrom(propertyType)) {
        return new DateField();
    }

    if (boolean.class.isAssignableFrom(propertyType) || Boolean.class.isAssignableFrom(propertyType)) {
        return new CheckBox();
    }

    if (ReferenceEntity.class.isAssignableFrom(propertyType)) {
        return new Select();
    }

    if (Currency.class.isAssignableFrom(propertyType)) {
        return new Select();
    }

    if (propertyType.isEnum()) {
        return new Select();
    }

    if (Collection.class.isAssignableFrom(propertyType)) {
        return new ListSelect();
    }

    if (getBeanPropertyType().hasAnnotation(Lob.class)) {
        return new RichTextArea();
    }

    return new TextField();
}