Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java11
2 files changed, 18 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
index 4062b77d8..332065ba2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
@@ -251,7 +251,7 @@ public class TasksUiUtil {
/**
* Set asyncExec false for testing purposes.
*/
- public static void openEditor(final ITask task, boolean asyncExec, boolean newTask) {
+ public static void openEditor(final ITask task, boolean asyncExec, final boolean newTask) {
final IEditorInput editorInput = new TaskEditorInput(task, newTask);
@@ -261,7 +261,11 @@ public class TasksUiUtil {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page = window.getActivePage();
- openEditor(editorInput, TaskListPreferenceConstants.TASK_EDITOR_ID, page);
+ IEditorPart part = openEditor(editorInput, TaskListPreferenceConstants.TASK_EDITOR_ID, page);
+ if (newTask && part instanceof TaskEditor) {
+ TaskEditor taskEditor = (TaskEditor)part;
+ taskEditor.focusDescription();
+ }
}
}
});
@@ -273,7 +277,7 @@ public class TasksUiUtil {
}
}
}
-
+
public static IEditorPart openEditor(IEditorInput input, String editorId, IWorkbenchPage page) {
try {
return page.openEditor(input, editorId);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
index 9ce5aa9c0..baba5ad87 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
@@ -298,6 +298,17 @@ public class TaskEditor extends FormEditor {
// }
// }
+ public void focusDescription() {
+ if (this.getActivePage() > -1 && this.getActivePage() != browserPageIndex) {
+ IFormPage page = this.getPages()[this.getActivePage()];
+ if (page != null) {
+ page.setFocus();
+ }
+ } else if (this.getActivePage() == browserPageIndex && webBrowser != null) {
+ webBrowser.setFocus();
+ }
+ }
+
public Browser getWebBrowser() {
return webBrowser;
}

Back to the top