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.ephesoft.dcma.gwt.admin.bm.client.view.tableinfo.TableInfoView.java

License:Open Source License

private List<Record> setFieldsList(List<TableColumnInfoDTO> fields) {

    List<Record> recordList = new LinkedList<Record>();
    for (final TableColumnInfoDTO tcInfoDTO : fields) {
        Record record = new Record(tcInfoDTO.getIdentifier());
        CheckBox isRequired = new CheckBox();
        CheckBox isMandatory = new CheckBox();
        isRequired.setValue(tcInfoDTO.isRequired());
        isRequired.setEnabled(false);//from   w  ww  .j  a  v a 2 s. c o  m
        isMandatory.setValue(tcInfoDTO.isMandatory());
        isMandatory.setEnabled(false);
        record.addWidget(tableColumnInfoListView.betweenLeft, new Label(tcInfoDTO.getBetweenLeft()));
        record.addWidget(tableColumnInfoListView.betweenRight, new Label(tcInfoDTO.getBetweenRight()));
        record.addWidget(tableColumnInfoListView.columnName, new Label(tcInfoDTO.getColumnName()));
        record.addWidget(tableColumnInfoListView.columnHeaderPattern,
                new Label(tcInfoDTO.getColumnHeaderPattern()));
        record.addWidget(tableColumnInfoListView.columnStartCoord,
                new Label(tcInfoDTO.getColumnStartCoordinate()));
        record.addWidget(tableColumnInfoListView.columnEndCoord, new Label(tcInfoDTO.getColumnEndCoordinate()));
        record.addWidget(tableColumnInfoListView.columnPattern, new Label(tcInfoDTO.getColumnPattern()));
        record.addWidget(tableColumnInfoListView.isRequired, isRequired);
        record.addWidget(tableColumnInfoListView.isMandatory, isMandatory);
        recordList.add(record);
    }

    return recordList;
}

From source file:com.ephesoft.dcma.gwt.batchinstance.client.view.BatchInstanceView.java

License:Open Source License

private List<Record> createRecords(Collection<BatchInstanceDTO> batchInstanceDTOs) {
    List<Record> recordList = new LinkedList<Record>();
    batchInstanceDTOMap.clear();/*  w  w w  .  j av a 2s. com*/
    for (final BatchInstanceDTO batchInstanceDTO : batchInstanceDTOs) {
        CheckBox checkBox = new CheckBox();
        checkBox.setValue(batchInstanceDTO.isRemote());
        checkBox.setEnabled(false);
        Record record = new Record(batchInstanceDTO.getBatchIdentifier());
        String[] priority = convertPriority(batchInstanceDTO.getPriority());
        Label property = new Label(priority[0]);
        record.addWidget(batchInstanceListView.priority, property);
        property.setStyleName(priority[1]);
        record.addWidget(batchInstanceListView.batchId, new Label(batchInstanceDTO.getBatchIdentifier()));
        record.addWidget(batchInstanceListView.batchClassName, new Label(batchInstanceDTO.getBatchClassName()));
        record.addWidget(batchInstanceListView.batchName, new Label(batchInstanceDTO.getBatchName()));
        record.addWidget(batchInstanceListView.batchCreatedOn, new Label(batchInstanceDTO.getCreatedOn()));
        record.addWidget(batchInstanceListView.batchUpdatedOn, new Label(batchInstanceDTO.getUploadedOn()));
        record.addWidget(batchInstanceListView.currentUser, new Label(batchInstanceDTO.getCurrentUser()));
        record.addWidget(batchInstanceListView.status, new Label(batchInstanceDTO.getStatus()));
        record.addWidget(batchInstanceListView.isRemote, checkBox);
        recordList.add(record);
        batchInstanceDTOMap.put(batchInstanceDTO.getBatchIdentifier(), batchInstanceDTO);
    }
    if (recordList.isEmpty()) {
        disableButtons();
    }

    return recordList;
}

From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderTableView.java

License:Open Source License

