Example usage for com.google.gwt.user.cellview.client Column setCellStyleNames

List of usage examples for com.google.gwt.user.cellview.client Column setCellStyleNames

Introduction

In this page you can find the example usage for com.google.gwt.user.cellview.client Column setCellStyleNames.

Prototype

public void setCellStyleNames(String styleNames) 

Source Link

Document

Set extra style names that should be applied to every cell.

Usage

From source file:org.eclipse.kura.web.client.ui.Status.StatusPanelUi.java

License:Open Source License

public void loadStatusTable(CellTable<GwtGroupedNVPair> grid, ListDataProvider<GwtGroupedNVPair> dataProvider) {
    TextColumn<GwtGroupedNVPair> col1 = new TextColumn<GwtGroupedNVPair>() {

        @Override// w  w  w.  j  a  v  a  2 s.c o  m
        public String getValue(GwtGroupedNVPair object) {
            return String.valueOf(object.getName());
        }
    };
    col1.setCellStyleNames("status-table-row");
    grid.addColumn(col1);

    Column<GwtGroupedNVPair, SafeHtml> col2 = new Column<GwtGroupedNVPair, SafeHtml>(new SafeHtmlCell()) {

        @Override
        public SafeHtml getValue(GwtGroupedNVPair object) {
            return SafeHtmlUtils.fromTrustedString(String.valueOf(object.getValue()));
        }
    };

    col2.setCellStyleNames("status-table-row");
    grid.addColumn(col2);
    dataProvider.addDataDisplay(grid);
}

From source file:org.obiba.opal.web.gwt.app.client.magma.derive.view.DeriveCategoricalVariableStepView.java

License:Open Source License

private void initializeValueMapGrid() {
    valuesMapGrid = new ValueMapGrid() {
        @Override//  ww  w .  j  av  a 2 s  .  c  o m
        protected void initializeValueColumn() {
            ValueMapCell cell = new ValueMapCell() {

                @Override
                protected String getText(ValueMapEntry entry) {
                    return entry.getValue();
                }

                @Override
                public void render(Cell.Context context, ValueMapEntry entry, SafeHtmlBuilder sb) {
                    if (entry != null) {
                        String cssClasses = getCssClasses(entry.getType());
                        SafeHtml safeHtml = SafeHtmlUtils.fromString(getText(entry));
                        if (entry.getType() == ValueMapEntryType.DISTINCT_VALUE) {
                            sb.append(DeriveCategoricalVariableStepView.template.spanWithTile(
                                    cssClasses + " warning", translations.valueIsNotACategory(), safeHtml));
                        } else {
                            sb.append(template.span(cssClasses, safeHtml));
                        }
                    }
                }
            };

            // Value
            Column<ValueMapEntry, ValueMapEntry> valueColumn = new Column<ValueMapEntry, ValueMapEntry>(cell) {

                @Override
                public ValueMapEntry getValue(ValueMapEntry entry) {
                    return entry;
                }

            };
            valueColumn.setCellStyleNames("original-value");
            table.addColumn(valueColumn, translations.originalValueLabel());
        }
    };
    valuesMapGrid.setWidth("100%");
    valuesMapGrid.setPageSize(100);
}

From source file:org.obiba.opal.web.gwt.app.client.magma.derive.view.ValueMapGrid.java

License:Open Source License

protected void initializeValueColumn() {

    ValueMapCell cell = new ValueMapCell() {

        @Override/*from  www. j ava2 s  .c  o  m*/
        protected String getText(ValueMapEntry entry) {
            return entry.getValue();
        }
    };

    Column<ValueMapEntry, ValueMapEntry> valueColumn = new ValueMapColumn(cell);
    valueColumn.setCellStyleNames("original-value");
    table.addColumn(valueColumn, translations.originalValueLabel());
}

From source file:org.obiba.opal.web.gwt.app.client.magma.derive.view.ValueMapGrid.java

License:Open Source License

private void initializeLabelColumn() {

    ValueMapCell cell = new ValueMapCell() {

        @Override// w  w  w.j a v a 2 s.  c  o m
        protected String getText(ValueMapEntry entry) {
            return entry.getLabel();
        }
    };

    Column<ValueMapEntry, ValueMapEntry> labelColumn = new ValueMapColumn(cell);
    labelColumn.setCellStyleNames("original-label");
    table.addColumn(labelColumn, translations.originalLabelLabel());
}

From source file:org.obiba.opal.web.gwt.app.client.magma.derive.view.ValueMapGrid.java

License:Open Source License

private void initializeNewValueColumn() {

    // New Value//from ww w  .  j a  va 2 s  . c om
    Cell<String> cell = hasValueChoices() ? new SelectionCell(valueChoices) : new TextInputCell();
    Column<ValueMapEntry, String> newValueColumn = new Column<ValueMapEntry, String>(cell) {
        @Override
        public String getValue(ValueMapEntry entry) {
            return entry.getNewValue();
        }
    };
    newValueColumn.setCellStyleNames("new-value");
    table.addColumn(newValueColumn, translations.newValueLabel());
    table.setColumnWidth(newValueColumn, "10em");
    newValueColumn.setFieldUpdater(new FieldUpdater<ValueMapEntry, String>() {
        @Override
        public void update(int index, ValueMapEntry entry, String value) {
            entry.setNewValue(value);
        }
    });
}

