*/
private TableCellRenderer getStringRenderer(final String propertyKey,
final FurnitureLibrary furnitureLibrary,
final FurnitureLanguageController controller) {
if (FurnitureLibrary.FURNITURE_ID_PROPERTY.equals(propertyKey)) {
return new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
return super.getTableCellRendererComponent(
table, ((CatalogPieceOfFurniture)value).getId(), isSelected, hasFocus, row, column);
}
};
} else if (FurnitureLibrary.FURNITURE_NAME_PROPERTY.equals(propertyKey)) {
return new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
CatalogPieceOfFurniture piece = (CatalogPieceOfFurniture)value;
String pieceName = (String)furnitureLibrary.getPieceOfFurnitureLocalizedData(
piece, controller.getFurnitureLangauge(), propertyKey, piece.getName());
return super.getTableCellRendererComponent(
table, pieceName, isSelected, hasFocus, row, column);
}
};
} else if (FurnitureLibrary.FURNITURE_DESCRIPTION_PROPERTY.equals(propertyKey)) {
return new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
CatalogPieceOfFurniture piece = (CatalogPieceOfFurniture)value;
String pieceDescription = (String)furnitureLibrary.getPieceOfFurnitureLocalizedData(
piece, controller.getFurnitureLangauge(), propertyKey, piece.getDescription());
return super.getTableCellRendererComponent(
table, pieceDescription, isSelected, hasFocus, row, column);
}
};
} else if (FurnitureLibrary.FURNITURE_CATEGORY_PROPERTY.equals(propertyKey)) {
return new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
CatalogPieceOfFurniture piece = (CatalogPieceOfFurniture)value;
String pieceCategory = (String)furnitureLibrary.getPieceOfFurnitureLocalizedData(
piece, controller.getFurnitureLangauge(), propertyKey, piece.getCategory().getName());
return super.getTableCellRendererComponent(
table, pieceCategory, isSelected, hasFocus, row, column);
}
};
} else if (FurnitureLibrary.FURNITURE_CREATOR_PROPERTY.equals(propertyKey)) {
return new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
return super.getTableCellRendererComponent(
table, ((CatalogPieceOfFurniture)value).getCreator(), isSelected, hasFocus, row, column);