private final void createTableHeader() {
    selectAll = new CheckBox();
    selectAll.addClickHandler(new ClickHandler() {

        @Override//from  ww  w  .  j  a va2 s. c  om
        public void onClick(ClickEvent event) {
            Boolean isSelectAllSelected = selectAll.getValue();
            for (FolderTableRow folderTableRow : folderTableRows) {
                folderTableRow.checkBox.setValue(isSelectAllSelected);
            }
        }
    });
    headers.setWidget(0, 0, selectAll);
    String name = LocaleDictionary.get().getConstantValue(FolderManagementConstants.NAME);

    String modifiedAt = LocaleDictionary.get().getConstantValue(FolderManagementConstants.MODIFIED_AT);
    String type = LocaleDictionary.get().getConstantValue(FolderManagementConstants.TYPE);

    HTML nameHTML = new HTML(name);
    HTML modifiedAtHTML = new HTML(modifiedAt);
    HTML typeHTML = new HTML(type);
    final HorizontalPanel nameHorizontalPanel = new HorizontalPanel();
    final HorizontalPanel modifiedHorizontalPanel = new HorizontalPanel();
    final HorizontalPanel typeHorizontalPanel = new HorizontalPanel();
    nameHorizontalPanel.add(nameHTML);
    modifiedHorizontalPanel.add(modifiedAtHTML);
    typeHorizontalPanel.add(typeHTML);

    nameHorizontalPanel.addStyleName(FolderManagementConstants.CURSOR_HAND);
    modifiedHorizontalPanel.addStyleName(FolderManagementConstants.CURSOR_HAND);
    typeHorizontalPanel.addStyleName(FolderManagementConstants.CURSOR_HAND);
    nameHTML.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            nameOrderAscending = toggleSortingAnchor(nameHorizontalPanel, nameOrderAscending);
            lastSortingOption = SortingOption.NAME;
            updateTableContent(presenter.getFolderPath());
        }

    });
    modifiedAtHTML.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            dateOrderAscending = toggleSortingAnchor(modifiedHorizontalPanel, dateOrderAscending);
            lastSortingOption = SortingOption.DATE;
            updateTableContent(presenter.getFolderPath());
        }
    });
    typeHTML.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            typeOrderAscending = toggleSortingAnchor(typeHorizontalPanel, typeOrderAscending);
            lastSortingOption = SortingOption.TYPE;
            updateTableContent(presenter.getFolderPath());
        }

    });

    headers.setWidget(0, 1, nameHorizontalPanel);
    headers.setWidget(0, 2, modifiedHorizontalPanel);
    headers.setWidget(0, 3, typeHorizontalPanel);
    headers.getCellFormatter().addStyleName(0, 0, FolderManagementConstants.FILES_TABLE_SMALL_COLUMN
            + FolderManagementConstants.SPACE + FolderManagementConstants.FILES_TABLE_HEADER_CELL);
    headers.getCellFormatter().addStyleName(0, 1, FolderManagementConstants.FILES_TABLE_HEADER_CELL);
    headers.getCellFormatter().addStyleName(0, 2, FolderManagementConstants.FILES_TABLE_HEADER_CELL);
    headers.getCellFormatter().addStyleName(0, 3, FolderManagementConstants.FILES_TABLE_HEADER_CELL);
    headers.getColumnFormatter().setWidth(0, PERCENTAGE_FIVE);
    headers.getColumnFormatter().setWidth(1, PERCENTAGE_FOURTY_EIGHT);
    headers.getColumnFormatter().setWidth(2, PERCENTAGE_TWENTY_EIGHT);
    headers.getColumnFormatter().setWidth(3, PERCENTAGE_ELEVEN);
    headers.setWidth(PERCENTAGE_HUNDRED);
}

From source file:com.ephesoft.dcma.gwt.foldermanager.client.view.FolderTableView.java

License:Open Source License

private void insertFileRow(final FileWrapper file) {
    int numRows = folderDisplayTable.getRowCount();

    CheckBox checkBox = new CheckBox();
    final String fileName = file.getName();
    FolderTableRow fileTableRow = new FolderTableRow(checkBox, file);
    folderTableRows.add(fileTableRow);//from   ww w .  j a  va 2s .  c om
    folderDisplayTable.setWidget(numRows, 0, checkBox);
    HTML fileIconedName = getFileIconedName(fileName, file.getKind());
    fileIconedName.addStyleName(FolderManagementConstants.CURSOR_HAND);
    addHandlersToFileIconedName(file, fileName, fileIconedName);

    folderDisplayTable.setWidget(numRows, 1, fileIconedName);
    folderDisplayTable.setText(numRows, 2, file.getModified());
    folderDisplayTable.setText(numRows, 3, file.getKind().toString());
    folderDisplayTable.getCellFormatter().addStyleName(numRows, 0,
            FolderManagementConstants.FILES_TABLE_SMALL_COLUMN);
    folderDisplayTable.getCellFormatter().addStyleName(numRows, 1, FolderManagementConstants.TOP_LINKS);
    folderDisplayTable.getCellFormatter().addStyleName(numRows, 2, FolderManagementConstants.TOP_LINKS);
    folderDisplayTable.getCellFormatter().addStyleName(numRows, 3, FolderManagementConstants.TOP_LINKS);
    if (numRows % 2 != 0) {
        folderDisplayTable.getRowFormatter().addStyleName(numRows, FolderManagementConstants.FILES_TABLE_ODD);
    }
}

