ComponentAdapter { public Object getColumnIdentifierAt(int columnIndex) { if ((columnIndex < 0) || (columnIndex >= getColumnCount())) { throw new ArrayIndexOutOfBoundsException("invalid column index: " + columnIndex); } return DEFAULT_COLUMN_IDENTIFIER; } ComponentAdapter(JComponent component); JComponent getComponent(); String getColumnName(int columnIndex); Object getColumnIdentifierAt(int columnIndex); int getColumnIndex(Object identifier); boolean isTestable(int column); Class<?> getColumnClass(int column); Class<?> getColumnClass(); int getColumnCount(); int getRowCount(); abstract Object getValueAt(int row, int column); abstract boolean isCellEditable(int row, int column); String getString(); String getString(int modelColumnIndex); String getFilteredStringAt(int row, int column); String getStringAt(int row, int column); Object getValue(); Object getValue(int modelColumnIndex); Object getFilteredValueAt(int row, int column); Rectangle getCellBounds(); abstract boolean hasFocus(); abstract boolean isSelected(); abstract boolean isEditable(); boolean isExpanded(); boolean isLeaf(); boolean isHierarchical(); int getDepth(); int convertColumnIndexToView(int columnModelIndex); int convertColumnIndexToModel(int columnViewIndex); int convertRowIndexToView(int rowModelIndex); int convertRowIndexToModel(int rowViewIndex); static final Object DEFAULT_COLUMN_IDENTIFIER; public int row; public int column; }
@Test public void testColumnIdentifierAtList() { JXListT tree = new JXListT(new String[] {"one" }); ComponentAdapter adapter = tree.getComponentAdapter(0); assertEquals(ComponentAdapter.DEFAULT_COLUMN_IDENTIFIER, adapter.getColumnIdentifierAt(0)); }
@Test public void testColumnIdentifierAtTree() { JXTreeT tree = new JXTreeT(); ComponentAdapter adapter = tree.getComponentAdapter(0); assertEquals(ComponentAdapter.DEFAULT_COLUMN_IDENTIFIER, adapter.getColumnIdentifierAt(0)); }
@Test public void testColumnIdentifierAt() { JXTableT table = new JXTableT(new AncientSwingTeam()); ComponentAdapter adapter = table.getComponentAdapter(0, 0); Object id = new Integer(50); table.getColumn(0).setIdentifier(id); assertEquals(table.getColumn(0).getIdentifier(), adapter.getColumnIdentifierAt(0)); }