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

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

Introduction

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

Prototype

public CheckBox() 

Source Link

Document

Creates a check box with no label.

Usage

From source file:com.square.composant.tarificateur.square.client.view.popup.doublon.PopupCreationAssureSocialDoublonViewImpl.java

License:Open Source License

/**
 * Construit le tableau de recherche.//from  w  ww  .  j a v a  2s .  c o m
 * @param listeDoublons la liste des doublons.
 */
private void construireTableauRecherche(List<PersonneDoublonModel> newListeDoublons) {
    final List<CheckBox> listeCBSelection = new ArrayList<CheckBox>();
    final HeaderFlexTable<PersonneDoublonModel> ftDoublons = new HeaderFlexTable<PersonneDoublonModel>() {
        @Override
        public Widget[] setHeader() {
            return new Widget[] { new Label(viewConstants.enTeteColonneNom()),
                    new Label(viewConstants.enTeteColonnePrenom()),
                    new Label(viewConstants.enTeteColonneDateNaissance()),
                    new Label(viewConstants.enTeteColonneAdresse()),
                    new Label(viewConstants.enTeteColonneCodePostal()),
                    new Label(viewConstants.enTeteColonneVille()),
                    new Label(viewConstants.enTeteColonneCompoFamiliale()),
                    new Label(viewConstants.enTeteSelection()) };
        }

        @Override
        public void setRow(final PersonneDoublonModel doublon) {
            setWidget(0, new Label(doublon.getNom()));
            setWidget(1, new Label(doublon.getPrenom()));
            setWidget(2, new Label(doublon.getDateNaissance()));
            setWidget(3, new Label(doublon.getAdresse()));
            setWidget(4, new Label(doublon.getCodePostal()));
            setWidget(5, new Label(doublon.getCommune()));
            setWidget(6, new Label(doublon.getCompoFamiliale()));
            final CheckBox cb = new CheckBox();
            cb.addClickHandler(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    if (cb.getValue()) {
                        for (CheckBox checkBox : listeCBSelection) {
                            if (!cb.equals(checkBox)) {
                                checkBox.setEnabled(false);
                            }
                        }
                        idPersonneSelectionnee = doublon.getId();
                        btnRattacher.setEnabled(true);
                    } else {
                        for (CheckBox checkBox : listeCBSelection) {
                            checkBox.setEnabled(true);
                        }
                        idPersonneSelectionnee = null;
                        btnRattacher.setEnabled(false);
                    }
                }
            });
            listeCBSelection.add(cb);
            setWidget(7, cb);
            setCellHorizontalAlignment(7, HasAlignment.ALIGN_CENTER);
        }
    };
    ftDoublons.setWidth(ComposantTarificateurConstants.POURCENT_100);
    ftDoublons.setListeObjets(newListeDoublons);

    final ScrollPanel scrollPanel = new ScrollPanel();
    scrollPanel.setHeight("250px");
    scrollPanel.add(ftDoublons);
    pContenu.add(scrollPanel);
}

From source file:com.tasktop.c2c.server.tasks.client.widgets.CustomFieldEditor.java

License:Open Source License

private Widget createWidget(FieldDescriptor field, String fieldValue) {
    switch (field.getFieldType()) {
    case MULTI_SELECT:
    case SINGLE_SELECT:
        boolean isMultipleSelect = field.getFieldType() == FieldType.MULTI_SELECT;
        ListBox listBox = new ListBox(isMultipleSelect);
        int index = 0;
        Set<String> values = new HashSet<String>();
        if (fieldValue != null) {
            if (isMultipleSelect) {
                values.addAll(Arrays.asList(fieldValue.split("\\s*,\\s*")));
            } else {
                values.add(fieldValue);//from   w w  w . ja va  2 s  .  c o  m
            }
        }
        for (String value : field.getValueStrings()) {
            listBox.addItem(value, value);
            if (values.contains(value)) {
                listBox.setItemSelected(index, true);
            }
            ++index;
        }
        return listBox;

    case TASK_REFERENCE: // FIXME: provide a better way
    case TEXT:
        TextBox textBox = new TextBox();
        textBox.setText(fieldValue);
        return textBox;

    case TIMESTAMP:
        DateBox dateBox = new DateBox();
        if (fieldValue != null && fieldValue.trim().length() > 0) {
            try {
                dateBox.setValue(new Date(Long.parseLong(fieldValue.trim())));
            } catch (NumberFormatException e) {
                // fall-back
                TextBox newTextBox = new TextBox();
                newTextBox.setText(fieldValue);
                return newTextBox;
            }
        }
        return dateBox;

    case CHECKBOX:
        CheckBox checkBox = new CheckBox();
        Boolean cbValue = fieldValue != null && Boolean.parseBoolean(fieldValue);
        checkBox.setValue(cbValue);
        return checkBox;

    }
    return new Label(fieldValue);
}

