hzzz 8 years ago
parent
commit
999d5e2b52
  1. 12
      designer_base/src/com/fr/design/data/DesignTableDataManager.java

12
designer_base/src/com/fr/design/data/DesignTableDataManager.java

@ -380,9 +380,9 @@ public abstract class DesignTableDataManager {
final AutoProgressBar loadingBar = PreviewTablePane.getInstance().getProgressBar();
Env currentEnv = FRContext.getCurrentEnv();
ParameterProvider[] parameters = currentEnv.getTableDataParameters(tabledata);
if (isNullOrEmpty(parameters)) {
if (ArrayUtils.isEmpty(parameters)) {
ParameterProvider[] tableDataParameter = tabledata.getParameters(Calculator.createCalculator());
checkArgument(!isNullOrEmpty(tableDataParameter), "both parameters and tableDataParameter are empty");
checkArgument(!ArrayUtils.isEmpty(tableDataParameter), "both parameters and tableDataParameter are empty");
parameters = tableDataParameter;
}
boolean hasValue = true;
@ -409,14 +409,13 @@ public abstract class DesignTableDataManager {
if (loadingBar != null && needLoadingBar) {
loadingBar.start();
}
EmbeddedTableData embeddedTableData = null;
try {
for (ParameterProvider parameter : currentEnv.getTableDataParameters(tabledata)) {
if (parameterMap.containsKey(parameter.getName())) {
parameter.setValue(parameterMap.get(parameter.getName()));
}
}
embeddedTableData = currentEnv.previewTableData(tabledata, parameterMap, rowCount);
return currentEnv.previewTableData(tabledata, parameterMap, rowCount);
} catch (TableDataException e) {
throw new TableDataException(e.getMessage(), e);
} finally {
@ -426,7 +425,6 @@ public abstract class DesignTableDataManager {
}
}, 100);
}
return embeddedTableData;
}
/**
@ -496,10 +494,6 @@ public abstract class DesignTableDataManager {
threadLocal.set(value);
}
private static boolean isNullOrEmpty(Object[] objs) {
return objs == null || objs.length == 0;
}
private static void checkArgument(boolean expression, String errorMessage) {
if (!expression) {
throw new IllegalArgumentException(errorMessage);

Loading…
Cancel
Save