Mercurial > hg > STI-GWT
comparison src/econnect/wp3_3/client/widgets/table/DynamicStiTable.java @ 69:ea856995abac trimmed_data
Allow HTML in Description field
author | Sebastian Kruse <skruse@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 10 Jan 2013 13:20:42 +0100 |
parents | 8b58d9bc0bb6 |
children | a610b45d0f90 |
comparison
equal
deleted
inserted
replaced
68:8b58d9bc0bb6 | 69:ea856995abac |
---|---|
2 | 2 |
3 import java.util.ArrayList; | 3 import java.util.ArrayList; |
4 import java.util.Comparator; | 4 import java.util.Comparator; |
5 import java.util.List; | 5 import java.util.List; |
6 | 6 |
7 import com.google.gwt.safehtml.shared.SafeHtml; | |
8 import com.google.gwt.safehtml.shared.SafeHtmlBuilder; | |
7 import com.google.gwt.user.cellview.client.CellTable; | 9 import com.google.gwt.user.cellview.client.CellTable; |
10 import com.google.gwt.user.cellview.client.Column; | |
8 import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; | 11 import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler; |
9 import com.google.gwt.user.cellview.client.SimplePager; | 12 import com.google.gwt.user.cellview.client.SimplePager; |
10 import com.google.gwt.user.cellview.client.TextColumn; | 13 import com.google.gwt.user.cellview.client.TextColumn; |
11 import com.google.gwt.user.client.rpc.AsyncCallback; | 14 import com.google.gwt.user.client.rpc.AsyncCallback; |
12 import com.google.gwt.user.client.ui.Anchor; | 15 import com.google.gwt.user.client.ui.Anchor; |
22 import com.google.gwt.view.client.CellPreviewEvent; | 25 import com.google.gwt.view.client.CellPreviewEvent; |
23 import com.google.gwt.view.client.CellPreviewEvent.Handler; | 26 import com.google.gwt.view.client.CellPreviewEvent.Handler; |
24 import com.google.gwt.view.client.ListDataProvider; | 27 import com.google.gwt.view.client.ListDataProvider; |
25 import com.google.gwt.view.client.Range; | 28 import com.google.gwt.view.client.Range; |
26 import com.google.gwt.view.client.RangeChangeEvent; | 29 import com.google.gwt.view.client.RangeChangeEvent; |
30 import com.google.gwt.cell.client.SafeHtmlCell; | |
27 import com.google.gwt.core.client.GWT; | 31 import com.google.gwt.core.client.GWT; |
28 import com.google.gwt.core.client.JsArrayString; | 32 import com.google.gwt.core.client.JsArrayString; |
29 import com.google.gwt.dom.client.NodeList; | 33 import com.google.gwt.dom.client.NodeList; |
30 import com.google.gwt.dom.client.Style.BorderStyle; | 34 import com.google.gwt.dom.client.Style.BorderStyle; |
31 import com.google.gwt.dom.client.Style.Unit; | 35 import com.google.gwt.dom.client.Style.Unit; |
293 } | 297 } |
294 }; | 298 }; |
295 placeColumn.setSortable(true); | 299 placeColumn.setSortable(true); |
296 this.elementsTable.addColumn(placeColumn, "Place"); | 300 this.elementsTable.addColumn(placeColumn, "Place"); |
297 | 301 |
298 TextColumn<DataObject> descriptionColumn = new TextColumn<DataObject>() { | 302 SafeHtmlCell descriptionCell = new SafeHtmlCell(); |
303 | |
304 Column<DataObject, SafeHtml> descriptionColumn = new Column<DataObject, SafeHtml>(descriptionCell) { | |
299 @Override | 305 @Override |
300 public String getValue(DataObject object) { | 306 public SafeHtml getValue(DataObject object) { |
301 return object.getDescription(); | 307 SafeHtmlBuilder sb = new SafeHtmlBuilder(); |
308 sb.appendHtmlConstant(object.getDescription()); | |
309 return sb.toSafeHtml(); | |
302 } | 310 } |
303 }; | 311 }; |
304 descriptionColumn.setSortable(true); | 312 descriptionColumn.setSortable(true); |
305 this.elementsTable.addColumn(descriptionColumn, "Description"); | 313 this.elementsTable.addColumn(descriptionColumn, "Description"); |
306 | 314 |