From source file:com.webgocommerce.client.view.uidocventa.UIDocVenta.java

private void initComponents() {
    btnCambiarEstado = new Button("Ver estado");
    btnExportar = new Button("Exportar");
    lstFiltro = new ListBox();
    lstFiltro.addItem("DOC. CLIENTE", "RUCCLIENTE");
    lstFiltro.addItem("NOM. CLIENTE", "DESCCLIENTE");
    lstFiltro.addItem("CORRELATIVO", "CORRELATIVO");
    pnlSearch = new FlexTable();
    chkExcluirFechas = new CheckBox();
    chkSoloAnulados = new CheckBox();
    boxDateIni = new DateBox(new DatePicker(), UISesion.beanInitParam.getFechaServer(), defaultFormat);
    boxDateFin = new DateBox(new DatePicker(), UISesion.beanInitParam.getFechaServer(), defaultFormat);
    lblDesde = new Label("Fecha Emision:  Desde");
    lblHasta = new Label("Hasta");
    lblExcluirFechas = new Label("ExcluirFechas");
    lblSoloAnulados = new Label("Mostrar solo Anulados");
    pnlSearch.setWidget(0, 0, lblDesde);
    pnlSearch.setWidget(0, 1, boxDateIni);
    pnlSearch.setWidget(0, 2, lblHasta);
    pnlSearch.setWidget(0, 3, boxDateFin);
    pnlSearch.setWidget(0, 4, lblExcluirFechas);
    pnlSearch.setWidget(0, 5, chkExcluirFechas);
    pnlSearch.setWidget(0, 6, new UISeparador());
    pnlSearch.setWidget(0, 7, lblSoloAnulados);
    pnlSearch.setWidget(0, 8, chkSoloAnulados);
    lblSeparador = new Label("-");
    lblTipoDoc = new Label("");
    lblSerie = new Label("");
    lblPreImpreso = new Label("");
    lblDocumento = new Label("Detalle del documento:");
    txtBuscar = new MSearchBox();
    txtBuscar.setPlaceHolder("Buscar");
    pnlToolDoc = new HorizontalPanel();
    pnlToolDoc.add(lblDocumento);/*  w w  w  . j a va  2 s .  c  o  m*/
    pnlToolDoc.add((new UISeparador()).isSpace());
    pnlToolDoc.add(lblTipoDoc);
    pnlToolDoc.add((new UISeparador()).isSpace());
    pnlToolDoc.add(lblSerie);
    pnlToolDoc.add(lblSeparador);
    pnlToolDoc.add(lblPreImpreso);
    pnlData = new FlexTable();
    grid = new GridCabeceraVenta();
    grid.setMinimumTableWidth(1024, Style.Unit.PX);
    grid2 = new GridDetailVenta();
    grid2.setMinimumTableWidth(1024, Style.Unit.PX);
    pnlData.setWidget(0, 0, grid);
    pnlData.setWidget(1, 0, pnlToolDoc);
    pnlData.setWidget(2, 0, grid2);
    this.getPnlTabla().add(pnlData);
    pnlSearch.setWidget(1, 0, lstFiltro);
    pnlSearch.setWidget(1, 1, txtBuscar);
    pnlSearch.getFlexCellFormatter().setColSpan(1, 1, 8);
    pnlSearch.setCellSpacing(5);
    this.getPnlBusqueda().add(pnlSearch);
    this.btnOper1.setVisible(false);
    this.btnOper2.setVisible(false);
    this.btnOper3.setVisible(false);
    this.addComponent(btnCambiarEstado);
    btnCambiarEstado.setVisible(false);
    this.addComponent(btnExportar);
    Window.addResizeHandler(new ResizeHandler() {

        @Override
        public void onResize(ResizeEvent event) {
            reCalcularWindows();
        }
    });
}

From source file:com.xpn.xwiki.watch.client.ui.dialog.FeedDeleteDialog.java

License:Open Source License

