diff options
author | Robin Stocker | 2013-08-28 20:12:45 +0000 |
---|---|---|
committer | Robin Stocker | 2013-08-28 20:12:45 +0000 |
commit | eadb08030191df2c09a9b712e12143a5f8f8209e (patch) | |
tree | 186d23258bee3a911586cc0283195adc57fc2fc2 | |
parent | 676b5adc2529716e7f3bd65ee925082388f2f552 (diff) | |
download | egit-eadb08030191df2c09a9b712e12143a5f8f8209e.tar.gz egit-eadb08030191df2c09a9b712e12143a5f8f8209e.tar.xz egit-eadb08030191df2c09a9b712e12143a5f8f8209e.zip |
Fix sorting of files in commit dialog tree
This was broken when changing the table to a tree with bug 366175. Fix
the ClassCastException and add a test case.
Bug: 412359
Change-Id: I97cda72e102f519c1e66c8e36c383f94b9cdf3df
Signed-off-by: Robin Stocker <robin@nibor.org>
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java index cbf1622089..c02f742b26 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java @@ -108,8 +108,6 @@ import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.swt.widgets.ToolItem; @@ -249,11 +247,11 @@ public class CommitDialog extends TitleAreaDialog { @Override public void widgetSelected(SelectionEvent e) { - TableColumn column = (TableColumn) e.widget; - Table table = column.getParent(); + TreeColumn column = (TreeColumn) e.widget; + Tree tree = column.getParent(); - if (column == table.getSortColumn()) { - int currentDirection = table.getSortDirection(); + if (column == tree.getSortColumn()) { + int currentDirection = tree.getSortDirection(); switch (currentDirection) { case SWT.NONE: reversed = Boolean.FALSE; @@ -271,20 +269,20 @@ public class CommitDialog extends TitleAreaDialog { reversed = Boolean.FALSE; if (reversed == null) { - table.setSortColumn(null); - table.setSortDirection(SWT.NONE); + tree.setSortColumn(null); + tree.setSortDirection(SWT.NONE); filesViewer.setComparator(null); return; } - table.setSortColumn(column); + tree.setSortColumn(column); Comparator<CommitItem> comparator; if (reversed.booleanValue()) { comparator = order.descending(); - table.setSortDirection(SWT.DOWN); + tree.setSortDirection(SWT.DOWN); } else { comparator = order; - table.setSortDirection(SWT.UP); + tree.setSortDirection(SWT.UP); } filesViewer.setComparator(new CommitViewerComparator(comparator)); |