Package com.extjs.gxt.ui.client.widget.form

Examples of com.extjs.gxt.ui.client.widget.form.CheckBox


  column_1.setMenuDisabled(true);
  column_1.setResizable(false);
  column_1.setAlignment(HorizontalAlignment.LEFT);
  configs.add(column_1);

  chkBox1 = new CheckBox();

  CellEditor checkboxEditor1 = new CellEditor(chkBox1);

  column_2 = new CheckColumnConfig(UtilisateurGrpModel.B_Lecteur, "Lecteur", 100) {
  };
  column_2.setEditor(checkboxEditor1);
  column_2.setAlignment(HorizontalAlignment.LEFT);// id
  column_2.setSortable(false);
  column_2.setMenuDisabled(true);
  column_2.setResizable(false);
  configs.add(column_2);
  chkBox2 = new CheckBox();
  CellEditor checkboxEditor2 = new CellEditor(chkBox2);
  column_3 = new CheckColumnConfig(UtilisateurGrpModel.B_Contributeur, "Contributeur", 100) {
  };
  column_3.setAlignment(HorizontalAlignment.LEFT);
  column_3.setEditor(checkboxEditor2);
View Full Code Here


    GridCellRenderer<AbstractDto> checkboxRenderer = new GridCellRenderer<AbstractDto>() {
      @Override
      public Object render(AbstractDto model, String property, ColumnData config, int rowIndex, int colIndex,
          ListStore<AbstractDto> store, Grid<AbstractDto> grid) {
        Boolean value = (Boolean) model.get(property);
        CheckBox field = new CheckBox();
        field.setValue(value);
        return field;
      }
    };

    return checkboxRenderer;
View Full Code Here

    column.setEditor(new CellEditor(dateField));
    column.setDateTimeFormat(DateTimeFormat.getFormat("MMM dd yyyy"));
    configs.add(column);

    CheckColumnConfig checkColumn = new CheckColumnConfig("indoor", "Indoor?", 55);
    CellEditor checkBoxEditor = new CellEditor(new CheckBox());
    checkColumn.setEditor(checkBoxEditor);
    configs.add(checkColumn);

    final ListStore<Plant> store = new ListStore<Plant>();
View Full Code Here

    final SliderField sf = new SliderField(slider);
    sf.setFieldLabel("Size");
    simple.add(sf, formData);
   
    CheckBox check1 = new CheckBox();
    check1.setBoxLabel("Classical");

    CheckBox check2 = new CheckBox();
    check2.setBoxLabel("Rock");
    check2.setValue(true);

    CheckBox check3 = new CheckBox();
    check3.setBoxLabel("Blues");

    CheckBoxGroup checkGroup = new CheckBoxGroup();
    checkGroup.setFieldLabel("Music");
    checkGroup.add(check1);
    checkGroup.add(check2);
View Full Code Here

    column.setEditor(new CellEditor(dateField));
    column.setDateTimeFormat(DateTimeFormat.getFormat("yyyy MMM dd"));
    configs.add(column);

    CheckColumnConfig checkColumn = new CheckColumnConfig("indoor", "Indoor?", 55);
    CellEditor checkBoxEditor = new CellEditor(new CheckBox());
    checkColumn.setEditor(checkBoxEditor);
    configs.add(checkColumn);

    final ListStore<Plant> store = new ListStore<Plant>();
    store.add(TestData.getPlants());
View Full Code Here

    column.setEditor(new CellEditor(dateField));
    column.setDateTimeFormat(DateTimeFormat.getFormat("MMM dd yyyy"));
    configs.add(column);

    CheckColumnConfig checkColumn = new CheckColumnConfig("indoor", "Indoor?", 55);
    CellEditor checkBoxEditor = new CellEditor(new CheckBox());
    checkColumn.setEditor(checkBoxEditor);
    configs.add(checkColumn);

    final ListStore<Plant> store = new ListStore<Plant>();
    store.add(TestData.getPlants());
View Full Code Here

    slider.setMessage("{0} inches tall");

    final SliderField sf = new SliderField(slider);
    sf.setFieldLabel("Size");
    simple.add(sf, formData);
    CheckBox check1 = new CheckBox();
    check1.setBoxLabel("Classical");

    CheckBox check2 = new CheckBox();
    check2.setBoxLabel("Rock");
    check2.setValue(true);

    CheckBox check3 = new CheckBox();
    check3.setBoxLabel("Blue");

    CheckBoxGroup checkGroup = new CheckBoxGroup();
    checkGroup.setFieldLabel("Music");
    checkGroup.add(check1);
    checkGroup.add(check2);
