Added same project filter by cagatayk@acm.org
diff --git a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/FiltersDialog.java b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/FiltersDialog.java
index 3036328..c35fe86 100644
--- a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/FiltersDialog.java
+++ b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/FiltersDialog.java
@@ -1,9 +1,16 @@
 package org.eclipse.ui.views.tasklist;

 

-/*

- * (c) Copyright IBM Corp. 2000, 2001.

- * All Rights Reserved.

- */

+/**********************************************************************

+Copyright (c) 2000, 2001, 2002, International Business Machines Corp and others.

+All rights reserved.   This program and the accompanying materials

+are made available under the terms of the Common Public License v0.5

+which accompanies this distribution, and is available at

+http://www.eclipse.org/legal/cpl-v05.html


+Contributors:

+  Cagatay Kavukcuoglu <cagatayk@acm.org> - Filter for markers in same project

+**********************************************************************/

+

 import org.eclipse.ui.help.*;

 import org.eclipse.core.resources.IMarker;

 import org.eclipse.jface.dialogs.Dialog;

@@ -165,6 +172,7 @@
 	

 	private CheckboxTreeViewer typesViewer;

 	private Button anyResourceButton;

+	private Button anyResourceInSameProjectButton; // added by cagatayk@acm.org

 	private Button selectedResourceButton;

 	private Button selectedResourceAndChildrenButton;

 	private LabelComboTextGroup descriptionGroup;

@@ -312,6 +320,7 @@
 	group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

 	group.setLayout(new GridLayout());

 	anyResourceButton = createRadioButton(group, TaskListMessages.getString("TaskList.anyResource")); //$NON-NLS-1$

+	anyResourceInSameProjectButton = createRadioButton(group, TaskListMessages.getString("TaskList.anyResourceInSameProject")); //$NON-NLS-1$ // added by cagatayk@acm.org

 	selectedResourceButton = createRadioButton(group, TaskListMessages.getString("TaskList.selectedResource")); //$NON-NLS-1$

 	selectedResourceAndChildrenButton = createRadioButton(group, TaskListMessages.getString("TaskList.selectedAndChildren")); //$NON-NLS-1$

 }

@@ -578,6 +587,8 @@
 		filter.onResource = TasksFilter.ON_SELECTED_RESOURCE_ONLY;

 	else if (selectedResourceAndChildrenButton.getSelection())

 		filter.onResource = TasksFilter.ON_SELECTED_RESOURCE_AND_CHILDREN;

+	else if (anyResourceInSameProjectButton.getSelection()) // added by cagatayk@acm.org

+		filter.onResource = TasksFilter.ON_ANY_RESOURCE_OF_SAME_PROJECT;

 	else

 		filter.onResource = TasksFilter.ON_ANY_RESOURCE;

 

@@ -605,6 +616,7 @@
 

 	int on = filter.onResource;

 	anyResourceButton.setSelection(on == TasksFilter.ON_ANY_RESOURCE);

+	anyResourceInSameProjectButton.setSelection(on == TasksFilter.ON_ANY_RESOURCE_OF_SAME_PROJECT); // added by cagatayk@acm.org

 	selectedResourceButton.setSelection(on == TasksFilter.ON_SELECTED_RESOURCE_ONLY);

 	selectedResourceAndChildrenButton.setSelection(on == TasksFilter.ON_SELECTED_RESOURCE_AND_CHILDREN);

 

diff --git a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TaskList.java b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TaskList.java
index 7c28bb5..2c8060b 100644
--- a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TaskList.java
+++ b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TaskList.java
@@ -1,9 +1,16 @@
 package org.eclipse.ui.views.tasklist;

 

-/*

- * (c) Copyright IBM Corp. 2000, 2001.

- * All Rights Reserved.

- */

+/**********************************************************************

+Copyright (c) 2000, 2001, 2002, International Business Machines Corp and others.

+All rights reserved.   This program and the accompanying materials

+are made available under the terms of the Common Public License v0.5

+which accompanies this distribution, and is available at

+http://www.eclipse.org/legal/cpl-v05.html


+Contributors:

+  Cagatay Kavukcuoglu <cagatayk@acm.org> - Filter for markers in same project

+**********************************************************************/

