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 185479 Details for
Bug 286963
[api] add support for ignoring incoming notification on specified fields
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 v2
clipboard.txt (text/plain), 7.75 KB, created by
Thomas Ehrnhoefer
on 2010-12-18 12:19:31 EST
(
hide
)
Description:
patch v2
Filename:
MIME Type:
Creator:
Thomas Ehrnhoefer
Created:
2010-12-18 12:19:31 EST
Size:
7.75 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/mylyn/org.eclipse.mylyn.tasks/org.eclipse.mylyn.tasks.ui/plugin.properties,v >retrieving revision 1.14 >diff -u -r1.14 plugin.properties >--- plugin.properties 8 Jun 2010 23:10:09 -0000 1.14 >+++ plugin.properties 18 Dec 2010 17:13:53 -0000 >@@ -164,6 +164,8 @@ > command.showToolTip.name = Show Tooltip Description > command.markTaskRead.name = Mark Task Read > command.markTaskUnread.name = Mark Task Unread >+command.markSimilarTasksRead.name = Mark all Similar Tasks as Read >+command.markPlanningIncomingsRead.name = Mark Planning Incomings as Read > command.markTaskReadGoToNextUnread.name = Mark Task Read and Go To Next Unread Task > command.markTaskReadGoToPreviousUnread.name = Mark Task Read and Go To Previous Unread Task > command.markTaskComplete.name = Mark Task Complete >@@ -188,6 +190,8 @@ > menu.task.mark.label = &Mark as > command.markTaskRead.label = Read > command.markTaskUnread.label = Unread >+command.markAllSimilarTasksRead.label = Read (all Similar Incomings) >+command.markPlanningIncomingsRead.label = Read (all Planning Incomings) > command.task.clearOutgoing.label = Clear Outgoing > command.markTaskComplete.label = Complete > command.markTaskIncomplete.label = Incomplete >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/mylyn/org.eclipse.mylyn.tasks/org.eclipse.mylyn.tasks.ui/plugin.xml,v >retrieving revision 1.389 >diff -u -r1.389 plugin.xml >--- plugin.xml 26 Sep 2010 03:48:26 -0000 1.389 >+++ plugin.xml 18 Dec 2010 17:13:56 -0000 >@@ -1216,6 +1216,12 @@ > </command> > <command > categoryId="org.eclipse.mylyn.tasks.ui.commands" >+ defaultHandler="org.eclipse.mylyn.internal.tasks.ui.commands.MarkTaskHandler$MarkSimilarTasksReadHandler" >+ id="org.eclipse.mylyn.tasks.ui.command.markAllSimilarTasksRead" >+ name="%command.markSimilarTasksRead.name"> >+ </command> >+ <command >+ categoryId="org.eclipse.mylyn.tasks.ui.commands" > defaultHandler="org.eclipse.mylyn.internal.tasks.ui.commands.MarkTaskHandler$MarkTaskUnreadHandler" > id="org.eclipse.mylyn.tasks.ui.command.markTaskUnread" > name="%command.markTaskUnread.name"> >@@ -1728,6 +1734,17 @@ > </visibleWhen> > </command> > <command >+ commandId="org.eclipse.mylyn.tasks.ui.command.markAllSimilarTasksRead" >+ label="%command.markAllSimilarTasksRead.label" >+ style="push"> >+ <visibleWhen >+ checkEnabled="false"> >+ <reference >+ definitionId="org.eclipse.mylyn.tasks.ui.expressions.repositoryElements"> >+ </reference> >+ </visibleWhen> >+ </command> >+ <command > commandId="org.eclipse.mylyn.tasks.ui.command.task.clearOutgoing" > label="%command.task.clearOutgoing.label" > mnemonic="C" >Index: src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java >=================================================================== >RCS file: /cvsroot/mylyn/org.eclipse.mylyn.tasks/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java,v >retrieving revision 1.14 >diff -u -r1.14 MarkTaskHandler.java >--- src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java 8 Jun 2010 23:10:09 -0000 1.14 >+++ src/org/eclipse/mylyn/internal/tasks/ui/commands/MarkTaskHandler.java 18 Dec 2010 17:13:56 -0000 >@@ -11,8 +11,10 @@ > > package org.eclipse.mylyn.internal.tasks.ui.commands; > >+import java.util.Collection; > import java.util.Collections; > import java.util.Date; >+import java.util.Iterator; > > import org.eclipse.core.commands.ExecutionEvent; > import org.eclipse.core.commands.ExecutionException; >@@ -21,11 +23,15 @@ > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; > import org.eclipse.mylyn.internal.tasks.ui.actions.ClearOutgoingAction; > import org.eclipse.mylyn.internal.tasks.ui.editors.Messages; >+import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskAttributeDiff; >+import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskDataDiff; >+import org.eclipse.mylyn.internal.tasks.ui.notifications.TaskListNotifier; > import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; > import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; > import org.eclipse.mylyn.monitor.ui.MonitorUi; > import org.eclipse.mylyn.tasks.core.IRepositoryElement; > import org.eclipse.mylyn.tasks.core.ITask; >+import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState; > > /** > * @author Steffen Pingel >@@ -115,4 +121,60 @@ > } > } > >+ public static class MarkSimilarTasksReadHandler extends AbstractTaskHandler { >+ public static final String ID_COMMAND = "org.eclipse.mylyn.tasks.ui.command.markAllSimilarTasksRead"; //$NON-NLS-1$ >+ >+ @Override >+ protected void execute(ExecutionEvent event, ITask currentTask) throws ExecutionException { >+ //get incomings of the current task (only first level attributes) >+ TaskListNotifier currentNotifier = new TaskListNotifier(TasksUiPlugin.getRepositoryModel(), >+ TasksUiPlugin.getTaskDataManager()); >+ TaskDataDiff currentDiff = currentNotifier.getDiff(currentTask); >+ if (currentDiff != null && TasksUiPlugin.getTaskList() != null) { >+ //go through all tasks in tasklist of the given repository >+ for (ITask otherTask : TasksUiPlugin.getTaskList().getTasks(currentTask.getRepositoryUrl())) { >+ if (otherTask != currentTask >+ && otherTask.getSynchronizationState() == SynchronizationState.INCOMING) { >+ boolean isSameChange = false; >+ isSameChange = isEqualChangedAttributesSet(currentDiff, otherTask, isSameChange); >+ if (isSameChange) { >+ TasksUiPlugin.getTaskDataManager().setTaskRead(otherTask, true); >+ } >+ } >+ } >+ } >+ TasksUiPlugin.getTaskDataManager().setTaskRead(currentTask, true); >+ } >+ >+ private boolean isEqualChangedAttributesSet(TaskDataDiff currentDiff, ITask otherTask, boolean isSameChange) { >+ //only check other tasks which have incomings for exactly the same set of changed attributes >+ TaskListNotifier otherNotifier = new TaskListNotifier(TasksUiPlugin.getRepositoryModel(), >+ TasksUiPlugin.getTaskDataManager()); >+ TaskDataDiff otherDiff = otherNotifier.getDiff(otherTask); >+ Collection<TaskAttributeDiff> otherChangedAttributes = otherDiff.getChangedAttributes(); >+ if (otherDiff != null && currentDiff.getChangedAttributes().size() == otherChangedAttributes.size()) { >+ //same diff size, compare individual changed attributes >+ Iterator<TaskAttributeDiff> currentIterator = currentDiff.getChangedAttributes().iterator(); >+ while (currentIterator.hasNext()) { >+ TaskAttributeDiff currentAttributeDiff = currentIterator.next(); >+ Iterator<TaskAttributeDiff> otherIterator = otherChangedAttributes.iterator(); >+ while (otherIterator.hasNext()) { >+ TaskAttributeDiff otherAttributeDiff = otherIterator.next(); >+ if (currentAttributeDiff.getNewAttribute() >+ .getId() >+ .equals(otherAttributeDiff.getNewAttribute().getId())) { >+ //found a match, remove from other diff >+ otherChangedAttributes.remove(otherAttributeDiff); >+ break; >+ } >+ } >+ } >+ //if sets are equal, otherChangedAttributes should be empty now >+ isSameChange = otherChangedAttributes.isEmpty(); >+ //now check comments >+ isSameChange = currentDiff.getNewComments().size() == otherDiff.getNewComments().size(); >+ } >+ return isSameChange; >+ } >+ } > }
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 286963
:
185012
|
185013
|
185479
|
190222