}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
final Component component = myRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
final DomElementAnnotationsManager annotationsManager = DomElementAnnotationsManager.getInstance(myRowDomElement.getManager().getProject());
final DomElementsProblemsHolder holder = annotationsManager.getCachedProblemHolder(myCellValueDomElement);
final List<DomElementProblemDescriptor> errorProblems = holder.getProblems(myCellValueDomElement);
final List<DomElementProblemDescriptor> warningProblems = new ArrayList<DomElementProblemDescriptor>(holder.getProblems(myCellValueDomElement, true, HighlightSeverity.WARNING));
warningProblems.removeAll(errorProblems);
final boolean hasErrors = errorProblems.size() > 0;
if (hasErrors) {
component.setForeground(Color.RED);
if (component instanceof JComponent) {
((JComponent)component).setToolTipText(TooltipUtils.getTooltipText(errorProblems));
}
}
else {
component.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());
if (component instanceof JComponent) {
((JComponent)component).setToolTipText(null);
}
}
// highlight empty cell with errors
if (hasErrors && (value == null || value.toString().trim().length() == 0)) {
component.setBackground(BaseControl.ERROR_BACKGROUND);
}
else if (warningProblems.size() > 0) {
component.setBackground(BaseControl.WARNING_BACKGROUND);
if(isSelected) component.setForeground(Color.BLACK);
}
final List<DomElementProblemDescriptor> errorDescriptors =
annotationsManager.getCachedProblemHolder(myRowDomElement).getProblems(myRowDomElement, true, true);
if (table.getModel().getColumnCount() - 1 == column) {
if (errorDescriptors.size() > 0) {
final JPanel wrapper = new JPanel(new BorderLayout());
wrapper.add(component, BorderLayout.CENTER);