actionColumn.setFieldUpdater( new FieldUpdater<ApplicationEventMapDto, ApplicationEventAction>() { @Override
private com.google.gwt.user.cellview.client.Column initDescriptionColumn() { // start time com.google.gwt.user.cellview.client.Column<DataGridFilterSummary, String> descriptionColumn = new com.google.gwt.user.cellview.client.Column<DataGridFilterSummary, String>(new TextCell()) { @Override public String getValue(DataGridFilterSummary object) { return object.getFilterName(); } }; descriptionColumn.setSortable(true); descriptionColumn.setDataStoreName("log.filterName"); return descriptionColumn; }
private boolean isColumnAdded( List<ColumnMeta<ProcessInstanceSummary>> columnMetas, String caption ) { if ( caption != null ) { for ( ColumnMeta<ProcessInstanceSummary> colMet : columnMetas ) { if ( caption.equals( colMet.getColumn().getDataStoreName() ) ) { return true; } } } return false; }
public GwtColumnConfigImp(@Nonnull final ValueProvider<M, C> valueProvider, final Cell<C> cell, final double width, final Unit widthUnit, final SafeHtml header, final boolean sortable, @Nullable final FieldUpdater<M, C> action) { this.valueProvider = valueProvider; this.width = width; this.widthUnit = widthUnit; this.header = header; column = new Column<M, C>(cell) { @Override public C getValue(final M rowObject) { return valueProvider.getValue(rowObject); } @Override public String getDataStoreName() { return valueProvider.getPath(); } }; column.setSortable(sortable); if (action != null) { column.setFieldUpdater(action); } }
private void addColumn(final com.google.gwt.user.cellview.client.Column<Map.Entry<String, String>, String> column, final int columnIndex, final String header, final boolean isSortable, final int width) { column.setSortable(isSortable); column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); grid.addColumn(column, header); grid.setColumnWidth(column, width, Style.Unit.PCT); column.setFieldUpdater(new FieldUpdater<Map.Entry<String, String>, String>() { @Override public void update(final int index, final Map.Entry<String, String> object, final String value) { presenter.update(columnIndex, index, object, value); } }); }
private void addParamValueColumn() { final Column<TemplateParam, String> column = new Column<TemplateParam, String>(new EditTextCell()) { @Override public String getValue(TemplateParam templateParam) { if (templateParam.getValue() != null) { return templateParam.getValue(); } else { return EMPTY_STRING; } } }; column.setFieldUpdater(new ParamValueFieldUpdater((EditTextCell) column.getCell())); dataGrid.addColumn(column, translationService.getTranslation(TemplateParamsTableView_ParamValueColumn)); dataGrid.setColumnWidth(column, 55, Style.Unit.PCT); }
@Override public Void answer(InvocationOnMock invocationOnMock) throws Throwable { final List<ColumnMeta> columns = (List<ColumnMeta>) invocationOnMock.getArguments()[0]; for (ColumnMeta columnMeta : columns) { if (ProcessVariableListViewImpl.COL_ID_ACTIONS.equals(columnMeta.getColumn().getDataStoreName())) { assertTrue(columnMeta.getColumn().getCell() instanceof CompositeCell); } if (ProcessVariableListViewImpl.COL_ID_VARVALUE.equals(columnMeta.getColumn().getDataStoreName())) { assertTrue(columnMeta.getColumn().getCell() instanceof PopoverTextCell); } } return null; } }).when(currentListGrid).addColumns(anyList());
/** * Render the object into the cell. * * @param context the cell context * @param object the object to render * @param sb the buffer to render into */ public void render(Context context, T object, SafeHtmlBuilder sb) { cell.render(context, getValue(object), sb); }
Set<String> cellEvents = col.getCell().getConsumedEvents(); if (cellEvents != null) { consumedEvents.addAll(cellEvents);
protected com.google.gwt.user.cellview.client.Column<Entry<String, String>, String> createAttributeNameColumn(ColumnSortEvent.ListHandler<Entry<String, String>> sortHandler) { // Attribute name. final Cell<String> nameCell = canManageAttributes() ? new EditTextCell() : new TextCell(); final com.google.gwt.user.cellview.client.Column<Entry<String, String>, String> keyColumn = new com.google.gwt.user.cellview.client.Column<Entry<String, String>, String>( nameCell) { @Override public String getValue(final Entry<String, String> object) { return object.getKey() != null ? object.getKey() : ""; } }; keyColumn.setSortable(true); sortHandler.setComparator(keyColumn, new Comparator<Entry<String, String>>() { @Override public int compare(Entry<String, String> o1, Entry<String, String> o2) { return o1.getKey().compareTo(o2.getKey()); } }); keyColumn.setFieldUpdater(canManageAttributes() ? keyModifiedEventHandler : null); return keyColumn; }
private void addColumn(final com.google.gwt.user.cellview.client.Column<Map.Entry<String, String>, String> column, final int columnIndex, final String header, final boolean isSortable, final int width) { column.setSortable(isSortable); column.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); grid.addColumn(column, header); grid.setColumnWidth(column, width, Style.Unit.PCT); column.setFieldUpdater(new FieldUpdater<Map.Entry<String, String>, String>() { @Override public void update(final int index, final Map.Entry<String, String> object, final String value) { presenter.update(columnIndex, index, object, value); } }); }
@Override public Void answer( InvocationOnMock invocationOnMock ) throws Throwable { final List<ColumnMeta> columns = (List<ColumnMeta>) invocationOnMock.getArguments()[ 0 ]; for ( ColumnMeta columnMeta : columns ) { if(ProcessVariableListViewImpl.COL_ID_ACTIONS.equals(columnMeta.getColumn().getDataStoreName())){ assertTrue( columnMeta.getColumn().getCell() instanceof CompositeCell); } if(ProcessVariableListViewImpl.COL_ID_VARVALUE.equals(columnMeta.getColumn().getDataStoreName())){ assertTrue(columnMeta.getColumn().getCell() instanceof PopoverTextCell ); } } return null; } } ).when( currentListGrid ).addColumns(anyList());
/** * Handle a browser event that took place within the column. * * @param context the cell context * @param elem the parent Element * @param object the base object to be updated * @param event the native browser event */ public void onBrowserEvent(Context context, Element elem, final T object, NativeEvent event) { final int index = context.getIndex(); ValueUpdater<C> valueUpdater = (fieldUpdater == null) ? null : new ValueUpdater<C>() { @Override public void update(C value) { fieldUpdater.update(index, object, value); } }; cell.onBrowserEvent(context, elem, getValue(object), event, valueUpdater); }
public Cell<C> getCell() { return (Cell<C>) super.getCell(); }
private Column initProcessNameColumn() { // Process Instance Id. Column<ProcessInstanceVariableSummary, String> processNameColumn = new Column<ProcessInstanceVariableSummary, String>( new TextCell() ) { @Override public String getValue( ProcessInstanceVariableSummary object ) { return String.valueOf( object.getProcessName() ); } }; processNameColumn.setSortable( true ); processNameColumn.setDataStoreName( PROCESS_NAME ); return processNameColumn; }
private Column<ItemObjectModel, String> setUpResolverColumn() { ArrayList<String> options = new ArrayList<String>(); options.add( "----" ); options.add( ItemObjectModel.REFLECTION_RESOLVER ); options.add( ItemObjectModel.MVEL_RESOLVER ); Column<ItemObjectModel, String> column = new Column<ItemObjectModel, String>( new SelectionCell( options ) ) { @Override public String getValue( ItemObjectModel input ) { if ( input.getResolver() == null ) { return "----"; } else { return input.getResolver(); } } }; column.setFieldUpdater( new FieldUpdater<ItemObjectModel, String>() { @Override public void update( int index, ItemObjectModel model, String value ) { model.setResolver( value ); } } ); return column; }
protected com.google.gwt.user.cellview.client.Column<Entry<String, String>, String> createAttributeNameColumn(ColumnSortEvent.ListHandler<Entry<String, String>> sortHandler) { // Attribute name. final Cell<String> nameCell = canManageAttributes() ? new EditTextCell() : new TextCell(); final com.google.gwt.user.cellview.client.Column<Entry<String, String>, String> keyColumn = new com.google.gwt.user.cellview.client.Column<Entry<String, String>, String>( nameCell) { @Override public String getValue(final Entry<String, String> object) { return object.getKey() != null ? object.getKey() : ""; } }; keyColumn.setSortable(true); sortHandler.setComparator(keyColumn, new Comparator<Entry<String, String>>() { @Override public int compare(Entry<String, String> o1, Entry<String, String> o2) { return o1.getKey().compareTo(o2.getKey()); } }); keyColumn.setFieldUpdater(canManageAttributes() ? keyModifiedEventHandler : null); return keyColumn; }
protected boolean isColumnAdded(List<ColumnMeta<T>> columnMetas, String caption) { if (caption != null) { for (ColumnMeta<T> colMet : columnMetas) { if (caption.equals(colMet.getColumn().getDataStoreName())) { return true; } } } return false; }
int count = 0; for(Column column : columns){ if(column != null && column.getValue() != null){ count++; } }
public void onColumnSort( ColumnSortEvent event ) { lastOrderedColumn = ((DataColumnCell) event.getColumn().getCell()).columnId; lastSortOrder = event.isSortAscending() ? SortOrder.ASCENDING : SortOrder.DESCENDING; redraw(); } });