public FeedDeleteDialog(XWikiGWTApp xWikiGWTApp, String name, Feed feed, AsyncCallback nextCallback) {
    super(xWikiGWTApp, name, Dialog.BUTTON_NEXT | Dialog.BUTTON_CANCEL, nextCallback);

    this.feed = feed;

    FlowPanel main = new FlowPanel();
    main.addStyleName(getCSSName("main"));
    String feedTitle = feed.getTitle().trim().length() > 0 ? feed.getTitle() : feed.getName();
    HTMLPanel questionPanel = new HTMLPanel(
            app.getTranslation("removefeed.confirm", new String[] { feedTitle }));
    questionPanel.addStyleName(getCssPrefix() + "-invitation");
    main.add(questionPanel);/*w  w  w.  java2s  .  c om*/
    //create the checkbox
    this.deleteArticlesCheckBox = new CheckBox();
    this.deleteArticlesCheckBox.setText(app.getTranslation(getDialogTranslationName() + ".withArticles"));
    this.deleteArticlesCheckBox.setChecked(false);
    this.deleteArticlesCheckBox.setStyleName(getCSSName("witharticles"));
    main.add(deleteArticlesCheckBox);
    main.add(getActionsPanel());
    this.add(main);
}

From source file:com.xpn.xwiki.watch.client.ui.dialog.PressReviewMailDialog.java

License:Open Source License

protected Widget getParametersPanel() {
    FlowPanel paramsPanel = new FlowPanel();
    Label mailSubjectLabel = new Label();
    mailSubjectLabel.setStyleName("mailsubject-label");
    mailSubjectLabel.setText(app.getTranslation(getDialogTranslationName() + ".mailsubject"));
    paramsPanel.add(mailSubjectLabel);/*from w  w  w .j av  a 2  s . c  o m*/

    mailSubjectTextBox = new TextBox();
    mailSubjectTextBox.setVisibleLength(60);
    mailSubjectTextBox.setName("mailsubject");
    mailSubjectTextBox.setStyleName(getCSSName("mailsubject"));
    mailSubjectTextBox.setText(app.getTranslation(getDialogTranslationName() + ".mailsubjectdefault"));
    paramsPanel.add(mailSubjectTextBox);

    Label mailToLabel = new Label();
    mailToLabel.setStyleName("mailto-label");
    mailToLabel.setText(app.getTranslation(getDialogTranslationName() + ".mailto"));
    paramsPanel.add(mailToLabel);

    mailToTextBox = new TextBox();
    mailToTextBox.setVisibleLength(60);
    mailToTextBox.setName("mailto");
    mailToTextBox.setStyleName(getCSSName("mailto"));
    paramsPanel.add(mailToTextBox);

    Label mailContentLabel = new Label();
    mailContentLabel.setStyleName("mailcontent-label");
    mailContentLabel.setText(app.getTranslation(getDialogTranslationName() + ".mailcontent"));
    paramsPanel.add(mailContentLabel);

    mailContentTextArea = new TextArea();
    mailContentTextArea.setVisibleLines(5);
    mailContentTextArea.setName("mailcontent");
    mailContentTextArea.setStyleName(getCSSName("mailcontent"));
    mailContentTextArea.setText(app.getTranslation(getDialogTranslationName() + ".mailcontentdefault"));
    paramsPanel.add(mailContentTextArea);

    articlesContentCheckBox = new CheckBox();
    articlesContentCheckBox.setText(app.getTranslation(getDialogTranslationName() + ".articleswithcontent"));
    articlesContentCheckBox.setStyleName(getCSSName("withcontent"));
    paramsPanel.add(articlesContentCheckBox);

    articlesCommentsCheckBox = new CheckBox();
    articlesCommentsCheckBox.setText(app.getTranslation(getDialogTranslationName() + ".articleswithcomments"));
    articlesCommentsCheckBox.setStyleName(getCSSName("withcomments"));
    paramsPanel.add(articlesCommentsCheckBox);

    return paramsPanel;
}

From source file:com.xpn.xwiki.watch.client.ui.filterbar.StateSelectorsWidget.java

License:Open Source License

