Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widgetx@91633 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-14 15:29:49 +00:00 committed by Giancarlo Panichi
parent b9ae9f564b
commit ae21165fab
13 changed files with 235 additions and 95 deletions

View File

@ -2,11 +2,11 @@ eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<installed facet="jst.utility" version="1.0"/>
<installed facet="java" version="1.5"/>
<installed facet="java" version="1.7"/>
</faceted-project>

View File

@ -43,6 +43,7 @@ import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.http.client.RequestBuilder;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.core.client.Style.SelectionMode;
import com.sencha.gxt.core.client.resources.ThemeStyles;
import com.sencha.gxt.core.client.util.Margins;
@ -60,6 +61,7 @@ import com.sencha.gxt.widget.core.client.event.HeaderContextMenuEvent.HeaderCont
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid;
import com.sencha.gxt.widget.core.client.grid.GridViewConfig;
import com.sencha.gxt.widget.core.client.grid.LiveGridView;
import com.sencha.gxt.widget.core.client.grid.LiveToolItem;
import com.sencha.gxt.widget.core.client.menu.Item;
@ -269,7 +271,7 @@ public class TabularDataXGridPanel extends ContentPanel {
Collections.sort(columns, new ColumnPositionComparator(false));
for (ColumnDefinition columnDefinition : columns) {
if (columnDefinition.getType() == ColumnType.USER)
if (columnDefinition.getType() != ColumnType.SYSTEM)
columnsConfig.add(ColumnConfigGenerator
.generateConfiguration(columnDefinition));
}
@ -303,6 +305,7 @@ public class TabularDataXGridPanel extends ContentPanel {
liveGridView = new ExtendedLiveGridView();
liveGridView.setRowHeight(21);
grid = new Grid<DataRow>(store, columnModel);
grid.setLoadMask(true);
grid.setLoader(loader);

View File

@ -4,6 +4,7 @@
package org.gcube.portlets.user.tdwx.client.config;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.gcube.portlets.user.tdwx.shared.model.ColumnDefinition;
@ -27,10 +28,12 @@ public class TabularDataGridViewConfig implements GridViewConfig<DataRow> {
protected RowStyleProvider rowStyleProvider;
protected Row row;
protected TableDefinition definition;
public TabularDataGridViewConfig(TableViewConfig config, TableDefinition definition)
{
this.rowStyleProvider = config.getRowStyleProvider();
this.definition=definition;
Map<String, ColumnKey> keys = new HashMap<String, ColumnKey>();
for (ColumnDefinition column:definition.getColumnsAsList()) keys.put(column.getLabel(), column.getKey());

View File

@ -0,0 +1,25 @@
package org.gcube.portlets.user.tdwx.client.config;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ValidationRowStyleProvider implements RowStyleProvider {
@Override
public String getRowStyle(Row row) {
/*
Collection<ColumnKey> keys=row.keys.values();
DataRow r=row.dataRow;
for(ColumnKey k:keys){
Object b = r.get(k);
}
*/
return null;
}
}

View File

@ -6,6 +6,8 @@ package org.gcube.portlets.user.tdwx.client.model.grid;
import org.gcube.portlets.user.tdwx.shared.model.ColumnDefinition;
import org.gcube.portlets.user.tdwx.shared.model.DataRow;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.Cell;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
/**
@ -30,4 +32,14 @@ public class DataRowColumnConfig<N> extends ColumnConfig<DataRow, N> {
public ColumnDefinition getDefinition() {
return definition;
}
@SuppressWarnings("unchecked")
public void setCell(AbstractCell<Boolean> cell) {
Cell<N> cell2 = (Cell<N>) cell;
super.setCell(cell2);
}
public Cell<N> getCell() {
return super.getCell();
}
}

View File

@ -7,11 +7,11 @@ import java.util.Date;
import org.gcube.portlets.user.tdwx.client.model.grid.DataRowColumnConfig;
import org.gcube.portlets.user.tdwx.shared.model.ColumnDefinition;
import org.gcube.portlets.user.tdwx.shared.model.ColumnType;
import org.gcube.portlets.user.tdwx.shared.model.DataRow;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.google.gwt.user.client.ui.HTML;
import com.sencha.gxt.widget.core.client.form.CheckBox;
import com.sencha.gxt.widget.core.client.form.DateField;
import com.sencha.gxt.widget.core.client.form.NumberField;
@ -22,75 +22,158 @@ import com.sencha.gxt.widget.core.client.grid.editing.AbstractGridEditing;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ColumnConfigGenerator {
public static DataRowColumnConfig<?> generateConfiguration(ColumnDefinition columnDefinition)
{
public static DataRowColumnConfig<?> generateConfiguration(
ColumnDefinition columnDefinition) {
DataRowColumnConfig<?> columnConfig = null;
switch (columnDefinition.getValueType()) {
case BOOLEAN: columnConfig = ColumnConfigGenerator.<Boolean>create(columnDefinition); break;
case DATE: columnConfig = ColumnConfigGenerator.<Date>create(columnDefinition); break;
case DOUBLE: columnConfig = ColumnConfigGenerator.<Double>create(columnDefinition); break;
case FLOAT: columnConfig = ColumnConfigGenerator.<Float>create(columnDefinition); break;
case INTEGER: columnConfig = ColumnConfigGenerator.<Integer>create(columnDefinition); break;
case LONG: columnConfig = ColumnConfigGenerator.<Long>create(columnDefinition); break;
case STRING: {
case BOOLEAN:
columnConfig = ColumnConfigGenerator
.<Boolean> create(columnDefinition);
if (columnDefinition.getType() == ColumnType.VALIDATION) {
columnConfig.setCell(new AbstractCell<Boolean>(){
columnConfig = ColumnConfigGenerator.<String>create(columnDefinition);
/*column.setCell(new SimpleSafeHtmlCell<String>(new AbstractSafeHtmlRenderer<String>() {
@Override
public SafeHtml render(String object) {
return SafeHtmlUtils.fromString(object);
public void render(Context context, Boolean value,
SafeHtmlBuilder sb) {
String style = "style='color: " + (value ? "green" : "red")
+ "'";
String v = String.valueOf(value);
sb.appendHtmlConstant("<span " + style
+ " qtitle='Change' qtip='" + v + "'>" + v
+ "</span>");
}
})
);*/
});
}
break;
case DATE:
columnConfig = ColumnConfigGenerator
.<Date> create(columnDefinition);
break;
case DOUBLE:
columnConfig = ColumnConfigGenerator
.<Double> create(columnDefinition);
break;
case FLOAT:
columnConfig = ColumnConfigGenerator
.<Float> create(columnDefinition);
break;
case INTEGER:
columnConfig = ColumnConfigGenerator
.<Integer> create(columnDefinition);
break;
case LONG:
columnConfig = ColumnConfigGenerator
.<Long> create(columnDefinition);
break;
case STRING: {
columnConfig = ColumnConfigGenerator
.<String> create(columnDefinition);
/*
* column.setCell(new SimpleSafeHtmlCell<String>(new
* AbstractSafeHtmlRenderer<String>() {
*
* @Override public SafeHtml render(String object) { return
* SafeHtmlUtils.fromString(object); } }) );
*/
} break;
default: return null;
}
break;
default:
return null;
}
columnConfig.setHidden(!columnDefinition.isVisible());
SafeHtmlBuilder tooltipMessage= new SafeHtmlBuilder();
tooltipMessage.appendHtmlConstant("<p align='Left'><bold style='font-weight:bold;'>"+columnDefinition.getLabel()+"</bold><BR>"+
"<em style='text-decoration:underline;'>"+columnDefinition.getColumnTypeName()+"</em><BR>"+
"<em>"+columnDefinition.getColumnDataType()+"</em><BR>"+
columnDefinition.getTooltipMessage()+"</p>");
SafeHtmlBuilder tooltipMessage = new SafeHtmlBuilder();
tooltipMessage
.appendHtmlConstant("<p align='Left'><bold style='font-weight:bold;'>"
+ columnDefinition.getLabel()
+ "</bold><BR>"
+ "<em style='text-decoration:underline;'>"
+ columnDefinition.getColumnTypeName()
+ "</em><BR>"
+ "<em>"
+ columnDefinition.getColumnDataType()
+ "</em><BR>"
+ columnDefinition.getTooltipMessage()
+ "</p>");
columnConfig.setToolTip(tooltipMessage.toSafeHtml());
return columnConfig;
}
protected static <T> DataRowColumnConfig<T> create(ColumnDefinition columnDefinition)
{
protected static <T> DataRowColumnConfig<T> create(
ColumnDefinition columnDefinition) {
return new DataRowColumnConfig<T>(columnDefinition);
}
public static void setEditor(AbstractGridEditing<DataRow> editableGrid, ColumnConfig<DataRow,?> columnConfig)
{
if (!(columnConfig instanceof DataRowColumnConfig<?>)) throw new IllegalArgumentException("Expected ColumnConfig type JSonValueColumnConfig");
setEditor(editableGrid, (DataRowColumnConfig<?>)columnConfig);
public static void setEditor(AbstractGridEditing<DataRow> editableGrid,
ColumnConfig<DataRow, ?> columnConfig) {
if (!(columnConfig instanceof DataRowColumnConfig<?>))
throw new IllegalArgumentException(
"Expected ColumnConfig type JSonValueColumnConfig");
setEditor(editableGrid, (DataRowColumnConfig<?>) columnConfig);
}
@SuppressWarnings("unchecked")
public static void setEditor(AbstractGridEditing<DataRow> editableGrid, DataRowColumnConfig<?> columnConfig)
{
public static void setEditor(AbstractGridEditing<DataRow> editableGrid,
DataRowColumnConfig<?> columnConfig) {
if (columnConfig.getDefinition().isEditable()) {
switch (columnConfig.getDefinition().getValueType()) {
case BOOLEAN: editableGrid.addEditor((ColumnConfig<DataRow, Boolean>) columnConfig, new CheckBox()); break;
case DATE: editableGrid.addEditor((ColumnConfig<DataRow, Date>) columnConfig, new DateField()); break;
case DOUBLE: editableGrid.addEditor((ColumnConfig<DataRow, Double>) columnConfig, new NumberField<Double>(new NumberPropertyEditor.DoublePropertyEditor())); break;
case FLOAT: editableGrid.addEditor((ColumnConfig<DataRow, Float>) columnConfig, new NumberField<Float>(new NumberPropertyEditor.FloatPropertyEditor())); break;
case INTEGER: editableGrid.addEditor((ColumnConfig<DataRow, Integer>) columnConfig, new NumberField<Integer>(new NumberPropertyEditor.IntegerPropertyEditor())); break;
case LONG: editableGrid.addEditor((ColumnConfig<DataRow, Long>) columnConfig, new NumberField<Long>(new NumberPropertyEditor.LongPropertyEditor())); break;
case STRING: editableGrid.addEditor((ColumnConfig<DataRow, String>) columnConfig, new TextField()); break;
default: break;
case BOOLEAN:
editableGrid.addEditor(
(ColumnConfig<DataRow, Boolean>) columnConfig,
new CheckBox());
break;
case DATE:
editableGrid.addEditor(
(ColumnConfig<DataRow, Date>) columnConfig,
new DateField());
break;
case DOUBLE:
editableGrid
.addEditor(
(ColumnConfig<DataRow, Double>) columnConfig,
new NumberField<Double>(
new NumberPropertyEditor.DoublePropertyEditor()));
break;
case FLOAT:
editableGrid
.addEditor(
(ColumnConfig<DataRow, Float>) columnConfig,
new NumberField<Float>(
new NumberPropertyEditor.FloatPropertyEditor()));
break;
case INTEGER:
editableGrid
.addEditor(
(ColumnConfig<DataRow, Integer>) columnConfig,
new NumberField<Integer>(
new NumberPropertyEditor.IntegerPropertyEditor()));
break;
case LONG:
editableGrid.addEditor(
(ColumnConfig<DataRow, Long>) columnConfig,
new NumberField<Long>(
new NumberPropertyEditor.LongPropertyEditor()));
break;
case STRING:
editableGrid.addEditor(
(ColumnConfig<DataRow, String>) columnConfig,
new TextField());
break;
default:
break;
}
}
}
}

View File

@ -16,8 +16,17 @@ public class ColumnDefinition implements Serializable {
private static final long serialVersionUID = 3736483086021088831L;
protected String id;
protected String label;
protected String id; //Column Name on service
protected String columnLocalId; //ColumnLocalId on service
protected String label; //Label
public String getColumnLocalId() {
return columnLocalId;
}
public void setColumnLocalId(String columnLocalId) {
this.columnLocalId = columnLocalId;
}
protected ValueType valueType;
protected int width;
protected boolean editable;
@ -37,8 +46,9 @@ public class ColumnDefinition implements Serializable {
* @param id the column id.
* @param label the column label.
*/
public ColumnDefinition(String id, String label) {
public ColumnDefinition(String id, String columnLocalId,String label) {
this.id = id;
this.columnLocalId=columnLocalId;
this.label = label;
this.type = ColumnType.USER;
this.position = -1;
@ -55,8 +65,8 @@ public class ColumnDefinition implements Serializable {
* @param visible flag for visibility.
* @param type the column type.
*/
public ColumnDefinition(String id, String label, ValueType valueType, int width, boolean editable, boolean visible, ColumnType type) {
this(id, label);
public ColumnDefinition(String id, String columnLocalId, String label, ValueType valueType, int width, boolean editable, boolean visible, ColumnType type) {
this(id, columnLocalId, label);
this.valueType = valueType;
this.width = width;
this.editable = editable;
@ -203,12 +213,15 @@ public class ColumnDefinition implements Serializable {
@Override
public String toString() {
return "ColumnDefinition [id=" + id + ", label=" + label
+ ", valueType=" + valueType + ", width=" + width
+ ", editable=" + editable + ", visible=" + visible + ", type="
+ type + ", position=" + position + ", tooltipMessage="
+ tooltipMessage + ", columnTypeName=" + columnTypeName
+ ", columnDataType=" + columnDataType + ", key=" + key + "]";
+ ", columnLocalId=" + columnLocalId + ", valueType="
+ valueType + ", width=" + width + ", editable=" + editable
+ ", visible=" + visible + ", type=" + type + ", position="
+ position + ", tooltipMessage=" + tooltipMessage
+ ", columnTypeName=" + columnTypeName + ", columnDataType="
+ columnDataType + ", key=" + key + "]";
}

View File

@ -12,5 +12,6 @@ package org.gcube.portlets.user.tdwx.shared.model;
public enum ColumnType {
USER,
VALIDATION,
SYSTEM;
}

View File

@ -23,38 +23,38 @@ public class TestSorting {
@Test
public void testSorting() {
List<ColumnDefinition> cols = new ArrayList<ColumnDefinition>();
ColumnDefinition col = new ColumnDefinition("id1", "label1");
ColumnDefinition col = new ColumnDefinition("id1","columnLocalId1", "label1");
col.setPosition(1);
cols.add(col);
col = new ColumnDefinition("id2", "label2");
col = new ColumnDefinition("id2","columnLocalId2", "label2");
col.setPosition(2);
cols.add(col);
col = new ColumnDefinition("id3", "label3");
col = new ColumnDefinition("id3","columnLocalId3", "label3");
col.setPosition(3);
cols.add(col);
col = new ColumnDefinition("id4", "label4");
col = new ColumnDefinition("id4","columnLocalId4", "label4");
col.setPosition(4);
cols.add(col);
col = new ColumnDefinition("id5", "label5");
col = new ColumnDefinition("id5","columnLocalId5", "label5");
col.setPosition(5);
cols.add(col);
col = new ColumnDefinition("id6-1", "label6-1");
col = new ColumnDefinition("id6-1","columnLocalId6-1", "label6-1");
col.setPosition(6);
cols.add(col);
col = new ColumnDefinition("id6-2", "label6-2");
col = new ColumnDefinition("id6-2","columnLocalId6-2", "label6-2");
col.setPosition(6);
cols.add(col);
col = new ColumnDefinition("id7", "label7");
col = new ColumnDefinition("id7-1","columnLocalId7-1", "label7-1");
col.setPosition(7);
cols.add(col);
col = new ColumnDefinition("idNoPos1", "labelNoPos1");
col = new ColumnDefinition("idNoPos1", "columnLocalNoPos1", "labelNoPos1");
cols.add(col);
col = new ColumnDefinition("idNoPos2", "labelNoPos2");
col = new ColumnDefinition("idNoPos2", "columnLocalNoPos2","labelNoPos2");
cols.add(col);
Collections.sort(cols, new ColumnPositionComparator(false));

View File

@ -50,12 +50,12 @@ public class TestSpeed {
protected static void testWriter() throws IOException
{
TableDefinition tableDefinition = new TableDefinition(new TableId("", "id"), "name", "jsonDataField", "jsonTotalLengthField", "jsonOffsetField");
tableDefinition.addColumn(new ColumnDefinition("boolean", "boolean", ValueType.BOOLEAN, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("date", "date", ValueType.DATE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("double", "double", ValueType.DOUBLE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("float", "float", ValueType.FLOAT, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("long", "long", ValueType.LONG, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("string", "string", ValueType.STRING, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("boolean", "boolean", "boolean", ValueType.BOOLEAN, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("date", "date", "date", ValueType.DATE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("double", "double", "double", ValueType.DOUBLE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("float", "float", "float", ValueType.FLOAT, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("long", "long", "long", ValueType.LONG, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("string", "string", "string", ValueType.STRING, 1, true, true, ColumnType.USER));
long startFreeMemory = Runtime.getRuntime().freeMemory();
@ -96,12 +96,12 @@ public class TestSpeed {
protected static void testBuilder() throws IOException
{
TableDefinition tableDefinition = new TableDefinition(new TableId("", "id"), "name", "jsonDataField", "jsonTotalLengthField", "jsonOffsetField");
tableDefinition.addColumn(new ColumnDefinition("boolean", "boolean", ValueType.BOOLEAN, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("date", "date", ValueType.DATE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("double", "double", ValueType.DOUBLE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("float", "float", ValueType.FLOAT, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("long", "long", ValueType.LONG, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("string", "string", ValueType.STRING, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("boolean", "boolean", "boolean", ValueType.BOOLEAN, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("date", "date", "date", ValueType.DATE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("double", "double", "double", ValueType.DOUBLE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("float", "float", "float", ValueType.FLOAT, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("long", "long", "long", ValueType.LONG, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("string", "string", "string", ValueType.STRING, 1, true, true, ColumnType.USER));
TableJSonBuilder gridJSonWriter = new TableJSonBuilder(tableDefinition);

View File

@ -25,12 +25,12 @@ public class TestTableJSonBuilder {
public void testTableJSonBuilder()
{
TableDefinition tableDefinition = new TableDefinition(new TableId("", "id"), "name", "jsonDataField", "jsonTotalLengthField", "jsonOffsetField");
tableDefinition.addColumn(new ColumnDefinition("boolean", "boolean", ValueType.BOOLEAN, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("date", "date", ValueType.DATE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("double", "double", ValueType.DOUBLE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("float", "float", ValueType.FLOAT, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("long", "long", ValueType.LONG, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("string", "string", ValueType.STRING, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("boolean", "boolean", "boolean", ValueType.BOOLEAN, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("date", "date", "date", ValueType.DATE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("double", "double", "double", ValueType.DOUBLE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("float", "float", "float", ValueType.FLOAT, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("long", "long", "long", ValueType.LONG, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("string", "string", "string", ValueType.STRING, 1, true, true, ColumnType.USER));
TableJSonBuilder gridJSonWriter = new TableJSonBuilder(tableDefinition);

View File

@ -28,13 +28,13 @@ public class TestTableJSonWriter {
public void testTableJSonWriter()
{
TableDefinition tableDefinition = new TableDefinition(new TableId("", "id"), "name", "jsonDataField", "jsonTotalLengthField", "jsonOffsetField");
tableDefinition.addColumn(new ColumnDefinition("boolean", "boolean", ValueType.BOOLEAN, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("date", "date", ValueType.DATE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("double", "double", ValueType.DOUBLE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("float", "float", ValueType.FLOAT, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("long", "long", ValueType.LONG, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("string", "string", ValueType.STRING, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("boolean", "boolean", "boolean", ValueType.BOOLEAN, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("date", "date", "date", ValueType.DATE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("double", "double", "double", ValueType.DOUBLE, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("float", "float", "float", ValueType.FLOAT, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("long", "long", "long", ValueType.LONG, 1, true, true, ColumnType.USER));
tableDefinition.addColumn(new ColumnDefinition("string", "string", "string", ValueType.STRING, 1, true, true, ColumnType.USER));
StringWriter writer = new StringWriter();