Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-03-10 02:29:01 -0500
committerspingel2011-03-10 02:29:01 -0500
commit63b2e3ef5c2cb660683268047f62bb7cbfedd399 (patch)
tree62cf2d41853f8418cbfbe26dbf4902a7713602f5
parentf60f55e5b22bee21572bdb4ba1c2289b8dfa65e3 (diff)
downloadorg.eclipse.mylyn.tasks-63b2e3ef5c2cb660683268047f62bb7cbfedd399.tar.gz
org.eclipse.mylyn.tasks-63b2e3ef5c2cb660683268047f62bb7cbfedd399.tar.xz
org.eclipse.mylyn.tasks-63b2e3ef5c2cb660683268047f62bb7cbfedd399.zip
NEW - bug 336657: improve Task List appearance on blank workspace
https://bugs.eclipse.org/bugs/show_bug.cgi?id=336657
-rw-r--r--org.eclipse.mylyn.help.ui/intro/overviewExtensionContent.xml2
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java30
5 files changed, 56 insertions, 15 deletions
diff --git a/org.eclipse.mylyn.help.ui/intro/overviewExtensionContent.xml b/org.eclipse.mylyn.help.ui/intro/overviewExtensionContent.xml
index 5eecaf3fb..55a570efc 100644
--- a/org.eclipse.mylyn.help.ui/intro/overviewExtensionContent.xml
+++ b/org.eclipse.mylyn.help.ui/intro/overviewExtensionContent.xml
@@ -20,7 +20,7 @@
<text>Learn more about how Mylyn will help you focus on tasks</text>
</link>
-->
- <link label="Connect to Your Team Repository"
+ <link label="Connect to your task and ALM tools"
url="http://org.eclipse.ui.intro/runAction?pluginId=org.eclipse.mylyn.help.ui&amp;class=org.eclipse.mylyn.internal.tasks.ui.actions.WelcomeIntroAction&amp;id=org.eclipse.mylyn.doc.legend.show.action"
id="mylyn-overview" style-id="content-link">
<text>Open the Mylyn Task List and add a repository</text>
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java
index 91a1cdc48..963a23ac2 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskContainerDelta.java
@@ -113,4 +113,19 @@ public final class TaskContainerDelta {
return isTransient;
}
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("TaskContainerDelta [parent="); //$NON-NLS-1$
+ builder.append(parent);
+ builder.append(", element="); //$NON-NLS-1$
+ builder.append(element);
+ builder.append(", kind="); //$NON-NLS-1$
+ builder.append(kind);
+ builder.append(", isTransient="); //$NON-NLS-1$
+ builder.append(isTransient);
+ builder.append("]"); //$NON-NLS-1$
+ return builder.toString();
+ }
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java
index 7660c84fa..f6e8a11a4 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java
@@ -11,6 +11,7 @@
package org.eclipse.mylyn.internal.tasks.ui;
+import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.UnsubmittedTaskContainer;
@@ -21,17 +22,20 @@ public class TaskArchiveFilter extends AbstractTaskListFilter {
@Override
public boolean select(Object parent, Object element) {
-
if (element instanceof UnmatchedTaskContainer) {
if (((UnmatchedTaskContainer) element).isEmpty()) {
return false;
}
- }
- if (element instanceof UnsubmittedTaskContainer) {
+ } else if (element instanceof UnsubmittedTaskContainer) {
if (((UnsubmittedTaskContainer) element).isEmpty()) {
return false;
}
+ } else if (element instanceof UncategorizedTaskContainer) {
+ if (((UncategorizedTaskContainer) element).isEmpty()) {
+ return false;
+ }
}
return true;
}
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java
index 9bfd2c8eb..6de607e3e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.mylyn.internal.provisional.commons.ui.ServiceMessageControl;
+import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.core.notifications.IServiceMessageListener;
import org.eclipse.mylyn.internal.tasks.core.notifications.ServiceMessage;
import org.eclipse.mylyn.internal.tasks.core.notifications.ServiceMessageEvent;
@@ -30,6 +31,7 @@ import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.actions.AddRepositoryAction;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.wizards.Messages;
+import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.osgi.service.resolver.VersionRange;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.events.SelectionAdapter;
@@ -47,6 +49,7 @@ import org.osgi.framework.Version;
* @author Torkild U. Resheim
*/
public class TaskListServiceMessageControl extends ServiceMessageControl implements IServiceMessageListener {
+
private ServiceMessage currentMessage;
public TaskListServiceMessageControl(Composite parent) {
@@ -102,7 +105,7 @@ public class TaskListServiceMessageControl extends ServiceMessageControl impleme
try {
VersionRange version = new VersionRange(message.getVersion());
- String versionString = (String) TasksUiPlugin.getDefault().getBundle().getHeaders().get("Bundle-Version"); //$NON-NLS-1$
+ String versionString = TasksUiPlugin.getDefault().getBundle().getHeaders().get("Bundle-Version"); //$NON-NLS-1$
return version.isIncluded(new Version(versionString));
} catch (IllegalArgumentException e) {
// invalid version range
@@ -134,10 +137,15 @@ public class TaskListServiceMessageControl extends ServiceMessageControl impleme
@Override
public void widgetSelected(SelectionEvent e) {
if (e.text != null) {
- if (e.text.toLowerCase().equals("connect")) { //$NON-NLS-1$
+ String action = e.text.toLowerCase();
+ if ("create-local-task".equals(action)) { //$NON-NLS-1$
+ closeMessage();
+ LocalTask task = TasksUiInternal.createNewLocalTask(null);
+ TasksUiUtil.openTask(task);
+ } else if ("connect".equals(action)) { //$NON-NLS-1$
closeMessage();
new AddRepositoryAction().run();
- } else if (e.text.toLowerCase().equals("discovery")) { //$NON-NLS-1$
+ } else if ("discovery".equals(action)) { //$NON-NLS-1$
closeMessage();
final Command discoveryWizardCommand = TasksUiInternal.getConfiguredDiscoveryWizardCommand();
if (discoveryWizardCommand != null && discoveryWizardCommand.isEnabled()) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index b103b7aa0..86ca8fcd9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -70,6 +70,9 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta;
+import org.eclipse.mylyn.internal.tasks.core.UncategorizedTaskContainer;
+import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
+import org.eclipse.mylyn.internal.tasks.core.UnsubmittedTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.notifications.ServiceMessage;
import org.eclipse.mylyn.internal.tasks.ui.AbstractTaskListFilter;
import org.eclipse.mylyn.internal.tasks.ui.CategorizedPresentation;
@@ -498,14 +501,19 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener, I
break;
case ADDED:
case REMOVED:
- if (taskContainerDelta.getElement() != null) {
- refreshJob.refreshElement(taskContainerDelta.getElement());
- }
- if (taskContainerDelta.getParent() != null) {
- refreshJob.refreshElement(taskContainerDelta.getParent());
- } else {
- // element was added/removed from the root
+ if (isFilteredContainer(taskContainerDelta)) {
+ // container may have changed visibility, refresh root
refreshJob.refresh();
+ } else {
+ if (taskContainerDelta.getElement() != null) {
+ refreshJob.refreshElement(taskContainerDelta.getElement());
+ }
+ if (taskContainerDelta.getParent() != null) {
+ refreshJob.refreshElement(taskContainerDelta.getParent());
+ } else {
+ // element was added/removed from the root
+ refreshJob.refresh();
+ }
}
break;
case CONTENT:
@@ -515,6 +523,12 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener, I
}
}
}
+
+ private boolean isFilteredContainer(TaskContainerDelta taskContainerDelta) {
+ ITaskContainer parent = taskContainerDelta.getParent();
+ return parent instanceof UnsubmittedTaskContainer || parent instanceof UnmatchedTaskContainer
+ || parent instanceof UncategorizedTaskContainer;
+ }
});
}
};
@@ -1000,7 +1014,7 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener, I
if (showMessage && lastClosedId.equals("")) { //$NON-NLS-1$
ServiceMessage message = new ServiceMessage();
- message.setDescription("<a href=\"connect\">Connect</a> to your task and ALM tools."); //$NON-NLS-1$
+ message.setDescription("<a href=\"connect\">Connect</a> to your task and ALM tools or, <a href=\"create-local-task\">Create</a> a local task."); //$NON-NLS-1$
message.setTitle("Connect Mylyn"); //$NON-NLS-1$
message.setImage(Dialog.DLG_IMG_MESSAGE_INFO);
message.setId("0"); //$NON-NLS-1$

Back to the top