From source file:com.ephesoft.dcma.gwt.rv.client.view.TableExtractionView.java

License:Open Source License

private void addHeaderColumns(final List<Column> columnList, final FlexTable flexTable) {
    tableNameVsCheckBoxMap.get(selectedDataTableName).clear();
    int columnNumber = 0;
    for (Column headerColumn : columnList) {
        HorizontalPanel headerRowPanel = new HorizontalPanel();
        Label headerText = new Label(headerColumn.getName());
        headerRowPanel.add(headerText);/*from ww w .  java 2  s.  co  m*/
        headerRowPanel.setWidth("80px");
        CheckBox validationCheckBox = new CheckBox();
        validationCheckBox.setVisible(Boolean.FALSE);
        headerRowPanel.add(validationCheckBox);
        headerRowPanel.setCellVerticalAlignment(validationCheckBox, HasVerticalAlignment.ALIGN_MIDDLE);
        tableNameVsCheckBoxMap.get(selectedDataTableName).add(validationCheckBox);
        flexTable.setWidget(0, columnNumber, headerRowPanel);
        flexTable.getCellFormatter().addStyleName(0, columnNumber, "wordWrap");
        columnNumber++;
    }
}

From source file:com.ephesoft.dcma.gwt.uploadbatch.client.presenter.UploadBatchPresenter.java

License:Open Source License

public void repaintFileList() {
    view.getAllFilesBox().clear();/*w  w  w  .java2  s  .  c  o  m*/
    view.getEditTable().removeAllRows();
    view.getDeleteCaptionPanel().setVisible(Boolean.FALSE);
    view.getSelectAllCell().clear();

    if (!view.getAllFileList().isEmpty()) {
        // view.formatRow(0);

        CheckBox deleteAllBox = new CheckBox();
        view.setDeleteAllBox(deleteAllBox);
        deleteAllBox.setStyleName("paddingSelectAll");
        deleteAllBox.addClickHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                boolean checked = ((CheckBox) event.getSource()).getValue();
                if (checked) {
                    // toggle all the checkboxes to select
                    view.toggleAllCheckBoxes(Boolean.TRUE);
                    view.getDeleteSelectedFileList().addAll(view.getAllFileList());
                } else {
                    // toggle all the checkboxes to deselect
                    view.toggleAllCheckBoxes(Boolean.FALSE);

                    view.getDeleteSelectedFileList().clear();
                }

            }
        });

        view.getSelectAllCell().add(deleteAllBox);
        deleteAllBox.setStyleName("paddingSelectAllLabel");
        Label label = new Label(LocaleDictionary.get().getConstantValue(UploadBatchConstants.SELECT_ALL));
        label.setWidth("25em");
        label.addStyleName("bold_text");
        view.getSelectAllCell().add(label);

        int row = 0;
        for (Iterator<String> fileListIterator = view.getAllFileList().iterator(); fileListIterator
                .hasNext();) {
            final String fileName = (String) fileListIterator.next();
            view.formatRow(row);

            CheckBox deleteBox = new CheckBox();
            view.getAllFilesBox().add(deleteBox);
            deleteBox.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {
                    boolean checked = ((CheckBox) event.getSource()).getValue();
                    if (checked) {
                        view.getDeleteSelectedFileList().add(fileName);
                    } else {
                        // uncheck the select all check box
                        view.getDeleteAllBox().setValue(Boolean.FALSE);

                        view.getDeleteSelectedFileList().remove(fileName);
                    }
                }
            });

            view.addWidget(row, 0, deleteBox);
            view.addWidget(row, 1, new Label(fileName));
            HTMLPanel progressPanel = new HTMLPanel("<span id=\"progressBar_" + row + "\"></span>");
            view.addWidget(row, 2, progressPanel);

            if (row != 0 || row < view.getAllFileList().size()) {
                String innerHTML = LocaleDictionary.get().getConstantValue(UploadBatchConstants.UPLOAD_PROGRESS)
                        + "100" + "%";
                DOM.getElementById("progressBar_" + row).setInnerHTML(innerHTML);
            }
            row++;
        }

        view.getDeleteCaptionPanel().setVisible(Boolean.TRUE);
    }
}

From source file:com.ephesoft.gxt.core.client.ui.service.columnConfig.impl.BatchClassColumnConfigService.java

License:Open Source License

