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 72389 Details for
Bug 166406
Improve query tooltip layout
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]
added info about changed attributes
clipboard.txt (text/plain), 9.64 KB, created by
Eugene Kuleshov
on 2007-06-25 14:37:50 EDT
(
hide
)
Description:
added info about changed attributes
Filename:
MIME Type:
Creator:
Eugene Kuleshov
Created:
2007-06-25 14:37:50 EDT
Size:
9.64 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationReminder.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationReminder.java,v >retrieving revision 1.12 >diff -u -r1.12 TaskListNotificationReminder.java >--- src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationReminder.java 25 Jun 2007 04:56:41 -0000 1.12 >+++ src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationReminder.java 25 Jun 2007 18:31:26 -0000 >@@ -39,6 +39,10 @@ > public String getDescription() { > return null; > } >+ >+ public String getDetails() { >+ return null; >+ } > > public String getLabel() { > if (labelProvider.getText(task).length() > 40) { >Index: src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationIncoming.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationIncoming.java,v >retrieving revision 1.13 >diff -u -r1.13 TaskListNotificationIncoming.java >--- src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationIncoming.java 25 Jun 2007 04:56:42 -0000 1.13 >+++ src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationIncoming.java 25 Jun 2007 18:31:26 -0000 >@@ -29,11 +29,14 @@ > > private String description = null; > >+ private String details = null; >+ > private DecoratingLabelProvider labelProvider = new DecoratingLabelProvider(new TaskElementLabelProvider(true), > PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()); > > private Date date; > >+ > public TaskListNotificationIncoming(AbstractTask task) { > this.task = task; > } >@@ -49,6 +52,14 @@ > public void setDescription(String description) { > this.description = description; > } >+ >+ public String getDetails() { >+ return details; >+ } >+ >+ public void setDetails(String details) { >+ this.details = details; >+ } > > public void openTask() { > >Index: src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotification.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotification.java,v >retrieving revision 1.6 >diff -u -r1.6 ITaskListNotification.java >--- src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotification.java 25 Jun 2007 04:56:41 -0000 1.6 >+++ src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotification.java 25 Jun 2007 18:31:26 -0000 >@@ -24,6 +24,8 @@ > > public String getDescription(); > >+ public String getDetails(); >+ > public String getLabel(); > > public Image getNotificationIcon(); >Index: src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationQueryIncoming.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationQueryIncoming.java,v >retrieving revision 1.14 >diff -u -r1.14 TaskListNotificationQueryIncoming.java >--- src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationQueryIncoming.java 25 Jun 2007 04:56:42 -0000 1.14 >+++ src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationQueryIncoming.java 25 Jun 2007 18:31:26 -0000 >@@ -40,6 +40,10 @@ > return hit.getSummary(); > } > >+ public String getDetails() { >+ return null; >+ } >+ > public String getLabel() { > if (labelProvider.getText(hit).length() > 40) { > String truncated = labelProvider.getText(hit).substring(0, 35); >Index: src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java,v >retrieving revision 1.125 >diff -u -r1.125 TasksUiPlugin.java >--- src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java 25 Jun 2007 04:56:42 -0000 1.125 >+++ src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java 25 Jun 2007 18:31:26 -0000 >@@ -821,20 +821,16 @@ > } > > public static TaskListNotificationIncoming getIncommingNotification(AbstractRepositoryConnector connector, >- AbstractTask repositoryTask) { >+ AbstractTask task) { > >- TaskListNotificationIncoming notification = new TaskListNotificationIncoming(repositoryTask); >- RepositoryTaskData newTaskData = getTaskDataManager().getNewTaskData(repositoryTask.getRepositoryUrl(), >- repositoryTask.getTaskId()); >- RepositoryTaskData oldTaskData = getTaskDataManager().getOldTaskData(repositoryTask.getRepositoryUrl(), >- repositoryTask.getTaskId()); >+ TaskListNotificationIncoming notification = new TaskListNotificationIncoming(task); >+ RepositoryTaskData newTaskData = getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); >+ RepositoryTaskData oldTaskData = getTaskDataManager().getOldTaskData(task.getRepositoryUrl(), task.getTaskId()); > > if (newTaskData != null && oldTaskData != null) { > >- String descriptionText = getChangedDescription(newTaskData, oldTaskData); >- if (descriptionText != null) { >- notification.setDescription(descriptionText); >- } >+ notification.setDescription(getChangedDescription(newTaskData, oldTaskData)); >+ notification.setDetails(getChangedAttributes(newTaskData, oldTaskData)); > > if (connector != null) { > AbstractTaskDataHandler offlineHandler = connector.getTaskDataHandler(); >@@ -852,7 +848,6 @@ > } > > private static String getChangedDescription(RepositoryTaskData newTaskData, RepositoryTaskData oldTaskData) { >- > String descriptionText = ""; > > if (newTaskData.getComments().size() > oldTaskData.getComments().size()) { >@@ -870,29 +865,76 @@ > } > } > >- boolean attributeChanged = false; >+ if (descriptionText.equals("")) { >+ String attributes = getChangedAttributes(newTaskData, oldTaskData); >+ if(!attributes.equals("")) { >+ descriptionText += "Attributes changed"; >+ } >+ } >+ >+ return descriptionText; >+ } > >+ private static String getChangedAttributes(RepositoryTaskData newTaskData, RepositoryTaskData oldTaskData) { >+ List<Change> changes = new ArrayList<Change>(); > for (RepositoryTaskAttribute newAttribute : newTaskData.getAttributes()) { >+ List<String> newValues = newAttribute.getValues(); > RepositoryTaskAttribute oldAttribute = oldTaskData.getAttribute(newAttribute.getId()); > if (oldAttribute == null) { >- attributeChanged = true; >+ changes.add(getDiff(newAttribute.getName(), null, newValues)); > break; > } >- if (oldAttribute.getValue() != null && !oldAttribute.getValue().equals(newAttribute.getValue())) { >- attributeChanged = true; >- break; >- } else if (oldAttribute.getValues() != null && !oldAttribute.getValues().equals(newAttribute.getValues())) { >- attributeChanged = true; >+ List<String> oldValues = oldAttribute.getValues(); >+ if (!oldValues.equals(newValues)) { >+ changes.add(getDiff(newAttribute.getName(), oldValues, newValues)); > break; > } > } >+ if (changes.isEmpty()) { >+ return ""; >+ } >+ >+ String details = ""; >+ String sep = ""; >+ for (Change c : changes) { >+ details += sep; >+ if (!c.removed.isEmpty()) { >+ details += "- " + c.field + " " + c.removed; >+ sep = "\n"; >+ } >+ if (!c.added.isEmpty()) { >+ details += sep; >+ details += "+ " + c.field + " " + c.added; >+ sep = "\n"; >+ } >+ } >+ return details; >+ } > >- if (attributeChanged) { >- if (descriptionText.equals("")) { >- descriptionText += "Attributes changed"; >+ private static Change getDiff(String field, List<String> oldValues, List<String> newValues) { >+ Change c = new Change(field, newValues); >+ if(oldValues!=null) { >+ for (String value : oldValues) { >+ if(c.added.contains(value)) { >+ c.added.remove(value); >+ } else { >+ c.removed.add(value); >+ } > } > } >- return descriptionText; >+ return c; > } > >+ static class Change { >+ final String field; >+ final List<String> added; >+ final List<String> removed = new ArrayList<String>(); >+ >+ public Change(String field, List<String> newValues) { >+ this.field = field; >+ this.added = new ArrayList<String>(newValues); >+ } >+ >+ } >+ > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java,v >retrieving revision 1.48 >diff -u -r1.48 TaskListToolTipHandler.java >--- src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java 25 Jun 2007 06:13:03 -0000 1.48 >+++ src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTipHandler.java 25 Jun 2007 18:31:26 -0000 >@@ -181,12 +181,20 @@ > if (connector != null) { > ITaskListNotification notification = TasksUiPlugin.getIncommingNotification(connector, task); > if (notification != null) { >+ String res = null; > if (notification.getDescription() != null) { > String descriptionText = notification.getDescription(); > if (descriptionText != null && descriptionText.length() > 0) { >- return descriptionText; >+ res = descriptionText; > } > } >+ if(notification.getDetails() !=null) { >+ String details = notification.getDetails(); >+ if (details != null && details.length() > 0) { >+ res = res==null ? details : res + "\n" + details; >+ } >+ } >+ return res; > } > } > }
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 166406
:
71690
|
71692
|
71763
|
71764
|
71772
|
71782
|
71811
|
71971
|
72100
|
72101
| 72389 |
72390
|
72447
|
72527
|
72607