Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 338499 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/tasks/core/AbstractTask.java (-3 / +4 lines)
Lines 13-21 Link Here
13
13
14
import java.util.Collections;
14
import java.util.Collections;
15
import java.util.Date;
15
import java.util.Date;
16
import java.util.HashSet;
17
import java.util.Map;
16
import java.util.Map;
18
import java.util.Set;
17
import java.util.Set;
18
import java.util.concurrent.CopyOnWriteArraySet;
19
19
20
import org.eclipse.core.runtime.Assert;
20
import org.eclipse.core.runtime.Assert;
21
import org.eclipse.core.runtime.IStatus;
21
import org.eclipse.core.runtime.IStatus;
Lines 52-58 Link Here
52
52
53
	private boolean reminded = false;
53
	private boolean reminded = false;
54
54
55
	private final Set<AbstractTaskContainer> containers = new HashSet<AbstractTaskContainer>();
55
	private final Set<AbstractTaskContainer> containers = new CopyOnWriteArraySet<AbstractTaskContainer>();
56
56
57
	// ************ Synch ****************
57
	// ************ Synch ****************
58
58
Lines 317-323 Link Here
317
	}
317
	}
318
318
319
	public Set<AbstractTaskContainer> getParentContainers() {
319
	public Set<AbstractTaskContainer> getParentContainers() {
320
		return new HashSet<AbstractTaskContainer>(containers);
320
		//return new HashSet<AbstractTaskContainer>(containers);
321
		return containers;
321
	}
322
	}
322
323
323
	@Override
324
	@Override
(-)src/org/eclipse/mylyn/internal/tasks/core/ITasksCoreConstants.java (+2 lines)
Lines 59-64 Link Here
59
59
60
	public static final String ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND = "outgoingNewConnectorKind"; //$NON-NLS-1$
60
	public static final String ATTRIBUTE_OUTGOING_NEW_CONNECTOR_KIND = "outgoingNewConnectorKind"; //$NON-NLS-1$
61
61
62
	public static final String ATTRIBUTE_HIDDEN = "task.common.hidden"; //$NON-NLS-1$
63
62
	public static final String ATTRIBUTE_TASK_EXTENDED_TOOLTIP = "task.common.extended.tooltip"; //$NON-NLS-1$
64
	public static final String ATTRIBUTE_TASK_EXTENDED_TOOLTIP = "task.common.extended.tooltip"; //$NON-NLS-1$
63
65
64
	public static final String ATTRIBUTE_TASK_SUPPRESS_INCOMING = "task.common.suppress.incoming"; //$NON-NLS-1$
66
	public static final String ATTRIBUTE_TASK_SUPPRESS_INCOMING = "task.common.suppress.incoming"; //$NON-NLS-1$
(-)src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java (-1 / +6 lines)
Lines 15-20 Link Here
15
15
16
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
16
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
17
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
17
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
18
import org.eclipse.mylyn.internal.tasks.ui.views.PresentationFilter;
18
import org.eclipse.mylyn.tasks.core.ITask;
19
import org.eclipse.mylyn.tasks.core.ITask;
19
import org.eclipse.mylyn.tasks.core.ITaskContainer;
20
import org.eclipse.mylyn.tasks.core.ITaskContainer;
20
21
Lines 52-59 Link Here
52
			return false;
53
			return false;
53
		}
54
		}
54
55
56
		if (!PresentationFilter.getInstance().select(null, container)) {
57
			return false;
58
		}