public StateSelectorsWidget(Watch w) {
    super(w);//  www .  j a v  a 2 s.  co m
    setPanel(new FlowPanel());
    initWidget(panel);
    init();
    panel.setStyleName(watch.getStyleName("filter", "filter"));
    panel.add(getSeeOnlyTitlePanel());
    this.flaggedCheckBox = new CheckBox();
    panel.add(getCheckBoxPanel(this.flaggedCheckBox, "flagged", (watch.getFilterStatus().getFlagged() == 1),
            new ClickListener() {
                public void onClick(Widget widget) {
                    if (((CheckBox) widget).isChecked()) {
                        watch.refreshOnShowOnlyFlaggedArticles();
                        // Uncheck the trashed checkbox
                        CheckBox trashedCheckBox = getTrashedCheckBox();
                        if (trashedCheckBox.isChecked()) {
                            trashedCheckBox.setChecked(false);
                        }
                    } else {
                        watch.refreshOnNotShowOnlyFlaggedArticles();
                    }
                }
            }));
    this.readCheckBox = new CheckBox();
    panel.add(getCheckBoxPanel(this.readCheckBox, "read", (watch.getFilterStatus().getRead() == 1),
            new ClickListener() {
                public void onClick(Widget widget) {
                    if (((CheckBox) widget).isChecked()) {
                        watch.refreshOnShowOnlyReadArticles();
                        // Uncheck the unread checkbox
                        CheckBox unreadCheckBox = getUnreadCheckBox();
                        if (unreadCheckBox.isChecked()) {
                            unreadCheckBox.setChecked(false);
                        }
                    } else {
                        watch.refreshOnNotShowOnlyReadArticles();
                    }
                }
            }));
    this.unreadCheckBox = new CheckBox();
    panel.add(getCheckBoxPanel(this.unreadCheckBox, "unread", (watch.getFilterStatus().getRead() == -1),
            new ClickListener() {
                public void onClick(Widget widget) {
                    if (((CheckBox) widget).isChecked()) {
                        watch.refreshOnShowOnlyUnReadArticles();
                        // Uncheck the read articles checkbox
                        CheckBox readCheckBox = getReadCheckBox();
                        if (readCheckBox.isChecked()) {
                            readCheckBox.setChecked(false);
                        }
                    } else {
                        watch.refreshOnNotShowOnlyUnReadArticles();
                    }
                }
            }));
    this.trashedCheckBox = new CheckBox();
    panel.add(getCheckBoxPanel(this.trashedCheckBox, "trashed", (watch.getFilterStatus().getTrashed() == 1),
            new ClickListener() {
                public void onClick(Widget widget) {
                    if (((CheckBox) widget).isChecked()) {
                        watch.refreshOnShowOnlyTrashedArticles();
                        // Uncheck the flagged checkbox
                        CheckBox flaggedCheckBox = getFlaggedCheckBox();
                        if (flaggedCheckBox.isChecked()) {
                            flaggedCheckBox.setChecked(false);
                        }
                    } else {
                        watch.refreshOnNotShowOnlyTrashedArticles();
                    }
                }
            }));
}

From source file:de.fhrt.codenvy.bpmn.part.bpmnProperties.widgets.elements.process.general.TabGeneralView.java

License:Open Source License

@Override
public void initContentElements() {
    Log.info(TabGeneralView.class, "initContentElements");
    tbProcessId = new TextBox();
    tbProcessId.setWidth("100%");
    tbName = new TextBox();
    tbName.setWidth("100%");
    cbIsExecutable = new CheckBox();
    cbIsExecutable.setWidth("100%");
    ctDataObjects = new TableDataObjectsWidget(getJsoAccess());
    ctDataObjects.setWidth("100%");
    tbDocumentation = new TextBox();
    tbDocumentation.setWidth("100%");
}

From source file:de.fhrt.codenvy.bpmn.part.bpmnProperties.widgets.elements.reusableTabs.general.TabGeneralView.java

License:Open Source License

