|
|
@ -3,7 +3,7 @@ package com.fr.design.data.datapane.preview; |
|
|
|
import com.fr.cache.list.IntList; |
|
|
|
import com.fr.cache.list.IntList; |
|
|
|
import com.fr.data.AbstractDataModel; |
|
|
|
import com.fr.data.AbstractDataModel; |
|
|
|
import com.fr.data.impl.EmbeddedTableData.EmbeddedTDDataModel; |
|
|
|
import com.fr.data.impl.EmbeddedTableData.EmbeddedTDDataModel; |
|
|
|
import com.fr.data.impl.storeproc.ProcedureDataModel; |
|
|
|
import com.fr.data.impl.NameDataModel; |
|
|
|
import com.fr.design.utils.DesignUtils; |
|
|
|
import com.fr.design.utils.DesignUtils; |
|
|
|
import com.fr.general.data.DataModel; |
|
|
|
import com.fr.general.data.DataModel; |
|
|
|
import com.fr.general.data.TableDataException; |
|
|
|
import com.fr.general.data.TableDataException; |
|
|
@ -32,8 +32,9 @@ public class PreviewTableModel extends AbstractTableModel { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public PreviewTableModel(DataModel sourceResultSet, int maxRowCount) { |
|
|
|
public PreviewTableModel(DataModel sourceResultSet, int maxRowCount) { |
|
|
|
if (sourceResultSet instanceof ProcedureDataModel) { |
|
|
|
// 如果是这种NameDataModel,根据maxRowCount截断一下
|
|
|
|
ProcedureDataModel rs = (ProcedureDataModel) sourceResultSet; |
|
|
|
if (sourceResultSet instanceof NameDataModel) { |
|
|
|
|
|
|
|
NameDataModel rs = (NameDataModel) sourceResultSet; |
|
|
|
try { |
|
|
|
try { |
|
|
|
this.dataModel = createRowDataModel(rs, maxRowCount); |
|
|
|
this.dataModel = createRowDataModel(rs, maxRowCount); |
|
|
|
} catch (TableDataException e) { |
|
|
|
} catch (TableDataException e) { |
|
|
@ -45,7 +46,7 @@ public class PreviewTableModel extends AbstractTableModel { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static DataModel createRowDataModel(final ProcedureDataModel rs, int maxRowCount) throws TableDataException { |
|
|
|
public static DataModel createRowDataModel(final NameDataModel rs, int maxRowCount) throws TableDataException { |
|
|
|
int rowCount = rs.getRowCount(); |
|
|
|
int rowCount = rs.getRowCount(); |
|
|
|
if (maxRowCount == 0) { |
|
|
|
if (maxRowCount == 0) { |
|
|
|
maxRowCount = rowCount; |
|
|
|
maxRowCount = rowCount; |
|
|
|