}
public void init81Or82Or83ComponentAction(ComponentExt componentExt) {
final Column column = componentExt.getColumn();
JComponent component = componentExt.getComponent();
if (column.getInputType() == 83) {
final XrCalculator xrCalculator = (XrCalculator)component;
xrCalculator.setRelationManager(this);
final Vector parameters = getParameters(componentExt);
final String sql = getSQL(componentExt, parameters);
xrCalculator.addActionListener(
new ActionAdapter() {
public void actionPerformed(ActionEvent e) {
DAO dao = DAO.getInstance();
dao.query(sql);
for (int i = 0; i < parameters.size(); i++) {
String parameter = (String)parameters.get(i);
StringTokenizer st = new StringTokenizer(parameter, ".");
String tableName = (String)st.nextElement();
String columnName = (String)st.nextElement();
ComponentExt componentExt = findComponentExt(tableName, columnName);
JComponent component = componentExt.getComponent();
dao.setObject(i+1, ComponentManager.getValue(component));
}
ResultSet rs = dao.executeQuery();
try {
ResultSetMetaData rsmd = rs.getMetaData();
Vector columns = new Vector();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
ComponentExt tempComponentExt = findComponentExt(column.getTableName(), rsmd.getColumnName(i));
boolean isThisObjectColumn = (tempComponentExt != null);
if (isThisObjectColumn)
columns.add(column.getTableName() + "-" + rsmd.getColumnName(i));
else
columns.add(rsmd.getTableName(i) + "-" + rsmd.getColumnName(i));
}
xrCalculator.setColumns(columns);
} catch (Exception ee) {
ee.printStackTrace();
}
}
});
} else if ( (column.getInputType() == 81) || (column.getInputType() == 82) ) {
final DetailList detailList = (DetailList)component;
detailList.setRelationManager(this);
final Vector parameters = getParameters(componentExt);
final String sql = getSQL(componentExt, parameters);
detailList.addActionListener(
new ActionAdapter() {
public void actionPerformed(ActionEvent e) {
// System.err.println("81 = 82");
DAO dao = DAO.getInstance();
dao.query(sql);
for (int i = 0; i < parameters.size(); i++) {
String parameter = (String)parameters.get(i);
StringTokenizer st = new StringTokenizer(parameter, ".");
String tableName = (String)st.nextElement();
String columnName = (String)st.nextElement();
// System.err.println("TABLENAME=" + tableName + " COLUMNNAME=" + columnName);
ComponentExt componentExt = findComponentExt(tableName, columnName);
// System.err.println("componentExt = " + componentExt);
JComponent component = componentExt.getComponent();
dao.setObject(i+1, ComponentManager.getValue(component));
}
ResultSet rs = dao.executeQuery();
try {
// System.err.println(rs.getStatement());
ResultSetMetaData rsmd = rs.getMetaData();
Vector columns = new Vector();
Vector columnNames = new Vector();
Vector datas = new Vector();
detailList.tDataVector = new Vector();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
ComponentExt tempComponentExt = findComponentExt(column.getTableName(), rsmd.getColumnName(i));
boolean isThisObjectColumn = (tempComponentExt != null);
if (isThisObjectColumn)
columns.add(column.getTableName() + "-" + rsmd.getColumnName(i));
else
columns.add(rsmd.getTableName(i) + "-" + rsmd.getColumnName(i));
Column tempColumn = null;
if (isThisObjectColumn)
tempColumn = ColumnManager.getColumn(column.getTableName(), rsmd.getColumnName(i));
else
tempColumn = ColumnManager.getColumn(rsmd.getTableName(i), rsmd.getColumnName(i));
if (tempColumn != null) {
String columnName = ObjectUtil.findColumnTxt(tempColumn.getClsId(), tempColumn.getTableName(), tempColumn.getColumnName());
if (columnName != null)
columnNames.add(columnName);
else {
columnNames.add("Txt");
}
} else {
columnNames.add("Txt");
}
}
columnNames.add("value");//restore value
detailList.setColumns(columns);
while (rs.next()) {
Vector rowDatas = new Vector();
detailList.tRowDatas = new Vector();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
Object columnValue = rs.getObject(rsmd.getColumnName(i));
ComponentExt tempComponentExt = findComponentExt(column.getTableName(), rsmd.getColumnName(i));
boolean isThisObjectColumn = (tempComponentExt != null);
Column tempColumn = null;
if (isThisObjectColumn) {
tempColumn = ColumnManager.getColumn(column.getTableName(), rsmd.getColumnName(i));
} else {
tempColumn = ColumnManager.getColumn(rsmd.getTableName(i), rsmd.getColumnName(i));
}
if (tempColumn != null) {
if (tempColumn.isI18N()) {
String i18nString = I18NManager.getI18NString(tempColumn.getI18nPrefix(), columnValue);
if (GlobalValueManager.getValue("APPLICATION.ZIC").equals("1")) {
rowDatas.add(i18nString);
} else if (GlobalValueManager.getValue("APPLICATION.ZIC").equals("2")) {
rowDatas.add(columnValue);
} else if (GlobalValueManager.getValue("APPLICATION.ZIC").equals("3")) {