@Override
public void initContentElements() {
    Log.info(TabGeneralView.class, "initContentElements");

    /*// w w w.  j  a v  a  2s .co m
     * default elements
     */
    tbId = new TextBox();
    tbId.setWidth("100%");

    tbName = new TextBox();
    tbName.setWidth("100%");

    /*
     * elements for UserTask
     */
    tbAssignee = new TextBox();
    tbAssignee.setWidth("100%");

    tbCandidateUsers = new TextBox();
    tbCandidateUsers.setWidth("100%");

    tbCandidateGroups = new TextBox();
    tbCandidateGroups.setWidth("100%");

    tbFormKey = new TextBox();
    tbFormKey.setWidth("100%");

    tbDueDate = new TextBox();
    tbDueDate.setWidth("100%");

    tbFollowUpDate = new TextBox();
    tbFollowUpDate.setWidth("100%");

    tbPriority = new TextBox();
    tbPriority.setWidth("100%");

    /*
     * elements for ServiceTask
     */
    rbClass = new RadioButton("type");
    rbClass.setWidth("30px");
    tbClass = new TextBox();
    tbClass.setWidth("100%");

    rbExpression = new RadioButton("type");
    rbExpression.setWidth("30px");
    tbExpression = new TextBox();
    tbExpression.setWidth("100%");

    rbExpressionDelegate = new RadioButton("type");
    rbExpressionDelegate.setWidth("30px");
    tbExpressionDelegate = new TextBox();
    tbExpressionDelegate.setWidth("100%");

    tbResultVariable = new TextBox();
    tbResultVariable.setWidth("100%");

    /*
     * default elements
     */
    cbAsycBefore = new CheckBox();
    cbAsycBefore.setWidth("100%");
    cbAsycBefore.setHTML(
            "More information on asynchronous continuation can be found in the <a href='http://docs.camunda.org/manual/7.3/guides/user-guide/#process-engine-transactions-in-processes-asynchronous-continuations' target='_blank'>Camunda user guide</a>");

    cbAsycAfter = new CheckBox();
    cbAsycAfter.setWidth("100%");
    cbAsycAfter.setHTML(
            "More information on asynchronous continuation can be found in the <a href='http://docs.camunda.org/manual/7.3/guides/user-guide/#process-engine-transactions-in-processes-asynchronous-continuations' target='_blank'>Camunda user guide</a>");

    cbExclusive = new CheckBox();
    cbExclusive.setWidth("100%");
    cbExclusive.setHTML(
            "More information on exclusive jobs can be found in the <a href='http://docs.camunda.org/manual/7.3/guides/user-guide/#process-engine-the-job-executor-exclusive-jobs' target='_blank'>Camunda user guide</a>");

    tbRetryTimeCycle = new TextBox();
    tbRetryTimeCycle.setWidth("100%");

    cbForCompensation = new CheckBox();
    cbForCompensation.setWidth("100%");

    tbDocumentation = new TextBox();
    tbDocumentation.setWidth("100%");
}

From source file:de.fhrt.codenvy.bpmn.part.bpmnProperties.widgets.elements.reusableTabs.multiinstance.TabMultiInstanceView.java

License:Open Source License

@Override
public void initContentElements() {
    Log.info(TabMultiInstanceView.class, "initContentElements");
    cbIsLoop = new CheckBox();
    cbIsLoop.setWidth("100%");
    cbIsLoop.setHTML(//from ww w. j  a va  2 s.c o  m
            "Please note, the loop activity is not supported by the Camunda BPM engine. See for more information the <a href='http://docs.camunda.org/manual/7.3/api-references/bpmn20/#tasks-task-markers-loops' target='_blank' >Camunda user guide</a>.");

    cbMultiInstance = new CheckBox();
    cbMultiInstance.setWidth("100%");
    cbMultiInstance.setHTML(
            "Please refer to the <a href='http://docs.camunda.org/manual/7.3/api-references/bpmn20/#tasks-task-markers-multiple-instance' target='_blank'>Camunda documentation</a> for multi instance.");

    tbMultiInstanceLoopCardinality = new TextBox();
    tbMultiInstanceLoopCardinality.setWidth("100%");

    cbMultiInstanceIsSequential = new CheckBox();
    cbMultiInstanceIsSequential.setWidth("100%");

    tbMultiInstanceCollection = new TextBox();
    tbMultiInstanceCollection.setWidth("100%");

    tbMultiInstanceElementVariable = new TextBox();
    tbMultiInstanceElementVariable.setWidth("100%");

    tbMultiInstanceCompletionCondition = new TextBox();
    tbMultiInstanceCompletionCondition.setWidth("100%");

}

From source file:de.fhrt.codenvy.bpmn.part.properties.widgets.base.multiinstance.TabMultiInstanceView.java

License:Open Source License

@Override
public void initContentElements() {
    Log.info(TabMultiInstanceView.class, "initContentElements");
    cbIsLoop = new CheckBox();
    cbIsLoop.setWidth("100%");

    cbMultiInstance = new CheckBox();
    cbMultiInstance.setWidth("100%");

}