* @param columnIndex the zero-based index of the column in which the label appears.
*
* @return The column text string. No null value.
*/
public String getColumnText(Object object, int columnIndex) {
ReviewIssue reviewIssue = (ReviewIssue) object;
ReviewModel reviewModel = ReviewModel.getInstance();
IProject project = reviewModel.getProjectManager().getProject();
ReviewId reviewId = reviewModel.getReviewIdManager().getReviewId();
String phaseNameKey = reviewModel.getPhaseManager().getPhaseNameKey();
ColumnDataModelManager columnDataModelManager = ColumnDataModelManager.getInstance();
ColumnDataModel columnDataModel = columnDataModelManager.getModel(phaseNameKey);
String[] columnNameKeys = columnDataModel.getEnabledColumnNameKeyArray();
// make sure that columnIndex is not the index out of bounds.
if (columnNameKeys.length > columnIndex) {
String columnNameKey = columnNameKeys[columnIndex];
if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_CREATED_DATE)) {
return DATE_FORMATTER.format(reviewIssue.getCreationDate());
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_MODIFIED_DATE)) {
return DATE_FORMATTER.format(reviewIssue.getModificationDate());
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_REVIEWER)) {
return reviewIssue.getReviewer();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_ASSGINED_TO)) {
return reviewIssue.getAssignedTo();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_SUMMARY)) {
return reviewIssue.getSummary();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_DESCRIPTION)) {
return reviewIssue.getDescription();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_ANNOTATION)) {
return reviewIssue.getAnnotation();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_REVISION)) {
return reviewIssue.getRevision();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_TYPE)) {
TypeKeyManager manager = TypeKeyManager.getInstance(project, reviewId);
return manager.getLocalizedLabel(reviewIssue.getType().getKey());
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_SEVERITY)) {
String severityKey = reviewIssue.getSeverity().getKey();
SeverityKeyManager manager = SeverityKeyManager.getInstance(project, reviewId);
return manager.getLocalizedLabel(severityKey);
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_RESOLUTION)) {
String resolutionKey = reviewIssue.getResolution().getKey();
ResolutionKeyManager manager = ResolutionKeyManager.getInstance(project, reviewId);
return manager.getLocalizedLabel(resolutionKey);
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_STATUS)) {
StatusKeyManager manager = StatusKeyManager.getInstance(project, reviewId);
return manager.getLocalizedLabel(reviewIssue.getStatus().getKey());
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_FILE)) {
return reviewIssue.getTargetFile();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_LINE)) {
return reviewIssue.getLine();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_ID)) {
return reviewIssue.getIssueId();
}
else if (columnNameKey.equals(ResourceBundleKey.COLUMN_HEADER_LINK_ICON)) {
return "";
}
}