@Override public void update(ViewerCell cell) { LogicalTask logicalTask = (LogicalTask) cell.getElement(); int columnIndex = cell.getColumnIndex(); if (columnIndex == 0) { cell.setImage(severityImages[logicalTask.getSeverityType()]); cell.setText(logicalTask.getSummary()); cell.setFont(logicalTask.getSeverityType() > 1 ? bold : null); cell.setForeground(logicalTask.isAllFixed() ? gray : null); } else { Version version = taskModel.getVersions()[columnIndex - 1]; VersionTask versionTask = logicalTask.getVersionTask(version); if (versionTask != null) { cell.setText(versionTask.getStatus()); cell.setFont(!"enhancement".equalsIgnoreCase(versionTask.getSeverity()) ? bold : null); cell.setForeground("FIXED".equalsIgnoreCase(versionTask.getResolution()) ? gray : null); cell.setBackground(logicalTask.getVersionTaskCount(version) > 1 ? red : null); } else { cell.setText(""); cell.setFont(null); cell.setForeground(null); cell.setBackground(null); } } }
/** * @see * org.eclipse.jface.viewers.StyledCellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell) */ @Override public void update(ViewerCell cell) { // Interlace if (isInterlaceRow) { // Font cell.setText("BOLD"); cell.setFont(SwtFonts.TEXT_BOLD.font()); // Image cell.setImage(SwtImagesSilk.DELETE.image()); // Color cell.setBackground(SwtColors.color(ColorType.RED)); } else { // Font cell.setText("Normal"); cell.setFont(SwtFonts.TEXT.font()); // Image cell.setImage(SwtImagesSilk.ADD.image()); // Color cell.setBackground(SwtColors.color(ColorType.GREEN)); } isInterlaceRow = !isInterlaceRow; super.update(cell); }
public void update(ViewerCell cell) { SliceProfileRow element = (SliceProfileRow) cell.getElement(); int index = cell.getColumnIndex(); String columnText = getColumnText(element, index); cell.setText(columnText); cell.setImage(getColumnImage(element, index)); if (sliceProfileIntersectionIndices.contains(element.getStatementID() - 1)) { cell.setBackground(highlightColor); } else cell.setBackground(null); super.update(cell); }