}
return cnames;
}
protected JTable createTable(final boolean colors) {
JTable t=new BasicSortingTable(this, new Vector(), columnNames) {
public boolean isCellEditable(int row, int col) {
return false;
}
// This table colors elements depending on their owner
public Component prepareRenderer(TableCellRenderer renderer, int rowIndex, int vColIndex) {
Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
if (!isCellSelected(rowIndex, vColIndex) && colors) {
XMLElement el = (XMLElement) getValueAt(rowIndex, 0);
if (el instanceof XMLCollectionElement) {
XMLCollectionElement cel = (XMLCollectionElement) el;
XMLCollection celOwner = (XMLCollection) cel.getParent();
if (celOwner == null) {
c.setBackground(SPEC_EL_COLOR_BKG);
} else if (celOwner!=getOwner()) {
c.setBackground(FOREIGN_EL_COLOR_BKG);
} else {
c.setBackground(getBackground());
}
} else {
c.setBackground(getBackground());
}
}
return c;
}
};
Color bkgCol=new Color(245,245,245);
if (ipc.getSettings() instanceof PanelSettings) {
bkgCol=((PanelSettings)ipc.getSettings()).getBackgroundColor();
}
t.setBackground(bkgCol);
return t;
}