Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-08-11 23:15:28 +0000
committermkersten2005-08-11 23:15:28 +0000
commit3a9f16dbaba3b460c71b2315361bba00f8dc15f4 (patch)
tree9369faea97306978948256fae60d88450f800868 /org.eclipse.mylyn.tasks.ui
parent474bd9a90ae5fa7203430882053b5464e0bfa4b7 (diff)
downloadorg.eclipse.mylyn.tasks-3a9f16dbaba3b460c71b2315361bba00f8dc15f4.tar.gz
org.eclipse.mylyn.tasks-3a9f16dbaba3b460c71b2315361bba00f8dc15f4.tar.xz
org.eclipse.mylyn.tasks-3a9f16dbaba3b460c71b2315361bba00f8dc15f4.zip
Bug 103729 add support for disjoint selections in Mylar views
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java19
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java12
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java30
4 files changed, 44 insertions, 23 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java
index 3d051e7ca..5215b53bd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITask.java
@@ -71,9 +71,11 @@ public interface ITask extends Serializable, ITaskListElement {
public abstract void setElapsedTime(String elapsed);
- public abstract String getEstimatedTime();
+// public abstract String getEstimatedTimeForDisplay();
- public abstract void setEstimatedTime(String estimated);
+ public abstract int getEstimateTime();
+
+ public abstract void setEstimatedTime(int estimated);
public abstract List<ITask> getChildren();
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 b2b848fe7..6d871ef68 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
@@ -54,7 +54,7 @@ public class Task implements ITask {
private String label;
private String priority = "P3";
private String notes = "";
- private String estimatedTime = "";
+ private int estimatedTime = 0;
// private String elapsedTime = "";
private boolean completed;
private RelatedLinks links = new RelatedLinks();
@@ -295,14 +295,19 @@ public class Task implements ITask {
}
}
- public String getEstimatedTime() {
- if (estimatedTime == null) {
- estimatedTime = "";
- }
+// public String getEstimatedTimeForDisplay() {
+// if (estimatedTime == 0) {
+// return "";
+// } else {
+// return "" + estimatedTime * 10;
+// }
+// }
+
+ public int getEstimateTime() {
return estimatedTime;
}
-
- public void setEstimatedTime(String estimated) {
+
+ public void setEstimatedTime(int estimated) {
this.estimatedTime = estimated;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java
index 17d89007a..dff1f3df7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/internal/DefaultTaskListExternalizer.java
@@ -107,7 +107,7 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
node.setAttribute(NOTES, task.getNotes());
node.setAttribute(ELAPSED, task.getElapsedTime());
- node.setAttribute(ESTIMATED, task.getEstimatedTime());
+ node.setAttribute(ESTIMATED, ""+task.getEstimateTime());
node.setAttribute(END_DATE, task.getEndDateString());
node.setAttribute(REMINDER_DATE, task.getReminderDateString(false));
if (task.hasBeenReminded()) {
@@ -213,9 +213,15 @@ public class DefaultTaskListExternalizer implements ITaskListExternalizer {
task.setElapsedTime("");
}
if (element.hasAttribute(ESTIMATED)) {
- task.setEstimatedTime(element.getAttribute(ESTIMATED));
+ String est = element.getAttribute(ESTIMATED);
+ try {
+ int estimate = Integer.parseInt(est);
+ task.setEstimatedTime(estimate);
+ } catch (Exception e) {
+ task.setEstimatedTime(0);
+ }
} else {
- task.setEstimatedTime("");
+ task.setEstimatedTime(0);
}
// NOTE: do not change the order of complete and end date!!
if (element.getAttribute(COMPLETE).compareTo(TRUE) == 0) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java
index 1e3b0340f..fb7013901 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskSummaryEditor.java
@@ -70,6 +70,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
@@ -130,7 +131,7 @@ public class TaskSummaryEditor extends EditorPart {
private Action delete;
private Text description;
private Text notes;
- private Text estimated;
+ private Spinner estimated;
private boolean isDirty = false;
private TaskEditor parentEditor = null;
@@ -216,8 +217,7 @@ public class TaskSummaryEditor extends EditorPart {
task.setLabel(label);
String note = notes.getText();
task.setNotes(note);
- String estimate = estimated.getText();
- task.setEstimatedTime(estimate);
+ task.setEstimatedTime(estimated.getSelection());
links.clear();
TableItem[] items = table.getItems();
for (int i = 0; i < items.length; i++) {
@@ -439,24 +439,32 @@ public class TaskSummaryEditor extends EditorPart {
Composite container = toolkit.createComposite(section);
section.setClient(container);
TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = 2;
+ layout.numColumns = 3;
container.setLayout(layout);
Label l = toolkit.createLabel(container, "Estimated Time:");
l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- estimated = toolkit.createText(container,task.getEstimatedTime(), SWT.BORDER);
- estimated.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
-
- estimated.addModifyListener(new ModifyListener() {
+ estimated = new Spinner(container, SWT.BORDER);
+ estimated.setSelection(task.getEstimateTime());
+ estimated.setDigits(1);
+ estimated.setMaximum(100);
+ estimated.setMinimum(0);
+ estimated.setIncrement(5);
+ estimated.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
markDirty(true);
}
- });
+ });
+ l = toolkit.createLabel(container, " hours");
+ l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
l = toolkit.createLabel(container, "Elapsed Time:");
l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- Text text2 = toolkit.createText(container,task.getElapsedTimeForDisplay(), SWT.BORDER);
- text2.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
+ Text text2 = toolkit.createText(container,task.getElapsedTimeForDisplay(), SWT.BORDER);
+ TableWrapData td = new TableWrapData(TableWrapData.FILL_GRAB);
+ td.grabHorizontal = true;
+ td.colspan = 2;
+ text2.setLayoutData(td);
text2.setEditable(false);
text2.setEnabled(false);
//text2.setForeground(background);

Back to the top