Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-10-22 14:57:16 -0400
committermkersten2005-10-22 14:57:16 -0400
commitcc52a4f9b454adc3af0a3c0c644d6d89d8a9fe9a (patch)
treee73305556c54bc71f89e01598e9f6a0fc006e886
parente2de13986258a7448c5c4b9ba68bb252ab1640ac (diff)
downloadorg.eclipse.mylyn.tasks-cc52a4f9b454adc3af0a3c0c644d6d89d8a9fe9a.tar.gz
org.eclipse.mylyn.tasks-cc52a4f9b454adc3af0a3c0c644d6d89d8a9fe9a.tar.xz
org.eclipse.mylyn.tasks-cc52a4f9b454adc3af0a3c0c644d6d89d8a9fe9a.zip
Patch for Bug #111870: hour estimates are wrong
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/IContextEditorFactory.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java12
4 files changed, 16 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/IContextEditorFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/IContextEditorFactory.java
index 320d22504..1bcd841ff 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/IContextEditorFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/IContextEditorFactory.java
@@ -25,5 +25,6 @@ public interface IContextEditorFactory {
public IEditorPart createEditor();
public IEditorInput createEditorInput(IMylarContext context);
-
+
+ public String getTitle();
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
index fa0f669e6..3bd11b53a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
@@ -19,7 +19,6 @@ import java.util.List;
import java.util.Locale;
import org.eclipse.mylar.core.MylarPlugin;
-import org.eclipse.mylar.core.internal.MylarContextManager;
import org.eclipse.mylar.core.util.DateUtil;
import org.eclipse.mylar.tasklist.internal.TaskCategory;
import org.eclipse.mylar.tasklist.ui.TaskEditorInput;
@@ -37,7 +36,7 @@ import org.eclipse.ui.internal.Workbench;
*/
public class Task implements ITask {
- public static final long INACTIVITY_TIME_MILLIS = MylarContextManager.ACTIVITY_TIMEOUT_MINUTES * 1000 * 60;
+ public static final long INACTIVITY_TIME_MILLIS = MylarPlugin.getContextManager().getActivityTimeoutSeconds() * 1000;
private static final long serialVersionUID = 3545518391537382197L;
private boolean active = false;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java
index a8d8d9647..a4ea89d22 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskActiveTimerListener.java
@@ -14,7 +14,6 @@ package org.eclipse.mylar.tasklist;
import org.eclipse.mylar.core.InteractionEvent;
import org.eclipse.mylar.core.MylarPlugin;
import org.eclipse.mylar.core.internal.ActivityTimerThread;
-import org.eclipse.mylar.core.internal.MylarContextManager;
import org.eclipse.mylar.core.util.IActiveTimerListener;
import org.eclipse.mylar.core.util.IInteractionEventListener;
@@ -31,7 +30,7 @@ public class TaskActiveTimerListener implements IActiveTimerListener, IInteracti
public TaskActiveTimerListener(ITask task){
this.task = task;
- timer = new ActivityTimerThread(MylarContextManager.ACTIVITY_TIMEOUT_MINUTES);
+ timer = new ActivityTimerThread(MylarPlugin.getContextManager().getActivityTimeoutSeconds());
timer.addListener(this);
timer.start();
MylarPlugin.getDefault().addInteractionListener(this);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java
index 1f9bed11d..3d507ac9a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java
@@ -13,6 +13,7 @@ package org.eclipse.mylar.tasklist.ui;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylar.core.MylarPlugin;
+import org.eclipse.mylar.tasklist.IContextEditorFactory;
import org.eclipse.mylar.tasklist.ITask;
import org.eclipse.mylar.tasklist.MylarTasklistPlugin;
import org.eclipse.swt.SWT;
@@ -64,6 +65,17 @@ public class TaskEditor extends MultiPageEditorPart {
taskSummaryEditor.setParentEditor(this);
int index = addPage(taskSummaryEditor.getControl());
setPageText(index, TASK_INFO_PAGE_LABEL);
+
+ for (IContextEditorFactory factory : MylarTasklistPlugin.getDefault().getContextEditors()) {
+ try {
+ taskSummaryEditor.setParentEditor(this);
+ index = addPage(factory.createEditor(), factory.createEditorInput(MylarPlugin.getContextManager().getActiveContext()));
+ setPageText(index++, factory.getTitle());
+ } catch (PartInitException e) {
+ MylarPlugin.fail(e, "could not add task editor", false);
+ }
+ }
+
} catch (RuntimeException e) {
MylarPlugin.fail(e, "could not add task editor", false);
}

Back to the top