From source file:org.obiba.opal.web.gwt.app.client.magma.derive.view.ValueMapGrid.java

License:Open Source License

private void initializeMissingColumn() {
    // Missing//from w w w . jav  a 2s .c o  m
    Column<ValueMapEntry, Boolean> missingColumn = new Column<ValueMapEntry, Boolean>(new CheckboxCell()) {

        @Override
        public Boolean getValue(ValueMapEntry entry) {
            return entry.isMissing();
        }
    };
    missingColumn.setCellStyleNames("new-missing");
    table.addColumn(missingColumn, translations.missingLabel());
    missingColumn.setFieldUpdater(new FieldUpdater<ValueMapEntry, Boolean>() {
        @Override
        public void update(int index, ValueMapEntry entry, Boolean value) {
            entry.setMissing(value);
        }
    });
}

From source file:org.openremote.app.client.widget.FormTable.java

License:Open Source License

protected void applyStyleCellText(Column column) {
    column.setCellStyleNames(widgetStyle.FormTableCellText());
}

From source file:org.roda.wui.client.common.lists.utils.AsyncTableCell.java

protected void addColumn(Column<T, ?> column, SafeHtml headerHTML, boolean nowrap, boolean alignRight) {
    SafeHtmlHeader header = new SafeHtmlHeader(headerHTML);
    display.addColumn(column, header);//from  w  w  w  . ja va2  s.c o m

    if (nowrap && alignRight) {
        header.setHeaderStyleNames("nowrap text-align-right");
        column.setCellStyleNames("nowrap text-align-right");
    } else if (nowrap) {
        header.setHeaderStyleNames("cellTableFadeOut");
        column.setCellStyleNames("cellTableFadeOut");
    }
}

From source file:uk.ac.ebi.fg.annotare2.web.gwt.editor.client.view.experiment.design.DataAssignmentViewImpl.java

License:Apache License

private void addDataFileColumn(final int columnIndex, String columnName) {
    Column<DataAssignmentRow, String> column = new Column<DataAssignmentRow, String>(
            new DynSelectionCell<String>(new DynSelectionCell.ListProvider<String>() {
                @Override//from  w w w. j  a  va  2 s . com
                public List<DynSelectionCell.Option<String>> getOptions() {
                    return dataAssignment.getOptions(columns.get(columnIndex));
                }

                @Override
                public DynSelectionCell.Option<String> getDefault() {
                    return new DynSelectionCell.Option<String>() {
                        @Override
                        public String getValue() {
                            return NONE;
                        }

                        @Override
                        public String getText() {
                            return NONE;
                        }
                    };
                }
            })) {
        @Override
        public String getValue(DataAssignmentRow row) {
            FileRef file = columns.get(columnIndex).getFileRef(row);
            return null == file ? NONE : file.getName();
        }
    };
    column.setCellStyleNames("app-SelectionCell");
    column.setFieldUpdater(new FieldUpdater<DataAssignmentRow, String>() {
        @Override
        public void update(int index, DataAssignmentRow row, String value) {
            columns.get(columnIndex).setFileRef(row,
                    NONE.equals(value) ? null : dataAssignment.getFileRef(value));
            dataAssignment.update(columns.get(columnIndex));
            updateColumn(columns.get(columnIndex));
            gridView.redraw();
        }
    });
    gridView.addColumn(columnName, column, null, 200, Style.Unit.PX);
}

From source file:uk.ac.ebi.fg.annotare2.web.gwt.editor.client.view.experiment.design.ExtractAttributesViewImpl.java

License:Apache License

private void addColumn(final ExtractAttribute attr) {
    Cell<String> cell = attr.hasOptions() ? new SelectionCell(attr.getOptions()) : new EditTextCell();
    Column<ExtractAttributesRow, String> column = new Column<ExtractAttributesRow, String>(cell) {
        @Override/*from  ww w  .  jav  a2 s  . c om*/
        public String getValue(ExtractAttributesRow row) {
            String value = row.getValue(attr);
            return value == null ? "" : attr.hasOptions() ? attr.getOption(value) : value;
        }
    };
    column.setCellStyleNames("app-SelectionCell");
    column.setFieldUpdater(new FieldUpdater<ExtractAttributesRow, String>() {
        @Override
        public void update(int index, ExtractAttributesRow row, String value) {
            row.setValue(attr.hasOptions() ? attr.getValue(value) : value, attr);
            if (LIBRARY_LAYOUT.equals(attr) && !isPairedLayout(value)) {
                row.setValue("", NOMINAL_LENGTH);
                row.setValue("", NOMINAL_SDEV);
                row.setValue("", ORIENTATION);
            }
            updateRow(row);
        }
    });
    gridView.addPermanentColumn(attr.getTitle(), column, null, 150, Style.Unit.PX);
}