// Creates ReviewIssue instance, and fill it into editor view.
ReviewModel reviewModel = ReviewModel.getInstance();
IProject project = reviewModel.getProjectManager().getProject();
ReviewId reviewId = reviewModel.getReviewIdManager().getReviewId();
ReviewerId reviewerId = reviewModel.getReviewerIdManager().getReviewerId();
IFile iReviewFile = FileResource.getReviewFile(project, reviewId, reviewerId);
if (iReviewFile == null) {
String titleKey = "ReviewDialog.noReviewFileDetermined.simpleConfirm.messageDialog.title";
String title = ReviewI18n.getString(titleKey);
String messageKey = "ReviewDialog.noReviewFileDetermined.simpleConfirm.messageDialog.message";
String message = ReviewI18n.getString(messageKey);
ReviewDialog.openSimpleComfirmMessageDialog(title, message);
log.debug(message);
return;
}
// 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);
}
try {
ReviewEditorView editorView = ReviewEditorView.bringViewToTop();
editorView.setEnable(true);
// you cannot just get the line number, verify that the active file is the same as the target file
// TODO Is it ok to assume that just because the files match the line number should be used?
// this may not be case if the file is active and the user right-clicked on it from the package manager
String line = "";
if (selectedFile != null && selectedFile.equals(FileResource.getActiveFile())) {
line = getLineNumber();
}
if (!targetFilePath.equals("")) {
ReviewIssue reviewIssue = new ReviewIssue(new Date(), new Date(),
reviewerId.getReviewerId(), "", targetFilePath, line,
(Type) TypeKeyManager.getInstance(project, reviewId).getItem(0),
(Severity) SeverityKeyManager.getInstance(project, reviewId).getItem(0),
"", this.selectedText, "", "",
(Resolution) ResolutionKeyManager.getInstance(project, reviewId).getItem(0),
(Status) StatusKeyManager.getInstance(project, reviewId).getItem(0),