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();
}
}