+

 import org.eclipse.core.resources.*;

 import org.eclipse.core.runtime.*;

 import org.eclipse.ui.*;

@@ -869,6 +876,7 @@
 	switch (getFilter().onResource) {

 		case TasksFilter.ON_ANY_RESOURCE:

 		case TasksFilter.ON_SELECTED_RESOURCE_AND_CHILDREN:

+		case TasksFilter.ON_ANY_RESOURCE_OF_SAME_PROJECT: // added by cagatayk@acm.org

 		default:

 			return true;

 		case TasksFilter.ON_SELECTED_RESOURCE_ONLY:

@@ -879,12 +887,20 @@
 	switch (getFilter().onResource) {

 		case TasksFilter.ON_SELECTED_RESOURCE_ONLY:

 		case TasksFilter.ON_SELECTED_RESOURCE_AND_CHILDREN:

+		case TasksFilter.ON_ANY_RESOURCE_OF_SAME_PROJECT: // added by cagatayk@acm.org

 			return true;

 		case TasksFilter.ON_ANY_RESOURCE:

 		default:

 			return false;

 	}

 }

+

+/**

+ * Added by cagatayk@acm.org 

+ */

+boolean showOwnerProject() {

+	return getFilter().onResource == TasksFilter.ON_ANY_RESOURCE_OF_SAME_PROJECT;

+}

 /**

  * Processes state change of the 'showSelections' switch.

  * If true, it will resync with the saved input element.

@@ -958,9 +974,14 @@
 			}

 		}

 	}

+	

 	if (resource != null && !resource.equals(focusResource)) {

+		// showOwnerProject() handling added by cagatayk@acm.org

+		boolean updateNeeded = showOwnerProject() && 

+				!resource.getProject().equals(

+						focusResource != null ? focusResource.getProject() : null);

 		focusResource = resource;

-		if (showSelections()) {

+		if ((showSelections() && !showOwnerProject()) || updateNeeded) {

 			viewer.refresh();

 			updateStatusMessage();

 			updateTitle();

diff --git a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TaskListContentProvider.java b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TaskListContentProvider.java
index 3aa6cbc..1aad35b 100644
--- a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TaskListContentProvider.java
+++ b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TaskListContentProvider.java
@@ -1,9 +1,16 @@
 package org.eclipse.ui.views.tasklist;

 

-/*

- * (c) Copyright IBM Corp. 2000, 2001.

- * All Rights Reserved.

- */

+/**********************************************************************

+Copyright (c) 2000, 2001, 2002, International Business Machines Corp and others.

+All rights reserved.   This program and the accompanying materials

+are made available under the terms of the Common Public License v0.5

+which accompanies this distribution, and is available at

+http://www.eclipse.org/legal/cpl-v05.html


+Contributors:

+  Cagatay Kavukcuoglu <cagatayk@acm.org> - Filter for markers in same project

+**********************************************************************/

+

 import org.eclipse.core.resources.*;

 import org.eclipse.core.runtime.*;

 import org.eclipse.jface.dialogs.ErrorDialog;

@@ -44,6 +51,9 @@
 	if (taskList.showSelections() && !taskList.showChildrenHierarchy()) {

 		return resource.equals(taskList.getResource());

 	}

+	else if (taskList.showOwnerProject()) { // added by cagatayk@acm.org

+		return taskList.getResource().getProject().equals(resource.getProject());

+	}

 	else {

 		return taskList.getResource().getFullPath().isPrefixOf(resource.getFullPath());

 	}

@@ -167,6 +177,16 @@
 	if (!res.exists()) {

 		return new IMarker[0];

 	}

+	

+	// added by cagatayk@acm.org

+	if (taskList.showOwnerProject()) {

+		IResource project = res.getProject();

+		

+		// leave it alone if it's workspace root

+		if (project != null)

+			res = project;

+	}