View Full Code Here

        final CheckColumnConfig defaultColumn;
        final CheckColumnConfig activeColumn;
        if (editable) {
            defaultColumn = new CheckColumnConfig("default", Messages.get("label.urlmapping.default", "Default"), 70);
            defaultColumn.setEditor(new CellEditor(new CheckBox()));
            activeColumn = new CheckColumnConfig("active", Messages.get("label.urlmapping.active", "Active"), 55);
            activeColumn.setEditor(new CellEditor(new CheckBox()));
        } else {
            defaultColumn = new CheckColumnConfig("default", Messages.get("label.urlmapping.default", "Default"), 70){
                protected String getCheckState(ModelData model, String property, int rowIndex,
                                               int colIndex) {
                    return "-disabled";
View Full Code Here

        final GridCellRenderer<GWTJahiaNode> rolePermissionRenderer = new GridCellRenderer<GWTJahiaNode>() {
            public Object render(final GWTJahiaNode currentNode, String property, ColumnData config,
                                 final int rowIndex, final int colIndex, ListStore<GWTJahiaNode> s,
                                 final Grid<GWTJahiaNode> grid) {

                final CheckBox checkbox = new CheckBox();
                checkbox.setValue(selection.contains(currentNode));

                final GWTJahiaNode parentItem = store.getParent(currentNode);

                checkbox.setToolTip(currentNode.getName());
                boxes.put(currentNode.getPath(), checkbox);
                checkbox.addListener(Events.Change, new Listener<ComponentEvent>() {
                    public void handleEvent(ComponentEvent event) {
                        try {
                            if ((Boolean) ((FieldEvent) event).getValue()) {
                                selection.add(currentNode);

                                // Update dependencies
                                List<String> toCheck = dependencies.get(currentNode.getPath());
                                if (toCheck != null) {
                                    for (String s1 : toCheck) {
                                        CheckBox checkBox = boxes.get(s1);
                                        if (checkBox!=null && !checkBox.getValue()) {
                                            checkBox.setValue(true);
                                        }
                                    }
                                }

                                // Update children
                                checkbox.setData("partial", null);
                                List<GWTJahiaNode> l = store.getChildren(currentNode, true);
                                for (GWTJahiaNode node : l) {
                                    CheckBox b = boxes.get(node.getPath());
                                    if (b != null) {
                                        b.setValue(true);
                                    }
                                    selection.remove(node);
                                }

                                // If all siblings set, set parent
                                if (parentItem != null) {
                                    CheckBox parentBox = boxes.get(parentItem.getPath());
                                    if (!parentBox.getValue()) {
                                        List<GWTJahiaNode> siblings = store.getChildren(parentItem);
                                        boolean checkParent = true;
                                        for (GWTJahiaNode sibling : siblings) {
                                            checkParent &= selection.contains(sibling);
                                        }
                                        if (checkParent) {
                                            parentBox.setData("partial", null);
                                            parentBox.setValue(true);
                                        }
                                    }
                                }
                            } else {
                                selection.remove(currentNode);

                                // Update dependencies
                                Set<String> toCheck = dependencies.keySet();
                                for (String s1 : toCheck) {
                                    if (dependencies.get(s1).contains(currentNode.getPath())) {
                                        CheckBox checkBox = boxes.get(s1);
                                        if (checkBox != null && checkBox.getValue()) {
                                            checkBox.setValue(false);
                                        }
                                    }
                                }

                                // Uncheck parent
                                if (parentItem != null) {
                                    CheckBox parentBox = boxes.get(parentItem.getPath());
                                    if (parentBox.getValue()) {
                                        parentBox.setData("partial", Boolean.TRUE);
                                        parentBox.setValue(false);

                                        List<GWTJahiaNode> siblings = store.getChildren(parentItem);
                                        for (GWTJahiaNode node : siblings) {
                                                if (!node.getPath().equals(currentNode.getPath())) {
                                                    selection.add(node);
                                                }
                                        }
                                    }
                                }

                                // Update children
                                if (checkbox.getData("partial") == null) {
                                    checkbox.setData("partial", null);
                                    List<GWTJahiaNode> l = store.getChildren(currentNode, true);
                                    for (GWTJahiaNode node : l) {
                                        CheckBox b = boxes.get(node.getPath());
                                        if (b != null) {
                                            b.setValue(false);
                                        }
                                    }
                                }
                            }
                        } catch (Exception e) {
                            Log.debug("Exception on "+currentNode.getPath(), e);
                        }
                    }
                });

                if (parentItem != null) {
                    CheckBox parentBox = boxes.get(parentItem.getPath());
                    if (parentBox.getValue()) {
                        checkbox.setValue(true);
                        selection.remove(currentNode);
                    }
                }
View Full Code Here

     * @param tab
     * @param propertiesEditor  @return
     */
    private void attachManualListOrderingEditor(NodeHolder engine, AsyncTabItem tab, final PropertiesEditor propertiesEditor) {
        manualListOrderingEditor = new ManualListOrderingEditor(engine.getNode());
        useManualRanking = new CheckBox();

        // create a field set for the manual ranking
        final FieldSet fieldSet = new FieldSet();
        fieldSet.setCollapsible(true);
        fieldSet.setHeading(Messages.get("label.manualRanking", "Manual ranking"));
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.form.CheckBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.