public BatchClassColumnConfigService() {
    columnConfigList = new ArrayList<ColumnConfig<BatchClassDTO, ?>>();
    editorsMap = new HashMap<ColumnConfig, IsField>();
    ColumnConfig<BatchClassDTO, Boolean> modelSelector = new ColumnConfig<BatchClassDTO, Boolean>(
            BatchClassProperties.INSTANCE.selected());
    CheckBoxCell modelSelectionCell = new CheckBoxCell();
    modelSelector.setCell(modelSelectionCell);
    modelSelector.setWidth(35);//  w  ww . j  a v  a2s .c  o m
    modelSelector.setFixed(true);
    modelSelector.setSortable(false);
    modelSelector.setHideable(false);
    CheckBox checkbox = new CheckBox();
    checkbox.getElement().getStyle().setZIndex(1000);
    modelSelector.setHeader(SafeHtmlUtils.fromSafeConstant(checkbox.getElement().getInnerHTML()));
    ColumnConfig<BatchClassDTO, String> batchClassIdentifier = new ColumnConfig<BatchClassDTO, String>(
            BatchClassProperties.INSTANCE.identifier());
    batchClassIdentifier
            .setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.COLUMN_CONFIG_IDENTIFIER));
    ColumnConfig<BatchClassDTO, String> batchClassName = new ColumnConfig<BatchClassDTO, String>(
            BatchClassProperties.INSTANCE.name());
    batchClassName.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.COLUMN_CONFIG_NAME));
    ColumnConfig<BatchClassDTO, String> batchClassDescription = new ColumnConfig<BatchClassDTO, String>(
            BatchClassProperties.INSTANCE.description());
    batchClassDescription
            .setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.COLUMN_CONFIG_DESCRIPTION));
    ColumnConfig<BatchClassDTO, Integer> batchClassPriority = new ColumnConfig<BatchClassDTO, Integer>(
            BatchClassProperties.INSTANCE.priority());
    batchClassPriority.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.COLUMN_CONFIG_PRIORITY));
    ColumnConfig<BatchClassDTO, String> batchClassUnc = new ColumnConfig<BatchClassDTO, String>(
            BatchClassProperties.INSTANCE.uncFolder());
    batchClassUnc.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.BCC_UNC_PATH));
    ColumnConfig<BatchClassDTO, String> batchClassVersion = new ColumnConfig<BatchClassDTO, String>(
            BatchClassProperties.INSTANCE.version());
    batchClassVersion.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.BCC_VERSION));
    batchClassVersion.setSortable(false);
    ColumnConfig<BatchClassDTO, String> currentUser = new ColumnConfig<BatchClassDTO, String>(
            BatchClassProperties.INSTANCE.currentUser());
    currentUser.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.BCC_CURRENT_USER));
    ColumnConfig<BatchClassDTO, String> encryptionAlgorithm = new ColumnConfig<BatchClassDTO, String>(
            BatchClassProperties.INSTANCE.encryptionAlgo());
    encryptionAlgorithm.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.BCC_ENCRYPTION));
    encryptionAlgorithm.setSortable(false);

    ValueProvider<BatchClassDTO, String> rolesValueProvider = BatchClassRoleValueProvider.getInstance();
    ColumnConfig<BatchClassDTO, String> roles = new ColumnConfig<BatchClassDTO, String>(rolesValueProvider);

    roles.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.BCC_ROLES));
    roles.setSortable(false);
    columnConfigList.add(modelSelector);
    columnConfigList.add(batchClassIdentifier);
    columnConfigList.add(batchClassName);
    columnConfigList.add(batchClassDescription);
    columnConfigList.add(batchClassUnc);
    columnConfigList.add(batchClassVersion);
    columnConfigList.add(batchClassPriority);
    columnConfigList.add(currentUser);
    if (EphesoftUIContext.isWindows()) {
        columnConfigList.add(encryptionAlgorithm);
    }
    columnConfigList.add(roles);

    editorsMap.put(batchClassDescription, new TextField());
    editorsMap.put(batchClassPriority, new IntegerField());
    editorsMap.put(batchClassUnc, new TextField());
}

From source file:com.ephesoft.gxt.core.client.ui.service.columnConfig.impl.RegerGroupColumnConfigService.java

License:Open Source License

