Merge "ChangeScreen2: Don't open files with middle click"

This commit is contained in:
Shawn Pearce
2013-12-13 00:43:53 +00:00
committed by Gerrit Code Review
4 changed files with 13 additions and 9 deletions

View File

@@ -113,6 +113,7 @@ class FileTable extends FlowPanel {
if (t != null) {
t.onOpenRow(1 + idx);
e.preventDefault();
e.stopPropagation();
return false;
}
}
@@ -311,11 +312,11 @@ class FileTable extends FlowPanel {
}
@Override
protected void onCellSingleClick(int row, int column) {
if (column == C_PATH) {
protected void onCellSingleClick(Event event, int row, int column) {
if (column == C_PATH && link.handleAsClick(event)) {
onOpenRow(row);
} else {
super.onCellSingleClick(row, column);
super.onCellSingleClick(event, row, column);
}
}
}

View File

@@ -32,6 +32,7 @@ import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
@@ -40,6 +41,7 @@ import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwtexpui.safehtml.client.SafeHtml;
import com.google.gwtexpui.safehtml.client.SafeHtmlBuilder;
import org.eclipse.jgit.diff.Edit;
import java.util.ArrayList;
@@ -76,8 +78,8 @@ public class SideBySideTable extends AbstractPatchContentTable {
}
@Override
protected void onCellSingleClick(int row, int column) {
super.onCellSingleClick(row, column);
protected void onCellSingleClick(Event event, int row, int column) {
super.onCellSingleClick(event, row, column);
if (column == 1 || column == 4) {
onCellDoubleClick(row, column);
}

View File

@@ -30,6 +30,7 @@ import com.google.gerrit.reviewdb.client.PatchLineComment;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwtexpui.safehtml.client.SafeHtml;
@@ -98,8 +99,8 @@ public class UnifiedDiffTable extends AbstractPatchContentTable {
}
@Override
protected void onCellSingleClick(int row, int column) {
super.onCellSingleClick(row, column);
protected void onCellSingleClick(Event event, int row, int column) {
super.onCellSingleClick(event, row, column);
if (column == 1 || column == 2) {
if (!"".equals(table.getText(row, column))) {
onCellDoubleClick(row, column);

View File

@@ -53,7 +53,7 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
}
final int row = rowOf(td);
if (getRowItem(row) != null) {
onCellSingleClick(rowOf(td), columnOf(td));
onCellSingleClick(event, rowOf(td), columnOf(td));
return;
}
break;
@@ -145,7 +145,7 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
}
/** Invoked when the user clicks on a table cell. */
protected void onCellSingleClick(int row, int column) {
protected void onCellSingleClick(Event event, int row, int column) {
movePointerTo(row);
}