diff options
author | sminto | 2010-05-12 23:54:08 +0000 |
---|---|---|
committer | sminto | 2010-05-12 23:54:08 +0000 |
commit | 0329f506b603dfb47c41538f0cd7edeb662bca32 (patch) | |
tree | d42c53690a5fc670951636d96d6de983948a3445 /org.eclipse.mylyn.tasks.ui | |
parent | ef1329a85aa8998f9afa00278084973f7c5ae017 (diff) | |
download | org.eclipse.mylyn.tasks-0329f506b603dfb47c41538f0cd7edeb662bca32.tar.gz org.eclipse.mylyn.tasks-0329f506b603dfb47c41538f0cd7edeb662bca32.tar.xz org.eclipse.mylyn.tasks-0329f506b603dfb47c41538f0cd7edeb662bca32.zip |
NEW - bug 165359: fix UI nits
https://bugs.eclipse.org/bugs/show_bug.cgi?id=165359
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r-- | org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java index 1c065b47f..f85629e67 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java @@ -23,13 +23,14 @@ import org.eclipse.jface.window.Window; import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages; import org.eclipse.mylyn.internal.provisional.commons.ui.DatePicker; import org.eclipse.mylyn.internal.provisional.commons.ui.DateSelectionDialog; +import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil; import org.eclipse.mylyn.internal.tasks.core.AbstractTask; import org.eclipse.mylyn.internal.tasks.core.DateRange; import org.eclipse.mylyn.internal.tasks.core.TaskActivityUtil; import org.eclipse.mylyn.internal.tasks.core.WeekDateRange; import org.eclipse.mylyn.tasks.core.IRepositoryElement; import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.ui.PlatformUI; +import org.eclipse.swt.widgets.Shell; /** * @author Rob Elves @@ -158,11 +159,18 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor { if (getScheduledForDate(singleTaskSelection) != null) { theCalendar.setTime(getScheduledForDate(singleTaskSelection).getStartDate().getTime()); } - DateSelectionDialog reminderDialog = new DateSelectionDialog(PlatformUI.getWorkbench() - .getActiveWorkbenchWindow() - .getShell(), theCalendar, DatePicker.TITLE_DIALOG, false, TasksUiPlugin.getDefault() - .getPreferenceStore() - .getInt(ITasksUiPreferenceConstants.PLANNING_ENDHOUR)); + Shell shell = null; + if (subMenuManager != null && subMenuManager.getMenu() != null) { + // we should try to use the same shell that the menu was created with + // so that it shows up on top of that shell correctly + shell = subMenuManager.getMenu().getShell(); + } + if (shell == null) { + shell = WorkbenchUtil.getShell(); + } + DateSelectionDialog reminderDialog = new DateSelectionDialog(shell, theCalendar, + DatePicker.TITLE_DIALOG, false, TasksUiPlugin.getDefault().getPreferenceStore().getInt( + ITasksUiPreferenceConstants.PLANNING_ENDHOUR)); int result = reminderDialog.open(); if (result == Window.OK) { DateRange range = null; |