/*
  * (non-Javadoc)
  *
  * @see org.talend.commons.ui.swt.tableviewer.behavior.DefaultTableLabelProvider#getBackground(java.lang.Object,
  * int)
  */
 @Override
 public Color getBackground(Object element, int columnIndex) {
   if (!(element instanceof IMetadataColumn)) {
     return null;
   }
   IMetadataColumn column = (IMetadataColumn) element;
   TableViewerCreatorColumnNotModifiable tableColumn =
       (TableViewerCreatorColumnNotModifiable) tableViewerCreator.getColumns().get(columnIndex);
   if (column.isCustom()) {
     if (column.isReadOnly()
         || readOnly
         || tableColumn.getId().equals(AbstractMetadataTableEditorView.ID_COLUMN_NAME)) {
       return CELL_READ_ONLY_COLOR;
     } else {
       return CUSTOM_CELL_BG_COLOR;
     }
   }
   if (column.isReadOnly()) {
     return TABLE_READ_ONLY_COLOR;
   }
   // qli modified to fix the bug 6654.
   if (tableEditorView.isShowTalendTypeColumn() && tableEditorView.getCurrentDbms() != null) {
     if (tableColumn.getId().equals(AbstractMetadataTableEditorView.ID_COLUMN_DBTYPE)
         && !"".equals(column.getType()) // $NON-NLS-1$
         && !TypesManager.checkDBType(
             tableEditorView.getCurrentDbms(), column.getTalendType(), column.getType())) {
       return CELL_WRONG_DB_TYPE_COLOR;
     }
   }
   return super.getBackground(element, columnIndex);
 }