Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 130300 Details for
Bug 216150
2nd level sorting in Search view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch for 3.2
patch216150.txt (text/plain), 25.18 KB, created by
Frank Becker
on 2009-03-30 15:52:09 EDT
(
hide
)
Description:
patch for 3.2
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2009-03-30 15:52:09 EDT
Size:
25.18 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/messages.properties,v >retrieving revision 1.4 >diff -u -r1.4 messages.properties >--- src/org/eclipse/mylyn/internal/tasks/ui/search/messages.properties 16 Jan 2009 06:14:44 -0000 1.4 >+++ src/org/eclipse/mylyn/internal/tasks/ui/search/messages.properties 30 Mar 2009 19:51:24 -0000 >@@ -6,6 +6,7 @@ > RepositorySearchResultView_Create_Query_from_Search_=Create Query from Search... > RepositorySearchResultView_Filter_Completed_Tasks=Filter Completed Tasks > RepositorySearchResultView_Group_By_Owner=Group By Owner >+RepositorySearchResultView_Group_By_Complete=Group By Complete > RepositorySearchResultView_Open_in_Editor=Open in Editor > RepositorySearchResultView_Open_Search_with_Browser_Label=Open Search with Browser > RepositorySearchResultView_Refine_Search_=Refine Search... >@@ -25,3 +26,5 @@ > SearchResultTreeContentProvider_Complete=Complete > SearchResultTreeContentProvider_Incomplete=Incomplete > SearchResultTreeContentProvider__unknown_=<unknown> >+ >+SearchResultSortAction_Sort_Label=Sort... >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/Messages.java,v >retrieving revision 1.4 >diff -u -r1.4 Messages.java >--- src/org/eclipse/mylyn/internal/tasks/ui/search/Messages.java 16 Jan 2009 06:14:44 -0000 1.4 >+++ src/org/eclipse/mylyn/internal/tasks/ui/search/Messages.java 30 Mar 2009 19:51:24 -0000 >@@ -41,6 +41,8 @@ > > public static String RepositorySearchResultView_Group_By_Owner; > >+ public static String RepositorySearchResultView_Group_By_Complete; >+ > public static String RepositorySearchResultView_Open_in_Editor; > > public static String RepositorySearchResultView_Open_Search_with_Browser_Label; >@@ -72,4 +74,6 @@ > public static String SearchResultTreeContentProvider_Incomplete; > > public static String SearchResultTreeContentProvider__unknown_; >+ >+ public static String SearchResultSortAction_Sort_Label; > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSortAction.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSortAction.java,v >retrieving revision 1.7 >diff -u -r1.7 SearchResultSortAction.java >--- src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSortAction.java 13 Jan 2009 07:07:36 -0000 1.7 >+++ src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSortAction.java 30 Mar 2009 19:51:24 -0000 >@@ -12,6 +12,9 @@ > package org.eclipse.mylyn.internal.tasks.ui.search; > > import org.eclipse.jface.action.Action; >+import org.eclipse.jface.window.IShellProvider; >+import org.eclipse.jface.window.Window; >+import org.eclipse.mylyn.internal.tasks.ui.dialogs.TaskCompareDialog; > > /** > * This class sorts search results by a supplied category. >@@ -20,11 +23,9 @@ > */ > public class SearchResultSortAction extends Action { > >- /** The category that this class sorts Bugzilla search results by. */ >- private final int bugSortOrder; >+ private final TaskCompareDialog dialog; > >- /** The view where the Bugzilla search results are displayed. */ >- private final RepositorySearchResultView bugPage; >+ SearchResultSorter searchResultSorter; > > /** > * Constructor >@@ -36,10 +37,11 @@ > * @param sortOrder > * The category that this class sorts Bugzilla search results by > */ >- public SearchResultSortAction(String label, RepositorySearchResultView page, int sortOrder) { >- super(label); >- bugPage = page; >- bugSortOrder = sortOrder; >+ public SearchResultSortAction(IShellProvider site, SearchResultSorter searchResultSorter) { >+ super(Messages.SearchResultSortAction_Sort_Label); >+ setEnabled(true); >+ dialog = new TaskCompareDialog(site, searchResultSorter.getTaskComparator()); >+ this.searchResultSorter = searchResultSorter; > } > > /** >@@ -47,13 +49,8 @@ > */ > @Override > public void run() { >- bugPage.setSortOrder(bugSortOrder); >- } >- >- /** >- * Returns the category that this class sorts Bugzilla search results by. >- */ >- public int getSortOrder() { >- return bugSortOrder; >+ if (dialog.open() == Window.OK) { >+ searchResultSorter.refreshView(); >+ } > } > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorter.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorter.java,v >retrieving revision 1.1 >diff -u -r1.1 SearchResultSorter.java >--- src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorter.java 18 Jan 2009 08:53:02 -0000 1.1 >+++ src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorter.java 30 Mar 2009 19:51:24 -0000 >@@ -13,23 +13,30 @@ > > import org.eclipse.jface.viewers.Viewer; > import org.eclipse.jface.viewers.ViewerSorter; >-import org.eclipse.mylyn.internal.tasks.core.AbstractTask; > import org.eclipse.mylyn.internal.tasks.ui.util.TaskComparator; >-import org.eclipse.mylyn.internal.tasks.ui.views.TaskKeyComparator; >+import org.eclipse.mylyn.internal.tasks.ui.util.TaskComparator.SortByIndex; > import org.eclipse.mylyn.tasks.core.ITask; > > /** >- * Sorts search results by summary. >+ * Sorts search results. > * > * @author Rob Elves >+ * @author Frank Becker > */ > public class SearchResultSorter extends ViewerSorter { > >- private final TaskKeyComparator taskKeyComparator = new TaskKeyComparator(); >+ private final RepositorySearchResultView view; >+ >+ private final TaskComparator taskComparator = new TaskComparator(); >+ >+ public SearchResultSorter(RepositorySearchResultView view) { >+ super(); >+ this.view = view; >+ } > > /** >- * Returns a negative, zero, or positive number depending on whether the first bug's summary goes before, is the >- * same as, or goes after the second element's summary. >+ * Returns a negative, zero, or positive number depending on whether the first bug's taskId is less than, equal to, >+ * or greater than the second bug's taskId. > * <p> > * > * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, >@@ -37,22 +44,13 @@ > */ > @Override > public int compare(Viewer viewer, Object e1, Object e2) { >- try { >- >- AbstractTask entry1 = (AbstractTask) e1; >- AbstractTask entry2 = (AbstractTask) e2; >- // NOTE we just comparing ids here, once summary and taskId separated >- // they should have their own column/sorter. >- return taskKeyComparator.compare(TaskComparator.getSortableFromElement(entry1), >- TaskComparator.getSortableFromElement(entry2)); >- // return taskKeyComparator.compare(entry1.getDescription(), >- // entry2.getDescription()); >- } catch (Exception ignored) { >- // do nothing >+ if (e1 instanceof ITask && e2 instanceof ITask) { >+ ITask entry1 = (ITask) e1; >+ ITask entry2 = (ITask) e2; >+ return taskComparator.compare(entry1, entry2); >+ } else { >+ return super.compare(viewer, e1, e2); > } >- >- // if that didn't work, use the default compare method >- return super.compare(viewer, e1, e2); > } > > /** >@@ -69,9 +67,50 @@ > ITask hit = (ITask) element; > return Integer.parseInt(hit.getTaskId()); > } catch (Exception ignored) { >- // ignore if >+ // ignore if there is a problem > } > // if that didn't work, use the default category method > return super.category(element); > } >+ >+ public int getSortDirection() { >+ return taskComparator.getSortDirection(); >+ } >+ >+ public void setSortDirection(int sortDirection) { >+ taskComparator.setSortDirection(sortDirection); >+ } >+ >+ public SortByIndex getSortByIndex() { >+ return taskComparator.getSortByIndex(); >+ } >+ >+ public void setSortByIndex(SortByIndex sortByIndex) { >+ taskComparator.setSortByIndex(sortByIndex); >+ } >+ >+ public int getSortDirection2() { >+ return taskComparator.getSortDirection2(); >+ } >+ >+ public void setSortDirection2(int sortDirection) { >+ taskComparator.setSortDirection2(sortDirection); >+ } >+ >+ public SortByIndex getSortByIndex2() { >+ return taskComparator.getSortByIndex2(); >+ } >+ >+ public void setSortByIndex2(SortByIndex sortByIndex) { >+ taskComparator.setSortByIndex2(sortByIndex); >+ } >+ >+ public TaskComparator getTaskComparator() { >+ return taskComparator; >+ } >+ >+ public void refreshView() { >+ view.setCurrentSortOrder2Preference(); >+ view.getViewer().refresh(); >+ } > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterPriority.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterPriority.java >diff -N src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterPriority.java >--- src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterPriority.java 13 Jan 2009 07:07:36 -0000 1.11 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,65 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2008 Tasktop Technologies and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * Tasktop Technologies - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.mylyn.internal.tasks.ui.search; >- >-import org.eclipse.jface.viewers.Viewer; >-import org.eclipse.jface.viewers.ViewerSorter; >-import org.eclipse.mylyn.tasks.core.ITask; >- >-/** >- * Sorts results of Bugzilla search by bug priority. >- * >- * @author Rob Elves (modifications) >- */ >-public class SearchResultSorterPriority extends ViewerSorter { >- >- /** >- * Returns a negative, zero, or positive number depending on whether the first bug's priority goes before, is the >- * same as, or goes after the second element's priority. >- * <p> >- * >- * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, >- * java.lang.Object) >- */ >- @Override >- public int compare(Viewer viewer, Object e1, Object e2) { >- try { >- ITask hit1 = (ITask) e1; >- ITask hit2 = (ITask) e2; >- return hit1.getPriority().compareTo(hit2.getPriority()); >- } catch (Exception ignored) { >- // do nothing >- } >- // if that didn't work, use the default compare method >- return super.compare(viewer, e1, e2); >- } >- >- /** >- * Returns the category of the given element. The category is a number used to allocate elements to bins; the bins >- * are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort >- * criterion. >- * <p> >- * >- * @see org.eclipse.jface.viewers.ViewerSorter#category(Object) >- */ >- @Override >- public int category(Object element) { >- try { >- ITask hit = (ITask) element; >- return Integer.parseInt(hit.getTaskId()); >- } catch (Exception ignored) { >- // ignore if there is a problem >- } >- // if that didn't work, use the default category method >- return super.category(element); >- } >-} >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java,v >retrieving revision 1.62 >diff -u -r1.62 RepositorySearchResultView.java >--- src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java 18 Jan 2009 08:53:02 -0000 1.62 >+++ src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java 30 Mar 2009 19:51:24 -0000 >@@ -41,6 +41,7 @@ > import org.eclipse.mylyn.internal.tasks.ui.actions.OpenTaskSearchAction; > import org.eclipse.mylyn.internal.tasks.ui.actions.OpenWithBrowserAction; > import org.eclipse.mylyn.internal.tasks.ui.search.SearchResultTreeContentProvider.GroupBy; >+import org.eclipse.mylyn.internal.tasks.ui.util.TaskComparator; > import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; > import org.eclipse.mylyn.internal.tasks.ui.views.TaskListToolTip; > import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; >@@ -129,27 +130,16 @@ > } > } > >- public static final int ORDER_PRIORITY = 1; >- >- public static final int ORDER_DESCRIPTION = 2; >- >- public static final int ORDER_SEVERITY = 3; >- >- public static final int ORDER_STATUS = 4; >- >- public static final int ORDER_ID = 5; >- >- public static final int ORDER_DEFAULT = ORDER_PRIORITY; >- > private static final String KEY_SORTING = TasksUiPlugin.ID_PLUGIN + ".search.resultpage.sorting"; //$NON-NLS-1$ > >- private SearchResultContentProvider searchResultProvider; >+ private static final String KEY_SORTING2 = TasksUiPlugin.ID_PLUGIN + ".search.resultpage.sorting2"; //$NON-NLS-1$ > >- private int currentSortOrder; >+ private static final String KEY_SORTINGDIRECTION = TasksUiPlugin.ID_PLUGIN + ".search.resultpage.sortingdirection"; //$NON-NLS-1$ > >- private final SearchResultSortAction sortByPriorityAction; >+ private static final String KEY_SORTINGDIRECTION2 = TasksUiPlugin.ID_PLUGIN >+ + ".search.resultpage.sortingdirection2"; //$NON-NLS-1$ > >- private final SearchResultSortAction sortByDescriptionAction; >+ private SearchResultContentProvider searchResultProvider; > > private final OpenSearchResultAction openInEditorAction; > >@@ -167,6 +157,10 @@ > > private final OpenWithBrowserAction openSearchWithBrowserAction; > >+ private SearchResultSorter searchResultSorter; >+ >+ private SearchResultSortAction sortByDialogAction; >+ > private static final IShowInTargetList SHOW_IN_TARGET_LIST = new IShowInTargetList() { > public String[] getShowInTargetIds() { > return SHOW_IN_TARGETS; >@@ -177,12 +171,6 @@ > // Only use the table layout. > super(FLAG_LAYOUT_TREE); > >- sortByPriorityAction = new SearchResultSortAction(Messages.RepositorySearchResultView_Task_Priority, this, >- ORDER_PRIORITY); >- sortByDescriptionAction = new SearchResultSortAction(Messages.RepositorySearchResultView_Task_Summary, this, >- ORDER_DESCRIPTION); >- currentSortOrder = ORDER_DEFAULT; >- > openInEditorAction = new OpenSearchResultAction(Messages.RepositorySearchResultView_Open_in_Editor, this); > createQueryAction = new CreateQueryFromSearchAction( > Messages.RepositorySearchResultView_Create_Query_from_Search_, this); >@@ -193,7 +181,7 @@ > > groupingActions = new ArrayList<GroupingAction>(); > new GroupingAction(Messages.RepositorySearchResultView_Group_By_Owner, GroupBy.OWNER); >- //new GroupingAction("Group By Complete", GroupBy.COMPLETION); >+// new GroupingAction(Messages.RepositorySearchResultView_Group_By_Complete, GroupBy.COMPLETION); > > filterActions = new ArrayList<FilteringAction>(); > new FilteringAction(Messages.RepositorySearchResultView_Filter_Completed_Tasks, new ViewerFilter() { >@@ -241,11 +229,13 @@ > DecoratingLabelProvider labelProvider = new DecoratingLabelProvider(new SearchResultsLabelProvider( > searchResultProvider, viewer), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()); > viewer.setLabelProvider(labelProvider); >+ searchResultSorter = new SearchResultSorter(this); >+ viewer.setSorter(searchResultSorter); >+ sortByDialogAction = new SearchResultSortAction(getSite(), searchResultSorter); > > // Set the order when the search view is loading so that the items are > // sorted right away >- setSortOrder(currentSortOrder); >- >+ restoreCurrentSortOrder2Preference(); > toolTip = new TaskListToolTip(viewer.getControl()); > } > >@@ -318,36 +308,6 @@ > super.dispose(); > } > >- /** >- * Sets the new sorting category, and reorders all of the tasks. >- * >- * @param sortOrder >- * The new category to sort by >- */ >- public void setSortOrder(int sortOrder) { >- StructuredViewer viewer = getViewer(); >- >- switch (sortOrder) { >- case ORDER_ID: >- viewer.setSorter(new SearchResultSorterId()); >- break; >- case ORDER_DESCRIPTION: >- viewer.setSorter(new SearchResultSorter()); >- break; >- case ORDER_PRIORITY: >- viewer.setSorter(new SearchResultSorterPriority()); >- break; >- default: >- // If the setting is not one of the four valid ones, >- // use the default order setting. >- sortOrder = ORDER_DEFAULT; >- viewer.setSorter(new SearchResultSorterPriority()); >- break; >- } >- currentSortOrder = sortOrder; >- getSettings().put(KEY_SORTING, currentSortOrder); >- } >- > @SuppressWarnings("unchecked") > public Object getAdapter(Class adapter) { > return getAdapterDelegate(adapter); >@@ -372,7 +332,6 @@ > super.fillContextMenu(menuManager); > > // open actions >- > menuManager.appendToGroup(IContextMenuConstants.GROUP_OPEN, openInEditorAction); > > // Add to Task List menu >@@ -404,16 +363,7 @@ > menuManager.appendToGroup(IContextMenuConstants.GROUP_SEARCH, refineSearchAction); > menuManager.appendToGroup(IContextMenuConstants.GROUP_SEARCH, openSearchWithBrowserAction); > >- // sort actions >- >- MenuManager sortMenuManager = new MenuManager(Messages.RepositorySearchResultView_Sort_by); >- sortMenuManager.add(sortByPriorityAction); >- sortMenuManager.add(sortByDescriptionAction); >- >- sortByPriorityAction.setChecked(currentSortOrder == sortByPriorityAction.getSortOrder()); >- sortByDescriptionAction.setChecked(currentSortOrder == sortByDescriptionAction.getSortOrder()); >- >- menuManager.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortMenuManager); >+ menuManager.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortByDialogAction); > for (Action action : groupingActions) { > menuManager.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, action); > } >@@ -468,4 +418,106 @@ > } > } > >+ public void restoreCurrentSortOrder2Preference() { >+ int restoredSortIndex = 0; >+ int restoredSortDirection = 1; >+ int restoredSortIndex2 = 2; >+ int restoredSortDirection2 = 1; >+ String preferenceString = getSettings().get(KEY_SORTING); >+ >+ if (preferenceString != null) { >+ try { >+ restoredSortIndex = Integer.parseInt(preferenceString); >+ } catch (NumberFormatException e) { >+ restoredSortIndex = 0; >+ } >+ } >+ preferenceString = getSettings().get(KEY_SORTINGDIRECTION); >+ if (preferenceString != null) { >+ try { >+ restoredSortDirection = Integer.parseInt(preferenceString); >+ } catch (NumberFormatException e) { >+ restoredSortDirection = 1; >+ } >+ } >+ preferenceString = getSettings().get(KEY_SORTING2); >+ if (preferenceString != null) { >+ try { >+ restoredSortIndex2 = Integer.parseInt(preferenceString); >+ } catch (NumberFormatException e) { >+ restoredSortIndex2 = 2; >+ } >+ } >+ preferenceString = getSettings().get(KEY_SORTINGDIRECTION2); >+ if (preferenceString != null) { >+ try { >+ restoredSortDirection2 = Integer.parseInt(preferenceString); >+ } catch (NumberFormatException e) { >+ restoredSortDirection2 = 1; >+ } >+ } >+ >+ switch (restoredSortIndex) { >+ case 1: >+ searchResultSorter.setSortByIndex(TaskComparator.SortByIndex.SUMMARY); >+ break; >+ case 2: >+ searchResultSorter.setSortByIndex(TaskComparator.SortByIndex.DATE_CREATED); >+ break; >+ case 3: >+ searchResultSorter.setSortByIndex(TaskComparator.SortByIndex.TASK_ID); >+ break; >+ default: >+ searchResultSorter.setSortByIndex(TaskComparator.SortByIndex.PRIORITY); >+ } >+ >+ searchResultSorter.setSortDirection(restoredSortDirection2); >+ switch (restoredSortIndex2) { >+ case 1: >+ searchResultSorter.setSortByIndex2(TaskComparator.SortByIndex.SUMMARY); >+ break; >+ case 2: >+ searchResultSorter.setSortByIndex2(TaskComparator.SortByIndex.DATE_CREATED); >+ break; >+ case 3: >+ searchResultSorter.setSortByIndex2(TaskComparator.SortByIndex.TASK_ID); >+ break; >+ default: >+ searchResultSorter.setSortByIndex2(TaskComparator.SortByIndex.PRIORITY); >+ } >+ searchResultSorter.setSortDirection(restoredSortDirection); >+ searchResultSorter.setSortDirection2(restoredSortDirection2); >+ } >+ >+ public void setCurrentSortOrder2Preference() { >+ getSettings().put(KEY_SORTINGDIRECTION, searchResultSorter.getSortDirection()); >+ switch (searchResultSorter.getSortByIndex()) { >+ case SUMMARY: >+ getSettings().put(KEY_SORTING, 1); >+ break; >+ case DATE_CREATED: >+ getSettings().put(KEY_SORTING, 2); >+ break; >+ case TASK_ID: >+ getSettings().put(KEY_SORTING, 3); >+ break; >+ default: >+ getSettings().put(KEY_SORTING, 0); >+ } >+ >+ getSettings().put(KEY_SORTINGDIRECTION2, searchResultSorter.getSortDirection2()); >+ switch (searchResultSorter.getSortByIndex2()) { >+ case SUMMARY: >+ getSettings().put(KEY_SORTING2, 1); >+ break; >+ case DATE_CREATED: >+ getSettings().put(KEY_SORTING2, 2); >+ break; >+ case TASK_ID: >+ getSettings().put(KEY_SORTING2, 3); >+ break; >+ default: >+ getSettings().put(KEY_SORTING2, 0); >+ } >+ } > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterId.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterId.java >diff -N src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterId.java >--- src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterId.java 13 Jan 2009 07:07:36 -0000 1.10 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,73 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2008 Tasktop Technologies and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * Tasktop Technologies - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.mylyn.internal.tasks.ui.search; >- >-import org.eclipse.jface.viewers.Viewer; >-import org.eclipse.jface.viewers.ViewerSorter; >-import org.eclipse.mylyn.tasks.core.ITask; >- >-/** >- * Sorts search results (AbstractQueryHit) by taskId. >- */ >-public class SearchResultSorterId extends ViewerSorter { >- >- /** >- * Returns a negative, zero, or positive number depending on whether the first bug's taskId is less than, equal to, >- * or greater than the second bug's taskId. >- * <p> >- * >- * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, >- * java.lang.Object) >- */ >- @Override >- public int compare(Viewer viewer, Object e1, Object e2) { >- try { >- // cast the object and get its bug taskId >- ITask entry1 = (ITask) e1; >- Integer id1 = Integer.parseInt(entry1.getTaskId()); >- >- // cast the other object and get its bug taskId >- ITask entry2 = (ITask) e2; >- Integer id2 = Integer.parseInt(entry2.getTaskId()); >- >- // if neither is null, compare the bug taskId's >- if (id1 != null && id2 != null) { >- return id1.compareTo(id2); >- } >- } catch (Exception ignored) { >- // ignore if there is a problem >- } >- >- // if that didn't work, use the default compare method >- return super.compare(viewer, e1, e2); >- } >- >- /** >- * Returns the category of the given element. The category is a number used to allocate elements to bins; the bins >- * are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort >- * criterion. >- * <p> >- * >- * @see org.eclipse.jface.viewers.ViewerSorter#category(Object) >- */ >- @Override >- public int category(Object element) { >- try { >- ITask hit = (ITask) element; >- return Integer.parseInt(hit.getTaskId()); >- } catch (Exception ignored) { >- // ignore >- } >- // if that didn't work, use the default category method >- return super.category(element); >- } >-} >Index: .refactorings/2009/3/13/refactorings.history >=================================================================== >RCS file: .refactorings/2009/3/13/refactorings.history >diff -N .refactorings/2009/3/13/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2009/3/13/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<session version="1.0"> >+<refactoring accessors="true" comment="Delete 2 element(s) from project 'org.eclipse.mylyn.tasks.ui'
- Original project: 'org.eclipse.mylyn.tasks.ui'
- Original elements:
 org.eclipse.mylyn.internal.tasks.ui.search.SearchResultSorterId.java
 org.eclipse.mylyn.internal.tasks.ui.search.SearchResultSorterPriority.java" description="Delete elements" element1="/src<org.eclipse.mylyn.internal.tasks.ui.search{SearchResultSorterId.java" element2="/src<org.eclipse.mylyn.internal.tasks.ui.search{SearchResultSorterPriority.java" elements="2" flags="589830" id="org.eclipse.jdt.ui.delete" resources="0" stamp="1238277505401" subPackages="false" version="1.0"/> >+</session> >\ No newline at end of file >Index: .refactorings/2009/3/13/refactorings.index >=================================================================== >RCS file: .refactorings/2009/3/13/refactorings.index >diff -N .refactorings/2009/3/13/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2009/3/13/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1 @@ >+1238277505401 Delete elements
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 216150
:
89347
|
89348
|
89358
|
89359
|
90557
|
90558
|
90583
|
90584
|
95415
|
95416
|
116103
|
116104
| 130300 |
130301
|
134922