String projectName = projects[0];
project = FileResource.getProject(projectName);
}
ReviewModel reviewModel = ReviewModel.getInstance();
ReviewId reviewId = reviewModel.getReviewIdManager().getReviewId();
reviewPhaseNameKey = reviewModel.getPhaseManager().getPhaseNameKey();
// whatever review id is null or not,
int result = ReviewDialog.processReviewIdSelectionWizardDialog(reviewPhaseNameKey,
project, true);
if (result == WizardDialog.CANCEL) {
return false;
}
// update review Id.
reviewModel = ReviewModel.getInstance();
project = reviewModel.getProjectManager().getProject();
reviewId = reviewModel.getReviewIdManager().getReviewId();
ReviewerId reviewerId = reviewModel.getReviewerIdManager().getReviewerId();
// assertion review file should not be null.
IFile iReviewFile = FileResource.getReviewFile(project, reviewId, reviewerId);
if (iReviewFile == null) {
String tkey = "ReviewDialog.noReviewFileDetermined.simpleConfirm.messageDialog.title";
String title = ReviewI18n.getString(tkey);
String mKey = "ReviewDialog.noReviewFileDetermined.simpleConfirm.messageDialog.message";
String message = ReviewI18n.getString(mKey);
ReviewDialog.openSimpleComfirmMessageDialog(title, message);
log.debug(message);
return false;
}
// check file written permission
if (iReviewFile.isReadOnly()) {
String message = "Review file " + iReviewFile + " is readonly. Please make it writable " +
"to save your issues.";
ReviewDialog.openSimpleComfirmMessageDialog("Review Management", message);
}
ReviewTableView tableView = ReviewTableView.getActiveView();
String selectedIssueId = "";
if (tableView != null) {
TableItem[] selecteItems = tableView.getTable().getSelection();
if (selecteItems.length > 0) {
selectedIssueId = ((ReviewIssue) selecteItems[0].getData()).getIssueId();
}
}
ReviewIssueModelManager reviewIssueModelManager = ReviewIssueModelManager.getInstance();
ReviewIssueModel reviewIssueModel = reviewIssueModelManager.getModel(project, reviewId);
reviewIssueModel.notifyListeners(ReviewIssueModelEvent.MERGE);
ColumnDataModelManager columnDataModelManager = ColumnDataModelManager.getInstance();
ColumnDataModel columnDataModel = columnDataModelManager.getModel(reviewPhaseNameKey);
reviewModel = ReviewModel.getInstance();
project = reviewModel.getProjectManager().getProject();
reviewId = reviewModel.getReviewIdManager().getReviewId();
reviewerId = reviewModel.getReviewerIdManager().getReviewerId();
iReviewFile = FileResource.getReviewFile(project, reviewId, reviewerId);
// null happens when the view is not opened yet after Eclipse startup.
if (tableView == null) {
tableView = ReviewTableView.bringViewToTop();
}
tableView.createColumns(columnDataModel);
PropertyResource propertyResource = PropertyResource.getInstance(project, true);
String reviewIdString = reviewId.getReviewId();
ReviewResource reviewResource = propertyResource.getReviewResource(reviewIdString, true);
IPreferenceStore store = ReviewPlugin.getInstance().getPreferenceStore();
String prefFilterKey = FilterPreferencePage.ENABLE_FILTER_STORE_KEY;
boolean isPrefFilterEnabled = store.getBoolean(prefFilterKey);
if (isPrefFilterEnabled) {