Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-04-16 18:16:05 -0400
committerspingel2011-04-16 18:16:05 -0400
commitede2ae6580d77d5c9be9a8d9080e3eefca83c6b8 (patch)
tree0701776947126512898536e04b44c228d04a9625 /org.eclipse.mylyn.tasks.search
parent79dc8e94c47053b685db395227a58af530f29864 (diff)
downloadorg.eclipse.mylyn.tasks-ede2ae6580d77d5c9be9a8d9080e3eefca83c6b8.tar.gz
org.eclipse.mylyn.tasks-ede2ae6580d77d5c9be9a8d9080e3eefca83c6b8.tar.xz
org.eclipse.mylyn.tasks-ede2ae6580d77d5c9be9a8d9080e3eefca83c6b8.zip
NEW - bug 335068: Add "Hide Completed Tasks" button to search view
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335068
Diffstat (limited to 'org.eclipse.mylyn.tasks.search')
-rw-r--r--org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java47
1 files changed, 27 insertions, 20 deletions
diff --git a/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java b/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java
index 350ba97a3..e6962a824 100644
--- a/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java
+++ b/org.eclipse.mylyn.tasks.search/src/org/eclipse/mylyn/internal/tasks/ui/search/RepositorySearchResultView.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionManager;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
@@ -32,6 +33,7 @@ import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.provisional.commons.ui.DecoratingPatternStyledCellLabelProvider;
import org.eclipse.mylyn.internal.provisional.commons.ui.EnhancedFilteredTree;
import org.eclipse.mylyn.internal.provisional.commons.ui.SubstringPatternFilter;
@@ -173,22 +175,26 @@ public class RepositorySearchResultView extends AbstractTextSearchViewPage imple
openSearchWithBrowserAction.setText(Messages.RepositorySearchResultView_Open_Search_with_Browser_Label);
groupingActions = new ArrayList<GroupingAction>();
- new GroupingAction(Messages.RepositorySearchResultView_Group_By_Owner, GroupBy.OWNER);
+ GroupingAction groupByOwnerAction = new GroupingAction(Messages.RepositorySearchResultView_Group_By_Owner,
+ GroupBy.OWNER);
+ groupByOwnerAction.setImageDescriptor(CommonImages.PRESENTATION);
// new GroupingAction(Messages.RepositorySearchResultView_Group_By_Complete, GroupBy.COMPLETION);
filterActions = new ArrayList<FilteringAction>();
- new FilteringAction(Messages.RepositorySearchResultView_Filter_Completed_Tasks, new ViewerFilter() {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof ITask) {
- return !((ITask) element).isCompleted();
- } else if (element instanceof TaskGroup) {
- TaskGroup taskGroup = (TaskGroup) element;
- return taskGroup.getHandleIdentifier().equals("group-incompleteIncomplete"); //$NON-NLS-1$
- }
- return true;
- }
- });
+ FilteringAction filterCompleteAction = new FilteringAction(
+ Messages.RepositorySearchResultView_Filter_Completed_Tasks, new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof ITask) {
+ return !((ITask) element).isCompleted();
+ } else if (element instanceof TaskGroup) {
+ TaskGroup taskGroup = (TaskGroup) element;
+ return taskGroup.getHandleIdentifier().equals("group-incompleteIncomplete"); //$NON-NLS-1$
+ }
+ return true;
+ }
+ });
+ filterCompleteAction.setImageDescriptor(CommonImages.FILTER_COMPLETE);
// construct early since to be ready when restoreState() is invoked
searchResultSorter = new SearchResultSorter();
@@ -369,13 +375,7 @@ public class RepositorySearchResultView extends AbstractTextSearchViewPage imple
menuManager.appendToGroup(IContextMenuConstants.GROUP_SEARCH, openSearchWithBrowserAction);
menuManager.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortByDialogAction);
- for (Action action : groupingActions) {
- menuManager.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, action);
- }
- for (Action action : filterActions) {
- menuManager.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, action);
- }
-
+ addPresentationActions(menuManager);
}
private void moveToCategory(AbstractTaskCategory category) {
@@ -393,6 +393,13 @@ public class RepositorySearchResultView extends AbstractTextSearchViewPage imple
public void createControl(Composite parent) {
super.createControl(parent);
IMenuManager menuManager = getSite().getActionBars().getMenuManager();
+ menuManager.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, sortByDialogAction);
+ addPresentationActions(menuManager);
+
+ addPresentationActions(getSite().getActionBars().getToolBarManager());
+ }
+
+ public void addPresentationActions(IContributionManager menuManager) {
for (Action action : groupingActions) {
menuManager.appendToGroup(IContextMenuConstants.GROUP_VIEWER_SETUP, action);
}

Back to the top