59
55
		for (ITask task : children) {
60
		for (ITask task : children) {
56
			if (task != null) {
61
			if (task != null && PresentationFilter.getInstance().select(container, task)) {
57
				ITask containedRepositoryTask = task;
62
				ITask containedRepositoryTask = task;
58
				if (TasksUiInternal.shouldShowIncoming(containedRepositoryTask)) {
63
				if (TasksUiInternal.shouldShowIncoming(containedRepositoryTask)) {
59
					return true;
64
					return true;
(-)src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java (+4 lines)
Lines 44-49 Link Here
44
44
45
	public static final String FILTER_COMPLETE_MODE = "org.eclipse.mylyn.tasks.ui.filters.complete"; //$NON-NLS-1$
45
	public static final String FILTER_COMPLETE_MODE = "org.eclipse.mylyn.tasks.ui.filters.complete"; //$NON-NLS-1$
46
46
47
	public static final String FILTER_HIDDEN = "org.eclipse.mylyn.tasks.ui.filters.hidden"; //$NON-NLS-1$
48
49
	public static final String FILTER_NON_MATCHING = "org.eclipse.mylyn.tasks.ui.filters.nonmatching"; //$NON-NLS-1$
50
47
	public static final String FILTER_PRIORITY = "org.eclipse.mylyn.tasks.ui.filters.priority"; //$NON-NLS-1$
51
	public static final String FILTER_PRIORITY = "org.eclipse.mylyn.tasks.ui.filters.priority"; //$NON-NLS-1$
48
52
49
	public static final String GROUP_SUBTASKS = "org.eclipse.mylyn.tasks.ui.group.subtasks"; //$NON-NLS-1$
53
	public static final String GROUP_SUBTASKS = "org.eclipse.mylyn.tasks.ui.group.subtasks"; //$NON-NLS-1$
(-)src/org/eclipse/mylyn/internal/tasks/ui/actions/GroupSubTasksAction.java (-19 / +2 lines)
Lines 14-20 Link Here
14
import org.eclipse.jface.action.Action;
14
import org.eclipse.jface.action.Action;
15
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
15
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
16
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
16
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
17
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
18
17
19
/**
18
/**
20
 * @author Rob Elves
19
 * @author Rob Elves
Lines 24-37 Link Here
24
23
25
	public static final String ID = "org.eclipse.mylyn.tasklist.actions.filter.subtasks"; //$NON-NLS-1$
24
	public static final String ID = "org.eclipse.mylyn.tasklist.actions.filter.subtasks"; //$NON-NLS-1$
26
25
27
	private final TaskListView view;
26
	public GroupSubTasksAction() {
28
29
	public GroupSubTasksAction(TaskListView view) {
30
		this.view = view;
31
		setText(Messages.GroupSubTasksAction_Group_Subtasks);
27
		setText(Messages.GroupSubTasksAction_Group_Subtasks);
32
		setToolTipText(Messages.GroupSubTasksAction_Group_Subtasks);
28
		setToolTipText(Messages.GroupSubTasksAction_Group_Subtasks);
33
		setId(ID);
29
		setId(ID);
34
		// setImageDescriptor(TasksUiImages.FILTER_COMPLETE);
35
		setChecked(TasksUiPlugin.getDefault()
30
		setChecked(TasksUiPlugin.getDefault()
36
				.getPreferenceStore()
31
				.getPreferenceStore()
37
				.getBoolean(ITasksUiPreferenceConstants.GROUP_SUBTASKS));
32
				.getBoolean(ITasksUiPreferenceConstants.GROUP_SUBTASKS));
Lines 42-59 Link Here
42
		TasksUiPlugin.getDefault()
37
		TasksUiPlugin.getDefault()
43
				.getPreferenceStore()
38
				.getPreferenceStore()
44
				.setValue(ITasksUiPreferenceConstants.GROUP_SUBTASKS, isChecked());
39
				.setValue(ITasksUiPreferenceConstants.GROUP_SUBTASKS, isChecked());
45
		// TODO: refresh not getting rid of subtasks
46
47
		view.refresh(true);
48
//		try {
49
//			view.getViewer().getControl().setRedraw(false);
50
//			view.getViewer().collapseAll();
51
//			if (view.isFocusedMode()) {
52
//				view.getViewer().expandAll();
53
//			}
54
//			view.getViewer().refresh();
55
//		} finally {
56
//			view.getViewer().getControl().setRedraw(true);
57
//		}
58
	}
40
	}
41
59
}
42
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/actions/HideQueryAction.java (+72 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2009 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.actions;
13
14
import java.util.Collections;
15
16
import org.eclipse.core.runtime.CoreException;
17
import org.eclipse.core.runtime.IProgressMonitor;
18
import org.eclipse.core.runtime.IStatus;
19
import org.eclipse.core.runtime.Status;
20
import org.eclipse.jface.viewers.IStructuredSelection;
21
import org.eclipse.mylyn.commons.core.StatusHandler;
22
import org.eclipse.mylyn.internal.tasks.core.ITaskListRunnable;
23
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
24
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
25
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
26
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
27
import org.eclipse.ui.actions.BaseSelectionListenerAction;
28
29
/**
30
 * @author Steffen Pingel
31
 */
32
public class HideQueryAction extends BaseSelectionListenerAction {
33
34
	public HideQueryAction() {
35
		super("Hidden");
36
		setChecked(false);
37
		setEnabled(false);
38
	}
39
40
	@Override
41
	protected boolean updateSelection(IStructuredSelection selection) {
42
		if (selection.size() == 1) {
43
			Object element = selection.getFirstElement();
44
			if (element instanceof IRepositoryQuery) {
45
				setChecked(Boolean.parseBoolean((((IRepositoryQuery) element).getAttribute(ITasksCoreConstants.ATTRIBUTE_HIDDEN))));
46
				return true;
47
			}
48
		}
49
		setChecked(false);
50
		return false;
51
	}
52
53
	@Override
54
	public void run() {
55
		final Object element = getStructuredSelection().getFirstElement();
56
		if (element instanceof IRepositoryQuery) {
57
			try {
58
				final IRepositoryQuery query = ((IRepositoryQuery) element);
59
				TasksUiPlugin.getTaskList().run(new ITaskListRunnable() {
60
					public void execute(IProgressMonitor monitor) throws CoreException {
61
						query.setAttribute(ITasksCoreConstants.ATTRIBUTE_HIDDEN, Boolean.toString(isChecked()));
62
					}
63
				});
64
				TasksUiPlugin.getTaskList().notifyElementsChanged(Collections.singleton((IRepositoryElement) query));
65
			} catch (CoreException e) {
66
				StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
67
						"Failed to set hidden status for query", e)); //$NON-NLS-1$
68
			}
69
		}
70
	}
71
72
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/actions/RepositoryElementActionGroup.java (+3 lines)
Lines 100-105 Link Here
100
100
101
	private final AutoUpdateQueryAction autoUpdateAction;
101
	private final AutoUpdateQueryAction autoUpdateAction;
102
102
103
	protected final HideQueryAction hideQueryAction;
104
103
	private final NewSubTaskAction newSubTaskAction;
105
	private final NewSubTaskAction newSubTaskAction;
104
106
105
	private final CloneTaskAction cloneTaskAction;
107
	private final CloneTaskAction cloneTaskAction;
Lines 131-136 Link Here
131
		showInTaskListAction = add(new ShowInTaskListAction());
133
		showInTaskListAction = add(new ShowInTaskListAction());
132
134
133
		autoUpdateAction = add(new AutoUpdateQueryAction());
135
		autoUpdateAction = add(new AutoUpdateQueryAction());
136
		hideQueryAction = add(new HideQueryAction());
134
	}
137
	}
135
138
136
	private <T extends ISelectionChangedListener> T add(T action) {
139
	private <T extends ISelectionChangedListener> T add(T action) {
(-)src/org/eclipse/mylyn/internal/tasks/ui/actions/ShowAllQueriesAction.java (+36 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.actions;
13
14
import org.eclipse.jface.action.Action;
15
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
16
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
17
18
/**
19
 * @author Steffen Pingel
20
 */
21
public class ShowAllQueriesAction extends Action {
22
23
	public ShowAllQueriesAction() {
24
		setText("Show All Queries");
25
		setToolTipText("Show All Queries Including Hidden Queries");
26
		setChecked(!TasksUiPlugin.getDefault().getPreferenceStore().contains(ITasksUiPreferenceConstants.FILTER_HIDDEN));
27
	}
28
29
	@Override
30
	public void run() {
31
		TasksUiPlugin.getDefault()
32
				.getPreferenceStore()
33
				.setValue(ITasksUiPreferenceConstants.FILTER_HIDDEN, !isChecked());
34
	}
35
36
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/actions/ShowNonMatchingSubtasksAction.java (+38 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.actions;
13
14
import org.eclipse.jface.action.Action;
15
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
16
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
17
18
/**
19
 * @author Steffen Pingel
20
 */
21
public class ShowNonMatchingSubtasksAction extends Action {
22
23
	public ShowNonMatchingSubtasksAction() {
24
		setText("Show Non Matching Subtasks");
25
		setToolTipText("Show Non Matching Subtasks");
26
		setChecked(!TasksUiPlugin.getDefault()
27
				.getPreferenceStore()
28
				.contains(ITasksUiPreferenceConstants.FILTER_NON_MATCHING));
29
	}
30
31
	@Override
32
	public void run() {
33
		TasksUiPlugin.getDefault()
34
				.getPreferenceStore()
35
				.setValue(ITasksUiPreferenceConstants.FILTER_NON_MATCHING, !isChecked());
36
	}
37
38
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java (+5 lines)
Lines 13-18 Link Here
13
13
14
import org.eclipse.jface.action.IMenuManager;
14
import org.eclipse.jface.action.IMenuManager;
15
import org.eclipse.jface.viewers.IStructuredSelection;
15
import org.eclipse.jface.viewers.IStructuredSelection;
16
import org.eclipse.mylyn.internal.tasks.ui.views.PresentationFilter;
16
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
17
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
17
import org.eclipse.mylyn.tasks.core.ITask;
18
import org.eclipse.mylyn.tasks.core.ITask;
18
import org.eclipse.mylyn.tasks.core.ITaskContainer;
19
import org.eclipse.mylyn.tasks.core.ITaskContainer;
Lines 62-67 Link Here
62
	public void fillContextMenu(final IMenuManager manager) {
63
	public void fillContextMenu(final IMenuManager manager) {
63
		super.fillContextMenu(manager);
64
		super.fillContextMenu(manager);
64
65
66
		if (hideQueryAction.isEnabled() && !PresentationFilter.getInstance().isFilterHiddenQueries()) {
67
			manager.appendToGroup(ID_SEPARATOR_NAVIGATE, hideQueryAction);
68
		}
69
65
		updateDrillDownActions();
70
		updateDrillDownActions();
66
71
67
		Object element = ((IStructuredSelection) view.getViewer().getSelection()).getFirstElement();
72
		Object element = ((IStructuredSelection) view.getViewer().getSelection()).getFirstElement();
(-)src/org/eclipse/mylyn/internal/tasks/ui/views/PresentationFilter.java (+95 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.views;
13
14
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
15
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
16
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
17
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
18
import org.eclipse.mylyn.internal.tasks.ui.AbstractTaskListFilter;
19
import org.eclipse.mylyn.tasks.core.IAttributeContainer;
20
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
21
import org.eclipse.mylyn.tasks.core.ITask;
22
23
/**
24
 * @author Steffen Pingel
25
 */
26
public class PresentationFilter extends AbstractTaskListFilter {
27
28
	private static PresentationFilter instance = new PresentationFilter();
29
30
	private boolean filterHiddenQueries;
31
32
	private boolean filterSubtasks;
33
34
	private PresentationFilter() {
35
		setFilterHiddenQueries(true);
36
		setFilterSubtasks(true);
37
	}
38
39
	public static PresentationFilter getInstance() {
40
		return instance;
41
	}
42
43
	public boolean isFilterSubtasks() {
44
		return filterSubtasks;
45
	}
46
47
	public boolean isFilterHiddenQueries() {
48
		return filterHiddenQueries;
49
	}
50
51
	public void setFilterHiddenQueries(boolean enabled) {
52
		this.filterHiddenQueries = enabled;
53
	}
54
55
	public void setFilterSubtasks(boolean filterSubtasks) {
56
		this.filterSubtasks = filterSubtasks;
57
	}
58
59
	@Override
60
	public boolean select(Object parent, Object element) {
61
		// filter hidden queries
62
		if (element instanceof IRepositoryQuery) {
63
			if (!filterHiddenQueries) {
64
				return true;
65
			}
66
			return isQueryVisible(element);
67
		}
68
		// filter sub-tasks not connected to queries or categories
69
		if (element instanceof AbstractTask) {
70
			if (!filterSubtasks) {
71
				return true;
72
			}
73
			if (((ITask) element).getTaskId().equals("20196")) {
74
				System.err.println();
75
			}
76
			for (AbstractTaskContainer container : ((AbstractTask) element).getParentContainers()) {
77
				// categories are always visible
78
				if (container instanceof AbstractTaskCategory) {
79
					return true;
80
				}
81
				// show task if is contained in a query
82
				if (container instanceof IRepositoryQuery && isQueryVisible(container)) {
83
					return true;
84
				}
85
			}
86
			return false;
87
		}
88
		return true;
89
	}
90
91
	private boolean isQueryVisible(Object element) {
92
		return !Boolean.parseBoolean(((IAttributeContainer) element).getAttribute(ITasksCoreConstants.ATTRIBUTE_HIDDEN));
93
	}
94
95
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListInterestFilter.java (-16 / +18 lines)
Lines 47-64 Link Here
47
				return isDateRangeInteresting(dateRangeTaskContainer);
47
				return isDateRangeInteresting(dateRangeTaskContainer);
48
			}
48
			}
49
			if (child instanceof ITask) {
49
			if (child instanceof ITask) {
50
				AbstractTask task = null;
50
				AbstractTask task = (AbstractTask) child;
51
				if (child instanceof ITask) {
51
				return isInteresting(parent, task);
52
					task = (AbstractTask) child;
52
			}
53
				}
53
			if (child instanceof ITaskContainer) {
54
				if (task != null) {
55
					if (isInteresting(parent, task)) {
56
						return true;
57
					} else {
58
						return false;
59
					}
60
				}
61
			} else if (child instanceof ITaskContainer) {
62
				Collection<ITask> children = ((ITaskContainer) child).getChildren();
54
				Collection<ITask> children = ((ITaskContainer) child).getChildren();
63
				// Always display empty containers
55
				// Always display empty containers
64
				if (children.size() == 0) {
56
				if (children.size() == 0) {
Lines 70-76 Link Here
70
						return true;
62
						return true;
71
					}
63
					}
72
				}
64
				}
73
74
			}
65
			}
75
		} catch (Throwable t) {
66
		} catch (Throwable t) {
76
			StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Interest filter failed", t)); //$NON-NLS-1$
67
			StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Interest filter failed", t)); //$NON-NLS-1$
Lines 84-90 Link Here
84
		}
75
		}
85
		if (scheduleContainer instanceof TaskScheduleContentProvider.Incoming
76
		if (scheduleContainer instanceof TaskScheduleContentProvider.Incoming
86
				|| scheduleContainer instanceof TaskScheduleContentProvider.Outgoing) {
77
				|| scheduleContainer instanceof TaskScheduleContentProvider.Outgoing) {
87
			return (scheduleContainer.getChildren().size() > 0);
78
			return hasChildren(scheduleContainer, scheduleContainer.getChildren());
88
		}
79
		}
89
		if (TaskActivityUtil.getCurrentWeek().isCurrentWeekDay(scheduleContainer.getDateRange())) {
80
		if (TaskActivityUtil.getCurrentWeek().isCurrentWeekDay(scheduleContainer.getDateRange())) {
90
			if (scheduleContainer.isPresent() || scheduleContainer.isFuture()) {
81
			if (scheduleContainer.isPresent() || scheduleContainer.isFuture()) {
Lines 96-108 Link Here
96
		return false;
87
		return false;
97
	}
88
	}
98
89
90
	private boolean hasChildren(Object parent, Collection<ITask> children) {
91
		for (ITask task : children) {
92
			if (PresentationFilter.getInstance().select(parent, task)) {
93
				return true;
94
			}
95
		}
96
		return false;
97
	}
98
99
	// TODO: make meta-context more explicit
99
	// TODO: make meta-context more explicit
100
	protected boolean isInteresting(Object parent, AbstractTask task) {
100
	protected boolean isInteresting(Object parent, AbstractTask task) {
101
		return shouldAlwaysShow(parent, task, ITasksCoreConstants.MAX_SUBTASK_DEPTH);
101
		return shouldAlwaysShow(parent, task, ITasksCoreConstants.MAX_SUBTASK_DEPTH);
102
	}
102
	}
103
103
104
	public boolean shouldAlwaysShow(Object parent, AbstractTask task, int depth) {
104
	public boolean shouldAlwaysShow(Object parent, AbstractTask task, int depth) {
105
105
		if (!PresentationFilter.getInstance().select(parent, task)) {
106
			return false;
107
		}
106
		return task.isActive() || TasksUiPlugin.getTaskActivityManager().isCompletedToday(task)
108
		return task.isActive() || TasksUiPlugin.getTaskActivityManager().isCompletedToday(task)
107
				|| hasChanges(parent, task)
109
				|| hasChanges(parent, task)
108
				|| hasInterestingSubTasks(parent, task, depth)
110
				|| hasInterestingSubTasks(parent, task, depth)
Lines 182-188 Link Here
182
		}
184
		}
183
		if (task instanceof ITaskContainer) {
185
		if (task instanceof ITaskContainer) {
184
			for (ITask child : ((ITaskContainer) task).getChildren()) {
186
			for (ITask child : ((ITaskContainer) task).getChildren()) {
185
				if (hasChangesHelper(parent, child)) {
187
				if (PresentationFilter.getInstance().select(task, child) && hasChangesHelper(parent, child)) {
186
					return true;
188
					return true;
187
				}
189
				}
188
			}
190
			}
(-)src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java (-6 / +30 lines)
Lines 90-95 Link Here
90
import org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskAction;
90
import org.eclipse.mylyn.internal.tasks.ui.actions.NewTaskAction;
91
import org.eclipse.mylyn.internal.tasks.ui.actions.OpenTasksUiPreferencesAction;
91
import org.eclipse.mylyn.internal.tasks.ui.actions.OpenTasksUiPreferencesAction;
92
import org.eclipse.mylyn.internal.tasks.ui.actions.PresentationDropDownSelectionAction;
92
import org.eclipse.mylyn.internal.tasks.ui.actions.PresentationDropDownSelectionAction;
93
import org.eclipse.mylyn.internal.tasks.ui.actions.ShowAllQueriesAction;
94
import org.eclipse.mylyn.internal.tasks.ui.actions.ShowNonMatchingSubtasksAction;
93
import org.eclipse.mylyn.internal.tasks.ui.actions.SynchronizeAutomaticallyAction;
95
import org.eclipse.mylyn.internal.tasks.ui.actions.SynchronizeAutomaticallyAction;
94
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskListSortAction;
96
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskListSortAction;
95
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskListViewActionGroup;
97
import org.eclipse.mylyn.internal.tasks.ui.actions.TaskListViewActionGroup;
Lines 357-363 Link Here
357
359
358
	private FilterCompletedTasksAction filterCompleteTask;
360
	private FilterCompletedTasksAction filterCompleteTask;
359
361
360
	private GroupSubTasksAction filterSubTasksAction;
362
	private GroupSubTasksAction groupSubTasksAction;
361
363
362
	private SynchronizeAutomaticallyAction synchronizeAutomatically;
364
	private SynchronizeAutomaticallyAction synchronizeAutomatically;
363
365
Lines 380-385 Link Here
380
382
381
	private final TaskArchiveFilter filterArchive = new TaskArchiveFilter();
383
	private final TaskArchiveFilter filterArchive = new TaskArchiveFilter();
382
384
385
	private final PresentationFilter filterPresentation = PresentationFilter.getInstance();
386
383
	private TaskWorkingSetFilter filterWorkingSet;
387
	private TaskWorkingSetFilter filterWorkingSet;
384
388
385
	private final Set<AbstractTaskListFilter> filters = new HashSet<AbstractTaskListFilter>();
389
	private final Set<AbstractTaskListFilter> filters = new HashSet<AbstractTaskListFilter>();
Lines 536-541 Link Here
536
					|| event.getProperty().equals(ITasksUiPreferenceConstants.OVERLAYS_INCOMING_TIGHT)) {
540
					|| event.getProperty().equals(ITasksUiPreferenceConstants.OVERLAYS_INCOMING_TIGHT)) {
537
				refreshJob.refresh();
541
				refreshJob.refresh();
538
			}
542
			}
543
			if (event.getProperty().equals(ITasksUiPreferenceConstants.FILTER_HIDDEN)
544
					|| event.getProperty().equals(ITasksUiPreferenceConstants.FILTER_NON_MATCHING)
545
					|| event.getProperty().equals(ITasksUiPreferenceConstants.GROUP_SUBTASKS)) {
546
				updatePresentationFilter();
547
				refresh(true);
548
			}
539
		}
549
		}
540
	};
550
	};
541
551
Lines 670-679 Link Here
670
		if (TasksUiPlugin.getDefault().getPreferenceStore().contains(ITasksUiPreferenceConstants.FILTER_COMPLETE_MODE)) {
680
		if (TasksUiPlugin.getDefault().getPreferenceStore().contains(ITasksUiPreferenceConstants.FILTER_COMPLETE_MODE)) {
671
			addFilter(filterComplete);
681
			addFilter(filterComplete);
672
		}
682
		}
673
683
		updatePresentationFilter();
674
		//if (TasksUiPlugin.getDefault().getPreferenceStore().contains(TasksUiPreferenceConstants.FILTER_ARCHIVE_MODE)) {
684
		addFilter(filterPresentation);
675
		addFilter(filterArchive);
685
		addFilter(filterArchive);
676
		//}
677
686
678
		// Restore "link with editor" value; by default true
687
		// Restore "link with editor" value; by default true
679
		boolean linkValue = true;
688
		boolean linkValue = true;
Lines 689-694 Link Here
689
		getViewer().refresh();
698
		getViewer().refresh();
690
	}
699
	}
691
700
701
	public void updatePresentationFilter() {
702
		filterPresentation.setFilterHiddenQueries(TasksUiPlugin.getDefault()
703
				.getPreferenceStore()
704
				.contains(ITasksUiPreferenceConstants.FILTER_HIDDEN));
705
		filterPresentation.setFilterSubtasks(TasksUiPlugin.getDefault()
706
				.getPreferenceStore()
707
				.contains(ITasksUiPreferenceConstants.FILTER_NON_MATCHING));
708
	}
709
692
	/**
710
	/**
693
	 * Public for testing only.
711
	 * Public for testing only.
694
	 */
712
	 */
Lines 1198-1204 Link Here
1198
		manager.add(sortDialogAction);
1216
		manager.add(sortDialogAction);
1199
		manager.add(filterOnPriorityAction);
1217
		manager.add(filterOnPriorityAction);
1200
		manager.add(filterCompleteTask);
1218
		manager.add(filterCompleteTask);
1201
		manager.add(filterSubTasksAction);
1219
		IMenuManager advancedMenu = new MenuManager("Advanced Filters");
1220
		advancedMenu.add(new ShowAllQueriesAction());
1221
		advancedMenu.add(new ShowNonMatchingSubtasksAction());
1222
		advancedMenu.add(new Separator());
1223
		advancedMenu.add(groupSubTasksAction);
1224
		manager.add(advancedMenu);
1202
1225
1203
		manager.add(new Separator(ID_SEPARATOR_SEARCH));
1226
		manager.add(new Separator(ID_SEPARATOR_SEARCH));
1204
		manager.add(new GroupMarker(ID_SEPARATOR_TASKS));
1227
		manager.add(new GroupMarker(ID_SEPARATOR_TASKS));
Lines 1262-1268 Link Here
1262
		collapseAll = new CollapseAllAction(this);
1285
		collapseAll = new CollapseAllAction(this);
1263
		expandAll = new ExpandAllAction(this);
1286
		expandAll = new ExpandAllAction(this);
1264
		filterCompleteTask = new FilterCompletedTasksAction(this);
1287
		filterCompleteTask = new FilterCompletedTasksAction(this);
1265
		filterSubTasksAction = new GroupSubTasksAction(this);
1288
		groupSubTasksAction = new GroupSubTasksAction();
1266
		synchronizeAutomatically = new SynchronizeAutomaticallyAction();
1289
		synchronizeAutomatically = new SynchronizeAutomaticallyAction();
1267
		openPreferencesAction = new OpenTasksUiPreferencesAction();
1290
		openPreferencesAction = new OpenTasksUiPreferencesAction();
1268
		//filterArchiveCategory = new FilterArchiveContainerAction(this);
1291
		//filterArchiveCategory = new FilterArchiveContainerAction(this);
Lines 1346-1351 Link Here
1346
		filters.clear();
1369
		filters.clear();
1347
		filters.add(filterArchive);
1370
		filters.add(filterArchive);
1348
		filters.add(filterWorkingSet);
1371
		filters.add(filterWorkingSet);
1372
		filters.add(filterPresentation);
1349
	}
1373
	}
1350
1374
1351
	public void removeFilter(AbstractTaskListFilter filter) {
1375
	public void removeFilter(AbstractTaskListFilter filter) {
(-)src/org/eclipse/mylyn/internal/tasks/ui/views/TaskScheduleContentProvider.java (-1 lines)
Lines 184-190 Link Here
184
					result.add(child);
184
					result.add(child);
185
				}
185
				}
186
			}
186
			}
187
188
		} else if (parent instanceof ITaskContainer) {
187
		} else if (parent instanceof ITaskContainer) {
189
			for (ITask child : ((ITaskContainer) parent).getChildren()) {
188
			for (ITask child : ((ITaskContainer) parent).getChildren()) {
190
				result.add(child);
189
				result.add(child);

Return to bug 338499