public RegerGroupColumnConfigService() {
    columnConfigList = new ArrayList<ColumnConfig<RegexGroupDTO, ?>>();
    editorsMap = new HashMap<ColumnConfig, IsField>();

    ColumnConfig<RegexGroupDTO, Boolean> modelSelector = new ColumnConfig<RegexGroupDTO, Boolean>(
            properties.selected());/*  w  w  w. j  a va2  s . com*/

    CheckBoxCell modelSelectionCell = new CheckBoxCell();
    modelSelector.setCell(modelSelectionCell);
    // modelSelector.setHeader("Select");
    CheckBox checkbox = new CheckBox();
    checkbox.getElement().getStyle().setZIndex(1000);
    modelSelector.setHeader(SafeHtmlUtils.fromSafeConstant(checkbox.getElement().getInnerHTML()));
    modelSelector.setWidth(30);
    modelSelector.setFixed(true);
    modelSelector.setSortable(false);
    modelSelector.setHideable(false);

    ColumnConfig<RegexGroupDTO, String> regexGroupName = new ColumnConfig<RegexGroupDTO, String>(
            properties.name());
    regexGroupName.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.REGEX_GROUP_NAME_HEADER));

    // ColumnConfig<RegexGroupDTO, Double> progressCell = new ColumnConfig<RegexGroupDTO, Double>(
    // properties.progress());
    // ProgressBarCell modelProgressCell = new ProgressBarCell();
    // modelProgressCell.setProgressText("{0}%");
    // modelProgressCell.setWidth(progressCell.getWidth());
    // progressCell.setCell(modelProgressCell);
    // progressCell.setHeader("Progress");
    // progressCell.setSortable(false);

    columnConfigList.add(modelSelector);
    columnConfigList.add(regexGroupName);
    // columnConfigList.add(progressCell);

    editorsMap.put(regexGroupName, new TextField());
}

From source file:com.ephesoft.gxt.core.client.ui.service.columnConfig.impl.RegerPatternColumnConfigService.java

License:Open Source License

public RegerPatternColumnConfigService() {
    columnConfigList = new ArrayList<ColumnConfig<RegexPatternDTO, ?>>();
    editorsMap = new HashMap<ColumnConfig, IsField>();

    ColumnConfig<RegexPatternDTO, Boolean> modelSelector = new ColumnConfig<RegexPatternDTO, Boolean>(
            properties.selected());/*from w ww .j ava  2  s  . c om*/

    CheckBoxCell modelSelectionCell = new CheckBoxCell();
    modelSelector.setCell(modelSelectionCell);
    // modelSelector.setHeader("Select");
    CheckBox checkbox = new CheckBox();
    checkbox.getElement().getStyle().setZIndex(1000);
    modelSelector.setHeader(SafeHtmlUtils.fromSafeConstant(checkbox.getElement().getInnerHTML()));
    modelSelector.setWidth(30);
    modelSelector.setFixed(true);
    modelSelector.setSortable(false);
    modelSelector.setHideable(false);

    ColumnConfig<RegexPatternDTO, String> regexPattern = new ColumnConfig<RegexPatternDTO, String>(
            properties.pattern());
    regexPattern.setHeader(LocaleDictionary.getConstantValue(CoreCommonConstants.REGEX_PATTERN_COLUMN_HEADER));

    ColumnConfig<RegexPatternDTO, String> regexPatternDescription = new ColumnConfig<RegexPatternDTO, String>(
            properties.description());
    regexPatternDescription.setHeader(
            LocaleDictionary.getConstantValue(CoreCommonConstants.REGEX_PATTERN_DESCRIPTION_COLUMN_HEADER));

    // ColumnConfig<RegexPatternDTO, Double> progressCell = new ColumnConfig<RegexPatternDTO, Double>(
    // properties.progress());
    // ProgressBarCell modelProgressCell = new ProgressBarCell();
    // modelProgressCell.setProgressText("{0}%");
    // modelProgressCell.setWidth(progressCell.getWidth());
    // progressCell.setCell(modelProgressCell);
    // progressCell.setHeader("Progress");
    // progressCell.setSortable(false);

    columnConfigList.add(modelSelector);
    columnConfigList.add(regexPattern);
    columnConfigList.add(regexPatternDescription);
    // columnConfigList.add(progressCell);

    editorsMap.put(regexPattern, new TextField());
    editorsMap.put(regexPatternDescription, new TextField());
}

From source file:com.flatown.client.ChameleonBox.java

License:Apache License

/** Instantiates the checkbox that controls whether or not results are displayed */
private void createDisplayResultsCheckbox() {
    _displayResults = new CheckBox();
    _displayResults.setChecked(true);//from   ww w.  j  av  a  2s.c  om
    _displayResults.setVisible(false);
    _displayResults.setStyleName("leftFloat");
    _displayResults.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            _resultsbox.setVisible(areResultsDisplayed());
            GBox.Prefs.saveFavorites();
        }
    });
}