litesoft
@ 948
litesoft / trunk / GWT_Sandbox / FormEngine / src / com / temp / client / foundation / widget / table / column / ClickableTextListDataColumn.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
package com.temp.client.foundation.widget.table.column; import com.google.gwt.user.cellview.client.*; import com.temp.client.foundation.handler.*; import com.temp.client.foundation.widget.table.*; import com.temp.client.foundation.widget.table.cell.*; import com.temp.shared.utils.*; import java.util.*; /** * A column of clickable text lists. The cell data consists of Lists of objects of type E * and each element of the list is clickable * * @param <R> - the row type (e.g. Message) * @param <L> - the type of the list (e.g. ArrayList of MessageErrors) * @param <E> - the type of the list element (e.g. MessageError) * * @author paule */ @SuppressWarnings("rawtypes") public class ClickableTextListDataColumn<R extends DataRow, L extends List<E>, E> extends Column<R, L> implements DataColumn { public static interface GetElementDisplayStringFn<E> { String getDisplayString( E element ); } Object field; public ClickableTextListDataColumn( Object field, DataClickHandler<E> clickHandler, DisplayStringHandler<E> displayStringHandler ) { super( new ClickableTextListDataCell<E, L>( clickHandler, displayStringHandler ) ); this.field = field; } @SuppressWarnings("unchecked") @Override public L getValue( R rowData ) { return (L) rowData.getFieldValue( field ); } @Override public String getFieldString() { return field.toString(); } } |