Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-25 05:38:26 +0000
committermkersten2007-06-25 05:38:26 +0000
commit622ba8c05e01f630fa921fc7857cc26eb17843b2 (patch)
treee15e75650a07a4a89a1ed3f0e4c6dbf63a58e285
parentc0327370082f76161881bdb9ba6a6ff7559b3ab0 (diff)
downloadorg.eclipse.mylyn.tasks-622ba8c05e01f630fa921fc7857cc26eb17843b2.tar.gz
org.eclipse.mylyn.tasks-622ba8c05e01f630fa921fc7857cc26eb17843b2.tar.xz
org.eclipse.mylyn.tasks-622ba8c05e01f630fa921fc7857cc26eb17843b2.zip
RESOLVED - bug 175846: Be able to sort in inverse order
https://bugs.eclipse.org/bugs/show_bug.cgi?id=175846
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/SortyByDropDownAction.java24
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java8
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java4
3 files changed, 26 insertions, 10 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/SortyByDropDownAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/SortyByDropDownAction.java
index cbe0503da..da3728daa 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/SortyByDropDownAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/SortyByDropDownAction.java
@@ -11,6 +11,7 @@ package org.eclipse.mylyn.internal.tasks.ui.views;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.action.Separator;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListTableSorter.SortByIndex;
import org.eclipse.swt.widgets.Control;
@@ -79,8 +80,7 @@ class SortyByDropDownAction extends Action implements IMenuCreator {
byPriority.setEnabled(true);
byPriority.setText("Priority");
byPriority.setImageDescriptor(TasksUiImages.PRIORITY_1);
- ActionContributionItem item = new ActionContributionItem(byPriority);
- item.fill(dropDownMenu, -1);
+ new ActionContributionItem(byPriority).fill(dropDownMenu, -1);
bySummary = new Action("", AS_CHECK_BOX) {
@Override
@@ -93,8 +93,7 @@ class SortyByDropDownAction extends Action implements IMenuCreator {
};
bySummary.setEnabled(true);
bySummary.setText("Summary");
- item = new ActionContributionItem(bySummary);
- item.fill(dropDownMenu, -1);
+ new ActionContributionItem(bySummary).fill(dropDownMenu, -1);
byDateCreated = new Action("", AS_CHECK_BOX) {
@Override
@@ -108,9 +107,22 @@ class SortyByDropDownAction extends Action implements IMenuCreator {
byDateCreated.setEnabled(true);
byDateCreated.setText("Date Created");
byDateCreated.setImageDescriptor(TasksUiImages.CALENDAR_SMALL);
- item = new ActionContributionItem(byDateCreated);
- item.fill(dropDownMenu, -1);
+ new ActionContributionItem(byDateCreated).fill(dropDownMenu, -1);
+ new Separator().fill(dropDownMenu, -1);
+
+ Action reverse = new Action("", AS_CHECK_BOX) {
+ @Override
+ public void run() {
+ taskListView.setSortDirection(taskListView.sortDirection * -1);
+ setChecked(taskListView.sortDirection < 0);
+ }
+ };
+ reverse.setEnabled(true);
+ reverse.setText("Descending");
+ reverse.setChecked(taskListView.sortDirection < 0);
+ new ActionContributionItem(reverse).fill(dropDownMenu, -1);
+
switch (taskListView.getSortByIndex()) {
case PRIORITY:
byPriority.setChecked(true);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index 7d3cd2d84..1506362d2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -796,7 +796,8 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
linkValue = Boolean.parseBoolean(taskListMemento.getString(MEMENTO_LINK_WITH_EDITOR));
}
setLinkWithEditor(linkValue);
-
+
+ getViewer().setSorter(new TaskListTableSorter(this, sortByIndex));
getViewer().refresh();
}
@@ -1697,6 +1698,11 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
this.sortByIndex = sortByIndex;
getViewer().setSorter(new TaskListTableSorter(this, sortByIndex));
}
+
+ public void setSortDirection(int sortDirection) {
+ this.sortDirection = sortDirection;
+ getViewer().setSorter(new TaskListTableSorter(this, sortByIndex));
+ }
public SortByIndex getSortByIndex() {
return sortByIndex;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
index 117ffcd95..4f9c3bf64 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
@@ -995,7 +995,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
if (getDuplicateSearchCollectorsList() != null) {
allCollectors.addAll(getDuplicateSearchCollectorsList());
}
- if (allCollectors.isEmpty()) {
+ if (!allCollectors.isEmpty()) {
duplicateDetectorLabel = new Label(relatedBugsComposite, SWT.LEFT);
duplicateDetectorLabel.setText(LABEL_SELECT_DETECTOR);
@@ -1046,9 +1046,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
}
public boolean searchForDuplicates() {
-
String duplicateDetectorName = duplicateDetectorChooser.getItem(duplicateDetectorChooser.getSelectionIndex());
-
// called so that the description text is set on taskData before we
// search for duplicates
this.saveTaskOffline(new NullProgressMonitor());

Back to the top