1
2
3
4 package com.webstersmalley.mediacollection.model;
5
6 import ca.odell.glazedlists.gui.TableFormat;
7
8 /**
9 */
10 public class SimpleMediaCollectionTableFormat implements TableFormat
11 {
12
13
14
15 public int getColumnCount()
16 {
17 return SimpleMediaCollectionBean.columns.length;
18 }
19
20
21
22
23 public String getColumnName(int col)
24 {
25 return SimpleMediaCollectionBean.columns[col];
26 }
27
28
29
30
31 public Object getColumnValue(Object obj, int col)
32 {
33 if (obj instanceof SimpleMediaCollectionBean)
34 {
35 SimpleMediaCollectionBean bean = (SimpleMediaCollectionBean)obj;
36 return bean.getColumn(col);
37 }
38 else
39 {
40 throw new RuntimeException("Error: unknown object type (expected SimpleMediaCollectionBean)");
41 }
42 }
43
44 }