Example usage for com.google.gwt.user.client.ui CheckBox setValue

List of usage examples for com.google.gwt.user.client.ui CheckBox setValue

Introduction

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

Prototype

@Override
public void setValue(Boolean value) 

Source Link

Document

Checks or unchecks the check box.

Usage

From source file:com.phideltcmu.recruiter.client.ui.CategoriesPanel.java

License:Creative Commons License

@Override
public void onCategoriesFetched(CategoriesFetchedEvent event) {
    this.remove(loading);
    VerticalPanel vp = new VerticalPanel();
    vp.add(header);/*from   w ww  .  j  av a2 s .  c om*/
    vp.add(new InlineHTML("<br><hr><br>"));
    for (final Category c : event.getCategoryList()) {
        final String categoryName = c.getValue();
        CheckBox checkBox = new CheckBox(categoryName);
        checkBox.setEnabled(true);
        checkBox.setValue(defaultCheck);
        checkBooleanMap.put(categoryName, defaultCheck);
        checkMap.put(c.getValue(), checkBox);

        checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
            @Override
            public void onValueChange(ValueChangeEvent<Boolean> booleanValueChangeEvent) {
                checkBooleanMap.put(categoryName, !checkBooleanMap.get(categoryName));
            }
        });
        vp.add(checkBox);
    }
    vp.add(new InlineHTML("<br><hr><br>"));
    this.add(vp);
    postFetchFireBus.fireEvent(new CategoriesPanelLoadedEvent(event.getCategoryList()));
}

From source file:com.phideltcmu.recruiter.client.ui.CategoriesPanel.java

License:Creative Commons License

public void setCategory(String s, Boolean b) {
    CheckBox c = checkMap.get(s);
    if (c != null) {
        c.setValue(b);
        checkBooleanMap.put(s, b);//w  w w.  ja  va  2  s. co  m
    }
}

From source file:com.qualogy.qafe.gwt.client.vo.functions.execute.ClearExecute.java

License:Apache License

private static void processClearForInputComponents(UIObject uiObject, BuiltInFunctionGVO builtInFunction) {
    if (uiObject instanceof TextBoxBase) {
        TextBoxBase textBoxBase = (TextBoxBase) uiObject;
        textBoxBase.setText("");
    }//from w  ww . j  a  va2 s .c  o  m

    if (uiObject instanceof QDatePicker) {
        QDatePicker qDatePicker = (QDatePicker) uiObject;
        qDatePicker.getTextBox().setText("");
    }

    if (uiObject instanceof HasDataGridMethods) {
        ((HasDataGridMethods) uiObject).insertData(null, false, builtInFunction.getSenderId(),
                builtInFunction.getListenerType());
        ((HasDataGridMethods) uiObject).redraw();
    }
    if (uiObject instanceof ListBox) {
        ListBox listBox = (ListBox) uiObject;
        boolean hasEmptyItem = DropDownRenderer.hasEmptyItem(listBox);
        int indexOfValue = hasEmptyItem ? 0 : -1;
        listBox.setSelectedIndex(indexOfValue);
        if (builtInFunction instanceof ClearGVO) {
            int offset = hasEmptyItem ? 1 : 0;
            while (listBox.getItemCount() > offset) {
                listBox.removeItem(listBox.getItemCount() - 1);
            }
        }
    }

    if (uiObject instanceof CheckBox) {
        CheckBox checkbox = (CheckBox) uiObject;
        checkbox.setValue(false);
        if (uiObject instanceof QRadioButton) {
            ((QRadioButton) uiObject).reset();
        }
    }

    if (uiObject instanceof FileUpload) {
        FileUpload fileUpload = (FileUpload) uiObject;
        Widget fup = fileUpload.getParent();
        // fup will be the layout component
        if (fup != null) {
            Widget fupp = fup.getParent();

            if (fupp instanceof FormPanel) {
                ((FormPanel) fupp).reset();
            }
        }
    }

    if (uiObject instanceof QSuggestBox) {
        QSuggestBox suggestTextField = (QSuggestBox) uiObject;
        suggestTextField.getTextBox().setText("");
    }
}

From source file:com.qualogy.qafe.gwt.client.vo.handlers.ClearHandler.java

License:Apache License

private void processClearForInputComponents(UIObject uiObject, BuiltInFunctionGVO builtInFunction) {
    if (uiObject instanceof TextBoxBase) {
        TextBoxBase textBoxBase = (TextBoxBase) uiObject;
        textBoxBase.setText("");
    }/*from ww  w  .ja  v a  2s. c  o m*/

    if (uiObject instanceof QDatePicker) {
        QDatePicker qDatePicker = (QDatePicker) uiObject;
        qDatePicker.getTextBox().setText("");
    }

    if (uiObject instanceof HasDataGridMethods) {
        ((HasDataGridMethods) uiObject).insertData(null, false, builtInFunction.getSenderId(),
                builtInFunction.getListenerType());
        ((HasDataGridMethods) uiObject).redraw();
    }
    if (uiObject instanceof ListBox) {
        ListBox listBox = (ListBox) uiObject;
        boolean hasEmptyItem = DropDownRenderer.hasEmptyItem(listBox);
        int indexOfValue = hasEmptyItem ? 0 : -1;
        listBox.setSelectedIndex(indexOfValue);
        if (builtInFunction instanceof ClearGVO) {
            int offset = hasEmptyItem ? 1 : 0;
            while (listBox.getItemCount() > offset) {
                listBox.removeItem(listBox.getItemCount() - 1);
            }
        }
    }

    if (uiObject instanceof CheckBox) {
        CheckBox checkbox = (CheckBox) uiObject;
        checkbox.setValue(false);
        if (uiObject instanceof QRadioButton) {
            ((QRadioButton) uiObject).reset();
        }
    }

    if (uiObject instanceof FileUpload) {
        FileUpload fileUpload = (FileUpload) uiObject;
        Widget fup = fileUpload.getParent();
        // fup will be the layout component
        if (fup != null) {
            Widget fupp = fup.getParent();

            if (fupp instanceof FormPanel) {
                ((FormPanel) fupp).reset();
            }
        }
    }

    if (uiObject instanceof QSuggestBox) {
        QSuggestBox suggestTextField = (QSuggestBox) uiObject;
        suggestTextField.getTextBox().setText("");
    }
}

