Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-06-30 16:10:48 -0400
committermkersten2005-06-30 16:10:48 -0400
commit15b4ed8a65d1e74d1652362dc88c14fc3c4a8290 (patch)
treed407b5a0d473896ff59c35ca749791637e90b09b /org.eclipse.mylyn.tasks.ui
parentc323392d4d4ddd8c7b5e790d6e8597e1ab7a66a9 (diff)
downloadorg.eclipse.mylyn.tasks-15b4ed8a65d1e74d1652362dc88c14fc3c4a8290.tar.gz
org.eclipse.mylyn.tasks-15b4ed8a65d1e74d1652362dc88c14fc3c4a8290.tar.xz
org.eclipse.mylyn.tasks-15b4ed8a65d1e74d1652362dc88c14fc3c4a8290.zip
Fixed package explorer update failure
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java27
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateCategoryAction.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateTaskAction.java9
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java92
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java95
6 files changed, 91 insertions, 138 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java
index 1b1e5f5ad..bddddb259 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskSummaryEditor.java
@@ -41,6 +41,7 @@ import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.mylar.core.MylarPlugin;
+import org.eclipse.mylar.tasks.BugzillaTask;
import org.eclipse.mylar.tasks.ITask;
import org.eclipse.mylar.tasks.ITaskActivityListener;
import org.eclipse.mylar.tasks.MylarTasksPlugin;
@@ -316,17 +317,21 @@ public class TaskSummaryEditor extends EditorPart {
TableWrapData td = new TableWrapData(TableWrapData.FILL_GRAB);
td.colspan = 2;
description.setLayoutData(td);
- description.addFocusListener(new FocusListener() {
- public void focusGained(FocusEvent e) {
- // don't care about focus gained
- }
+ if (task instanceof BugzillaTask) {
+ description.setEnabled(false);
+ } else {
+ description.addFocusListener(new FocusListener() {
+ public void focusGained(FocusEvent e) {
+ // don't care about focus gained
+ }
- public void focusLost(FocusEvent e) {
- String label = description.getText();
- task.setLabel(label);
- refreshTaskListView(task);
- }
- });
+ public void focusLost(FocusEvent e) {
+ String label = description.getText();
+ task.setLabel(label);
+ refreshTaskListView(task);
+ }
+ });
+ }
}
// private String formatPath(String path) {
@@ -542,7 +547,7 @@ public class TaskSummaryEditor extends EditorPart {
private void createDetailsSection(Composite parent, FormToolkit toolkit) {
Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | Section.TWISTIE);
- section.setText("Mylar Task Details");
+ section.setText("Details");
section.setLayout(new TableWrapLayout());
section.setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB));
section.addExpansionListener(new IExpansionListener() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateCategoryAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateCategoryAction.java
index 7c56fe2f1..d9ff06d3f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateCategoryAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateCategoryAction.java
@@ -38,7 +38,9 @@ public class CreateCategoryAction extends Action {
@Override
public void run() {
MylarPlugin.getDefault().actionObserved(this);
- String label = this.view.getLabelNameFromUser("Category");
+ String[] input = this.view.getLabelPriorityFromUser("Category");
+ if (input == null) return;
+ String label = input[0];
if(label == null) return;
TaskCategory cat = new TaskCategory(label);
MylarTasksPlugin.getTaskListManager().getTaskList().addCategory(cat);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateTaskAction.java
index eb849dcbd..7fa30ad25 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateTaskAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/CreateTaskAction.java
@@ -41,10 +41,15 @@ public class CreateTaskAction extends Action {
@Override
public void run() {
MylarPlugin.getDefault().actionObserved(this);
- String label = this.view.getLabelNameFromUser("task");
+ String[] input = this.view.getLabelPriorityFromUser("task");
+ if (input == null) return;
+ String label = input[0];
+ String priority = input[1];
if(label == null) return;
Task newTask = new Task(MylarTasksPlugin.getTaskListManager().genUniqueTaskId(), label);
-
+ if (priority != null) {
+ newTask.setPriority(priority);
+ }
Object selectedObject = ((IStructuredSelection)this.view.getViewer().getSelection()).getFirstElement();
if (selectedObject instanceof TaskCategory){
newTask.setCategory((TaskCategory)selectedObject);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java
index f80225f4d..d74bf6cf7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/actions/ToggleIntersectionModeAction.java
@@ -30,7 +30,7 @@ public class ToggleIntersectionModeAction extends Action {
setToolTipText("Intersect Taskscapes");
setImageDescriptor(MylarImages.MYLAR);
setActionDefinitionId("org.eclipse.mylar.ui.interest.intersection");
- setChecked(MylarUiPlugin.getDefault().isGlobalFilteringEnabled());
+// setChecked(MylarUiPlugin.getDefault().isGlobalFilteringEnabled());
}
@Override
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java
index c3af29a34..bb98704b9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java
@@ -50,8 +50,6 @@ public class TaskListLabelProvider extends LabelProvider implements ITableLabelP
return element.getPriority();
case 3:
return element.getDescription(true);
- case 4:
- return element.getHandle();
}
}
System.out.println("Not TaskListElement");
@@ -143,93 +141,3 @@ public class TaskListLabelProvider extends LabelProvider implements ITableLabelP
this.backgroundColor = c;
}
}
-
-//public Image getColumnImage(Object obj, int columnIndex) {
-//if (obj instanceof Highlighter) {
-// Highlighter h = (Highlighter) obj;
-// switch (columnIndex) {
-// case 1:
-// HighlighterImageDescriptor des;
-// if (h.isGradient()) {
-// des = new HighlighterImageDescriptor(h.getBase(), h
-// .getLandmarkColor());
-// } else {
-// des = new HighlighterImageDescriptor(h
-// .getLandmarkColor(), h.getLandmarkColor());
-// }
-// return des.getImage();
-// default:
-// break;
-// }
-// }
-// return null;
-//}
-
-//public Color getBackground(Object element) {
-//if (element instanceof Task) {
-// Task task = (Task)element;
-// if (task.isActive()) {
-// Highlighter highlighter = MylarUiPlugin.getDefault().getHighlighterForTaskId(((Task)task).getId());
-// if (highlighter != null) {
-// return highlighter.getHighlightColor();
-// } else {
-// return null;
-// }
-// }
-//}
-//return null;
-//}
-
-//public class TaskListLabelProvider extends LabelProvider implements IColorProvider, IFontProvider {
-//
-// public String getText(Object obj) {
-// if (obj instanceof BugzillaTask) {
-// String desc = MylarTasksPlugin.getDefault().getBugzillaProvider().getBugzillaDescription(
-// ((BugzillaTask)obj));
-// return desc;
-// } else if (obj instanceof Task) {
-// Task task = (Task)obj;
-// return task.toString();// + " [" + task.getId() + "]";
-// } else {
-// return obj.toString();
-// }
-// }
-//
-// public Image getImage(Object obj) {
-// String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
-// if (obj instanceof BugzillaTask) {
-// return MylarImages.getImage(MylarImages.TASK_BUGZILLA);
-// } else if (obj instanceof Task) {
-// return MylarImages.getImage(MylarImages.TASK);
-// } else {
-// return null;
-// }
-// }
-// public Color getForeground(Object element) {
-// return null;
-// }
-//
-// public Color getBackground(Object element) {
-// if (element instanceof Task) {
-// Task task = (Task)element;
-// if (task.isActive()) {
-// Highlighter highlighter = MylarUiPlugin.getDefault().getHighlighterForTaskId(((Task)task).getId());
-// if (highlighter != null) {
-// return highlighter.getHighlightColor();
-// } else {
-// return null;
-// }
-// }
-// }
-// return null;
-// }
-//
-// public Font getFont(Object element) {
-// if (element instanceof Task) {
-// if (((Task)element).isActive()) {
-// return UiUtil.BOLD;
-// }
-// }
-// return null;
-// }
-//} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
index 02b0857f6..d323951cc 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListView.java
@@ -27,6 +27,7 @@ import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.CellEditor;
@@ -90,9 +91,13 @@ import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
@@ -139,8 +144,8 @@ public class TaskListView extends ViewPart {
private Action moveTaskToRoot;
private PriorityFilter priorityFilter = new PriorityFilter();
- protected String[] columnNames = new String[] { "", ".", "!", "Description", "handle" };
- protected int[] columnWidths = new int[] { 70, 20, 20, 120, 70 };
+ protected String[] columnNames = new String[] { "", ".", "!", "Description" };
+ protected int[] columnWidths = new int[] { 70, 20, 20, 120 };
private TreeColumn[] columns;
private IMemento taskListMemento;
public static final String columnWidthIdentifier = "org.eclipse.mylar.tasks.ui.views.tasklist.columnwidth";
@@ -407,7 +412,6 @@ public class TaskListView extends ViewPart {
case 1: return false;
case 2: return !(task instanceof BugzillaTask);
case 3: return !(task instanceof BugzillaTask);
- case 4: return false;
}
} else if (element instanceof AbstractCategory) {
switch (columnIndex) {
@@ -416,7 +420,6 @@ public class TaskListView extends ViewPart {
case 2:
return false;
case 3: return true;
- case 4: return false;
}
} else if (element instanceof BugzillaHit){
if (columnIndex == 0) {
@@ -442,8 +445,6 @@ public class TaskListView extends ViewPart {
return new Integer(priorityString);
case 3:
return task.getLabel();
- case 4:
- return task.getHandle();
}
} else if (element instanceof AbstractCategory) {
AbstractCategory cat = (AbstractCategory) element;
@@ -456,8 +457,6 @@ public class TaskListView extends ViewPart {
return "";
case 3:
return cat.getDescription(true);
- case 4:
- return "";
}
} else if (element instanceof BugzillaHit) {
BugzillaHit hit = (BugzillaHit) element;
@@ -475,9 +474,7 @@ public class TaskListView extends ViewPart {
String priorityString = hit.getPriority().substring(1);
return new Integer(priorityString);
case 3:
- return hit.getDescription(true);
- case 4:
- return hit.getHandle();
+ return hit.getDescription(true);
}
}
return "";
@@ -512,8 +509,6 @@ public class TaskListView extends ViewPart {
.taskPropertyChanged(task, columnNames[3]);
viewer.setSelection(null);
break;
- case 4:
- break;
}
} else if (((TreeItem) element).getData() instanceof AbstractCategory) {
AbstractCategory cat = (AbstractCategory)((TreeItem) element).getData();
@@ -529,8 +524,6 @@ public class TaskListView extends ViewPart {
cat.setDescription(((String) value).trim());
viewer.setSelection(null);
break;
- case 4:
- break;
}
} else if (((TreeItem) element).getData() instanceof BugzillaHit) {
BugzillaHit hit = (BugzillaHit)((TreeItem) element).getData();
@@ -559,8 +552,6 @@ public class TaskListView extends ViewPart {
case 3:
viewer.setSelection(null);
break;
- case 4:
- break;
}
}
viewer.refresh();
@@ -611,8 +602,6 @@ public class TaskListView extends ViewPart {
return task1.getPriority().compareTo(task2.getPriority());
} else if (column == columnNames[3]) {
return task1.getLabel().compareTo(task2.getLabel());
- } else if (column == columnNames[4]){
- return task1.getPath().compareTo(task2.getPath());
} else {
return 0;
}
@@ -627,9 +616,7 @@ public class TaskListView extends ViewPart {
return task1.getPriority().compareTo(task2.getPriority());
} else if (column == columnNames[3]) {
return task1.getDescription(false).compareTo(task2.getDescription(false));
- } else if (column == columnNames[4]){
- return task1.getHandle().compareTo(task2.getHandle());
- } else {
+ } else {
return 0;
}
} else{
@@ -1080,17 +1067,34 @@ public class TaskListView extends ViewPart {
}
}
- public String getLabelNameFromUser(String kind) {
-
- InputDialog dialog = new InputDialog(
- Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
- "Enter name",
- "Enter a name for the " + kind + ": ",
- "",
- null);
+ public String[] getLabelPriorityFromUser(String kind) {
+ String[] result = new String[2];
+ InputDialog dialog = null;
+ boolean isTask = kind.equals("task");
+ if (isTask) {
+ dialog = new TaskInputDialog(
+ Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
+ "Enter name",
+ "Enter a name for the " + kind + ": ",
+ "",
+ null);
+ } else {
+ dialog = new InputDialog(
+ Workbench.getInstance().getActiveWorkbenchWindow().getShell(),
+ "Enter name",
+ "Enter a name for the " + kind + ": ",
+ "",
+ null);
+ }
+
int dialogResult = dialog.open();
if (dialogResult == Window.OK) {
- return dialog.getValue();
+ //return dialog.getValue();
+ result[0] = dialog.getValue();
+ if (isTask) {
+ result[1] = ((TaskInputDialog)dialog).getSelectedPriority();
+ }
+ return result;
} else {
return null;
}
@@ -1121,6 +1125,35 @@ public class TaskListView extends ViewPart {
public PriorityFilter getPriorityFilter() {
return priorityFilter;
}
+ public class TaskInputDialog extends InputDialog {
+ private String priority = "P3";
+ public TaskInputDialog(Shell parentShell, String dialogTitle, String dialogMessage, String initialValue, IInputValidator validator) {
+ super(parentShell, dialogTitle, dialogMessage, initialValue, validator);
+ }
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = (Composite) super.createDialogArea(parent);
+ Label l = new Label(composite, SWT.NONE);
+ l.setText("Select task priority:");
+ final Combo c = new Combo(composite, SWT.NO_BACKGROUND
+ | SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY | SWT.DROP_DOWN);
+ c.setItems(PRIORITY_LEVELS);
+ c.setText(priority);
+ c.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ priority = c.getText();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ return composite;
+ }
+ public String getSelectedPriority() {
+ return priority;
+ }
+ };
}
//TextTransfer textTransfer = TextTransfer.getInstance();

Back to the top