+	

 	int depth = taskList.getResourceDepth();

 	String[] types = taskList.getMarkerTypes();

 	ArrayList list = new ArrayList();

diff --git a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TasksFilter.java b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TasksFilter.java
index a8f379f..1112537 100644
--- a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TasksFilter.java
+++ b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/TasksFilter.java
@@ -1,9 +1,16 @@
 package org.eclipse.ui.views.tasklist;

 

-/*

- * (c) Copyright IBM Corp. 2000, 2001.

- * All Rights Reserved.

- */

+/**********************************************************************

+Copyright (c) 2000, 2001, 2002, International Business Machines Corp and others.

+All rights reserved.   This program and the accompanying materials

+are made available under the terms of the Common Public License v0.5

+which accompanies this distribution, and is available at

+http://www.eclipse.org/legal/cpl-v05.html


+Contributors:

+  Cagatay Kavukcuoglu <cagatayk@acm.org> - Filter for markers in same project

+**********************************************************************/

+

 import org.eclipse.ui.IMemento;

 import org.eclipse.core.resources.IMarker;

 import org.eclipse.core.runtime.CoreException;

@@ -20,6 +27,7 @@
 	static final int ON_ANY_RESOURCE = 0;

 	static final int ON_SELECTED_RESOURCE_ONLY = 1;

 	static final int ON_SELECTED_RESOURCE_AND_CHILDREN = 2;

+	static final int ON_ANY_RESOURCE_OF_SAME_PROJECT = 3; // added by cagatayk@acm.org

 

 	// Description filter kind constants

 	static final int FILTER_CONTAINS = 0;

@@ -49,6 +57,7 @@
 	private static final String TAG_PRIORITY_FILTER = "priorityFilter"; //$NON-NLS-1$

 	private static final String TAG_FILTER_ON_COMPLETION = "filterOnCompletion"; //$NON-NLS-1$

 	private static final String TAG_COMPLETION_FILTER = "completionFilter"; //$NON-NLS-1$

+	

 public TasksFilter() {

 	reset();

 }

diff --git a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/messages.properties b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/messages.properties
index 03594d1..07539b4 100644
--- a/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/messages.properties
+++ b/bundles/org.eclipse.ui/Eclipse UI Standard Components/org/eclipse/ui/views/tasklist/messages.properties
@@ -1,6 +1,12 @@
 # ==============================================================================

-# (c) Copyright IBM Corp. 2000, 2001.

-# All Rights Reserved.

+# Copyright (c) 2000, 2001, 2002, International Business Machines Corp and others.

+# All rights reserved.   This program and the accompanying materials

+# are made available under the terms of the Common Public License v0.5

+# which accompanies this distribution, and is available at

+# http://www.eclipse.org/legal/cpl-v05.html

+#  

+# Contributors:

+#   Cagatay Kavukcuoglu <cagatayk@acm.org> - Filter for markers in same project

 # ==============================================================================

 

 # package: org.eclipse.ui.views.tasklist

@@ -9,6 +15,7 @@
 # ==============================================================================

 # TaskList

 # ==============================================================================

+

 TaskList.line = line {0}

 TaskList.lineAndLocation = line {0} in {1}

 

@@ -74,6 +81,7 @@
 TaskList.showEntriesOfType = Show entries of &type:

 

 TaskList.anyResource = On &any resource

+TaskList.anyResourceInSameProject = On any resource in same &project

 TaskList.selectedResource = On selected resource &only

 TaskList.selectedAndChildren = On selected resource and its &children

 

@@ -86,7 +94,7 @@
 TaskList.severity.warning = Warnin&g

 TaskList.severity.info = &Info

 

-TaskList.priority.label = Where task &priority is:

+TaskList.priority.label = Where task priorit&y is:

 TaskList.priority.high = &High

 TaskList.priority.low = Lo&w

 TaskList.priority.normal = &Normal

@@ -96,9 +104,3 @@
 TaskList.status.notCompleted = Not Comp&leted

 

 TaskList.resetText = &Reset

-

-

-

-

-

-