From source file:com.risevision.ui.client.common.widgets.grid.ScrollingGridWidget.java

License:Open Source License

public void setCheckBox(int row, int column, Boolean checked, String id) {
    CheckBox cb = new CheckBox();
    cb.setValue(checked);
    cb.addClickHandler(this);
    setWidget(row, column, cb);//w ww .ja  v  a  2 s . c om
    actionMap.put(cb, ScrollingGridInfo.CHECKACTION + id);
}

From source file:com.risevision.ui.client.common.widgets.GridWidget.java

License:Open Source License

public void setCheckBox(int row, int column, Boolean checked, String id) {
    CheckBox cb = new CheckBox();
    cb.setValue(checked);
    cb.addClickHandler(this);
    setWidget(row, column, cb);/*from w ww .  jav  a  2 s. co  m*/
    actionMap.put(cb, GridInfo.CHECKACTION + id);
}

From source file:com.risevision.ui.client.common.widgets.RiseMultiSelectListBox.java

License:Open Source License

private void setAllValues(boolean value) {
    for (CheckBox checkBox : checkBoxList) {
        checkBox.setValue(value);
    }
}

From source file:com.risevision.ui.client.common.widgets.RolesWidget.java

License:Open Source License

public void clearRoles() {
    for (CheckBox cb : widgets)
        cb.setValue(false);
}

From source file:com.risevision.ui.client.common.widgets.RolesWidget.java

License:Open Source License

public void setSelected() {
    for (CheckBox cb : widgets)
        cb.setValue(true);
}

From source file:com.square.composant.contrat.square.client.view.ContratGarantieViewImpl.java

License:Open Source License

/** Construit le contenu. */
private void construireBlocContenu(GarantieModel garantie) {
    conteneurGlobal = new FlexTable();
    conteneurGlobal.setWidth(ContratsViewImplConstants.POURCENT_100);
    conteneurGlobal.setCellPadding(2);/*from   ww w  .  ja va2  s  .c o  m*/

    // Code tarif
    if (garantie.getCodeTarif() != null) {
        final Label lCodeTarif = new Label(viewConstants.libelleCodeTarif(), false);
        final Label labelCodeTarif = new Label(garantie.getCodeTarif(), false);
        conteneurGlobal.setWidget(0, 0, lCodeTarif);
        conteneurGlobal.setWidget(0, 1, labelCodeTarif);
    }

    // Code gnration
    if (garantie.getCodeGeneration() != null) {
        final Label lCodeGeneration = new Label(viewConstants.libelleCodeGeneration(), false);
        final Label labelCodeGeneration = new Label(garantie.getCodeGeneration(), false);
        conteneurGlobal.setWidget(0, 2, lCodeGeneration);
        conteneurGlobal.setWidget(0, 3, labelCodeGeneration);
    }

    // Garantie Gestion
    if (garantie.getLibelleGarantieGestion() != null) {
        final Label lGarantieGestion = new Label(viewConstants.libelleGarantieGestion(), false);
        final Label labelGarantieGestion = new Label(garantie.getLibelleGarantieGestion(), false);
        conteneurGlobal.setWidget(0, 4, lGarantieGestion);
        conteneurGlobal.setWidget(0, 5, labelGarantieGestion);
    }

    // Produit Gestion
    if (garantie.getLibelleProduitGestion() != null) {
        final Label lProduitGestion = new Label(viewConstants.libelleProduitGestion(), false);
        final Label labelProduitGestion = new Label(garantie.getLibelleProduitGestion(), false);
        conteneurGlobal.setWidget(0, 6, lProduitGestion);
        conteneurGlobal.setWidget(0, 7, labelProduitGestion);
    }

    // Loi Madelin
    final Label lLoiMadelin = new Label(viewConstants.libelleLoiMadelin(), false);
    final CheckBox cbLoiMadelin = new CheckBox();
    cbLoiMadelin.setEnabled(false);
    cbLoiMadelin.setValue(garantie.getLoiMadelin());
    conteneurGlobal.setWidget(1, 0, lLoiMadelin);
    conteneurGlobal.setWidget(1, 1, cbLoiMadelin);

    // Montant souscrit
    if (garantie.getMontantSouscrit() != null) {
        final Label lMontantSouscrit = new Label(viewConstants.libelleMontantSouscrit(), false);
        final Label labelMontantSouscrit = new Label(numberFormat.format(garantie.getMontantSouscrit()), false);
        conteneurGlobal.setWidget(1, 2, lMontantSouscrit);
        conteneurGlobal.setWidget(1, 3, labelMontantSouscrit);
    }

    conteneurGlobal.getColumnFormatter().setWidth(0, "14%");
    conteneurGlobal.getColumnFormatter().setWidth(1, "8%");
    conteneurGlobal.getColumnFormatter().setWidth(2, "12%");
    conteneurGlobal.getColumnFormatter().setWidth(3, "5%");
    conteneurGlobal.getColumnFormatter().setWidth(4, "12%");
    conteneurGlobal.getColumnFormatter().setWidth(5, "24%");
    conteneurGlobal.getColumnFormatter().setWidth(6, "12%");
    conteneurGlobal.getColumnFormatter().setWidth(7, "13%");
}