Browse Source

Merge pull request #5 in PF/design from ~DANIEL/finereport_design:dev to dev

* commit '3baecb853541768efb591deeebc8322add8b2054':
  1
  国际化
  calculator优化
  1
master
daniel 8 years ago
parent
commit
49fe77dc60
  1. 2
      designer/src/com/fr/design/mainframe/WorkBookModelAdapter.java
  2. 22
      designer_base/src/com/fr/design/data/datapane/preview/PreviewTableModel.java
  3. 6
      designer_base/src/com/fr/env/RemoteEnv.java

2
designer/src/com/fr/design/mainframe/WorkBookModelAdapter.java

@ -52,7 +52,7 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
public Parameter[] getTableDataParameters() {
TableDataSource source = this.getBook();
Calculator c = Calculator.createCalculator();
c.setAttribute(TableDataSource.class, source);
c.setAttribute(TableDataSource.KEY, source);
java.util.List<ParameterProvider> list = new java.util.ArrayList<ParameterProvider>();
java.util.Iterator<String> nameIt = this.getBook().getTableDataNameIterator();
while (nameIt.hasNext()) {

22
designer_base/src/com/fr/design/data/datapane/preview/PreviewTableModel.java

@ -50,7 +50,7 @@ public class PreviewTableModel extends AbstractTableModel {
maxRowCount = rowCount;
}
final int finalRowCount = maxRowCount;
DataModel dm = new DataModel() {
DataModel dm = new AbstractDataModel() {
@Override
public void release() throws Exception {
@ -100,7 +100,7 @@ public class PreviewTableModel extends AbstractTableModel {
} catch (TableDataException e) {
FRContext.getLogger().error(e.getMessage(), e);
DesignUtils.errorMessage(e.getMessage());
return Inter.getLocText("Error");
return Inter.getLocText("FR-Designer_Error");
}
}
@ -149,7 +149,7 @@ public class PreviewTableModel extends AbstractTableModel {
}
public String getColumnName(int column) {
return Inter.getLocText("Error");
return Inter.getLocText("FR-Designer_Error");
}
public int getColumnCount() {
@ -166,7 +166,7 @@ public class PreviewTableModel extends AbstractTableModel {
private String checkType(int column) {
if (dateIndexs.contain(column)) {
String s = Inter.getLocText("Date");
String s = Inter.getLocText("FR-Designer_Date");
return ("(" + s + ")");
}
@ -187,23 +187,23 @@ public class PreviewTableModel extends AbstractTableModel {
if (o == null) {
s = "?";
} else if (o instanceof String) {
s = Inter.getLocText("Parameter-String");
s = Inter.getLocText("FR-Designer_Parameter_String");
if (FRContext.getCurrentEnv() instanceof RemoteEnv && dataModel instanceof EmbeddedTDDataModel) {
Class clzz = ((EmbeddedTDDataModel) dataModel).getColumnClass(column);
if (Number.class.isAssignableFrom(clzz)) {
s = Inter.getLocText("Number");//bigdecimal
s = Inter.getLocText("FR-Designer_Number");//bigdecimal
} else if (java.sql.Date.class.isAssignableFrom(clzz)) {
s = Inter.getLocText("Date");
s = Inter.getLocText("FR-Designer_Date");
}
}
} else if (o instanceof Integer) {
s = Inter.getLocText("Integer");
s = Inter.getLocText("FR-Designer_Integer");
} else if (o instanceof Double || o instanceof Float) {
s = Inter.getLocText("Double");
s = Inter.getLocText("FR-Designer_Double");
} else if (o instanceof java.sql.Date || o instanceof java.util.Date) {
s = Inter.getLocText("Date");
s = Inter.getLocText("FR-Designer_Date");
} else if (o instanceof Number) {
s = Inter.getLocText("Number");//bigdecimal
s = Inter.getLocText("FR-Designer_Number");//bigdecimal
} else {
s = "?";
}

6
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -513,8 +513,10 @@ public class RemoteEnv implements Env {
}
private void stopLogTimer() {
logTimer.cancel();
logTimer = null;
if(logTimer != null) {
logTimer.cancel();
logTimer = null;
}
}
/**

Loading…
Cancel
Save