Merge "Fix: Creating Editor comment in Unified view."

This commit is contained in:
Shawn Pearce
2012-10-21 16:39:39 -07:00
committed by Gerrit Code Review
2 changed files with 10 additions and 4 deletions

View File

@@ -427,7 +427,9 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
spans[col] = table.getFlexCellFormatter().getRowSpan(row, cell);
if (col == column) {
final Widget w = table.getWidget(row, cell);
if (w instanceof CommentEditorPanel) {
if (w instanceof CommentEditorPanel
&& ((CommentEditorPanel) w).getComment().getKey().getParentKey()
.equals(newComment.getKey().getParentKey())) {
// Don't insert two editors on the same position, it doesn't make
// any sense to the user.
//
@@ -812,10 +814,10 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
}
private void cannedReply(String message) {
CommentEditorPanel p = createEditor(null);
final PatchLineComment newComment = newComment();
newComment.setMessage(message);
CommentEditorPanel p = createEditor(newComment);
if (p == null) {
final PatchLineComment newComment = newComment();
newComment.setMessage(message);
enableButtons(false);
PatchUtil.DETAIL_SVC.saveDraft(newComment,

View File

@@ -198,6 +198,10 @@ public class CommentEditorPanel extends CommentPanel implements ClickHandler,
return comment.getKey().get() == null;
}
public PatchLineComment getComment() {
return comment;
}
@Override
public void onDoubleClick(final DoubleClickEvent event) {
edit();