List of usage examples for com.google.gwt.cell.client SafeImageCell SafeImageCell
public SafeImageCell()
From source file:com.dawg6.gwt.client.widgets.ItemIconCell.java
License:Open Source License
public ItemIconCell() { super(new SafeImageCell()); }
From source file:stroom.explorer.client.presenter.TypeFilterPresenter.java
License:Apache License
@Inject public TypeFilterPresenter(final EventBus eventBus) { super(eventBus, new CellTableViewImpl<DocumentType>(false, (Resources) GWT.create(BasicResources.class))); this.eventBus = eventBus; // Checked.// ww w .j ava2s . com final Column<DocumentType, TickBoxState> checkedColumn = new Column<DocumentType, TickBoxState>( new TickBoxCell(false, true)) { @Override public TickBoxState getValue(final DocumentType object) { return TickBoxState.fromBoolean(selected.contains(object.getType())); } }; checkedColumn.setFieldUpdater(new FieldUpdater<DocumentType, TickBoxState>() { @Override public void update(final int index, final DocumentType object, final TickBoxState value) { if (selected.contains(object.getType())) { selected.remove(object.getType()); } else { selected.add(object.getType()); } DataSelectionEvent.fire(TypeFilterPresenter.this, TypeFilterPresenter.this, false); } }); getView().addColumn(checkedColumn); // Icon. final Column<DocumentType, SafeUri> iconColumn = new Column<DocumentType, SafeUri>(new SafeImageCell()) { @Override public SafeUri getValue(final DocumentType object) { return UriUtils.fromString(ImageUtil.getImageURL() + object.getIconUrl()); } }; getView().addColumn(iconColumn); // Text. final Column<DocumentType, String> textColumn = new Column<DocumentType, String>(new TextCell()) { @Override public String getValue(final DocumentType object) { return object.getType(); } }; getView().addColumn(textColumn); final Style style = getView().asWidget().getElement().getStyle(); style.setPaddingLeft(1, Unit.PX); style.setPaddingRight(3, Unit.PX); style.setPaddingTop(2, Unit.PX); style.setPaddingBottom(1, Unit.PX); }