// Core columns are implementors of TableColumn to save one class creation
// Otherwise, we'd have to create a generic TableColumnImpl class, pass it
// to another class so that it could manipulate it and act upon changes.
TableColumnManager tcManager = TableColumnManager.getInstance();
TableColumnCoreCreationListener tcCreator = new TableColumnCoreCreationListener() {
// @see org.gudy.azureus2.ui.swt.views.table.TableColumnCoreCreationListener#createTableColumnCore(java.lang.Class, java.lang.String, java.lang.String)
public TableColumnCore createTableColumnCore(Class forDataSourceType,
String tableID, String columnID) {
cInfo info = c.get(columnID);
try {
Constructor constructor = info.cla.getDeclaredConstructor(new Class[] {
String.class
});
TableColumnCore column = (TableColumnCore) constructor.newInstance(new Object[] {
tableID
});
return column;
} catch (Exception e) {
Debug.out(e);
}
return null;
}
public void tableColumnCreated(TableColumn column) {
}
};
tcManager.unregisterColumn(NameItem.DATASOURCE_TYPE, NameItem.COLUMN_ID, null);
for (Iterator<String> iter = c.keySet().iterator(); iter.hasNext();) {
String id = iter.next();
cInfo info = c.get(id);
for (int i = 0; i < info.forDataSourceTypes.length; i++) {
Class cla = info.forDataSourceTypes[i];
tcManager.registerColumn(cla, id, tcCreator);
}
}
}