	public MenuManager getSubMenuManager(TaskListView view, ITaskListElement selection) {
		final ITaskListElement selectedElement = selection;
		final TaskListView taskListView = view;
		final MenuManager subMenuManager = new MenuManager(LABEL_REMINDER);
		if (selectedElement instanceof ITask) {
			task = (ITask) selectedElement;
		} else if (selectedElement instanceof AbstractQueryHit) {
			if (((AbstractQueryHit) selectedElement).getCorrespondingTask() != null) {
				task = ((AbstractQueryHit) selectedElement).getCorrespondingTask();
			}
		}
		Action action = new Action() {
			@Override
			public void run() {
				Calendar reminderCalendar = GregorianCalendar.getInstance();
				MylarTaskListPlugin.getTaskListManager().setScheduledToday(reminderCalendar);
				MylarTaskListPlugin.getTaskListManager().setReminder(task, reminderCalendar.getTime());
			}
		};
		action.setText(LABEL_TODAY);
		action.setEnabled(canSchedule());
		subMenuManager.add(action);
		if (MylarTaskListPlugin.getTaskListManager().isReminderToday(task)) {
			action.setChecked(true);
		}
		subMenuManager.add(new Separator());
		final int today = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
		boolean reachedEndOfWeek = false;
		for (int i = today+1; i <= 8 && !reachedEndOfWeek; i++) {
			final int day = i;
			action = new Action() {
				@Override
				public void run() {
					Calendar reminderCalendar = GregorianCalendar.getInstance();
					int dueIn = day-today;
					MylarTaskListPlugin.getTaskListManager().setSecheduledIn(reminderCalendar, dueIn);
					MylarTaskListPlugin.getTaskListManager().setReminder(task, reminderCalendar.getTime());
				}
			};
			getDayLabel(i, action);
			int tasksCheduledOn = task.getReminderDate().getDay();
			if (MylarTaskListPlugin.getTaskListManager().isReminderThisWeek(task)) { 
				if (tasksCheduledOn+1 == day) {
					action.setChecked(true);
				} else if (tasksCheduledOn ==0 && day == 8) {
					action.setChecked(true);
				}
			}
			action.setEnabled(canSchedule());
			subMenuManager.add(action);	
		}
		subMenuManager.add(new Separator());
		action = new Action() {
			@Override
			public void run() {
				MylarTaskListPlugin.getTaskListManager().setReminder(task,
						MylarTaskListPlugin.getTaskListManager().getActivityNextWeek().getStart().getTime());
			}
		};
		action.setText(LABEL_NEXT_WEEK);
		action.setEnabled(canSchedule());
		if (MylarTaskListPlugin.getTaskListManager().isReminderAfterThisWeek(task) &&
			!MylarTaskListPlugin.getTaskListManager().isReminderLater(task)) {
			action.setChecked(true);
		}
		subMenuManager.add(action);
		action = new Action() {
			@Override
			public void run() {
				MylarTaskListPlugin.getTaskListManager().setReminder(task,
						MylarTaskListPlugin.getTaskListManager().getActivityFuture().getStart().getTime());
			}
		};
		action.setText(LABEL_FUTURE);
		action.setEnabled(canSchedule());
		if (MylarTaskListPlugin.getTaskListManager().isReminderLater(task)) {
			action.setChecked(true);
		}
		subMenuManager.add(action);
		subMenuManager.add(new Separator());
		action = new Action() {
			@Override
			public void run() {
				Calendar theCalendar = GregorianCalendar.getInstance();
				if(task.getReminderDate() != null) {
					theCalendar.setTime(task.getReminderDate());
				}
				DateSelectionDialog reminderDialog = new DateSelectionDialog(taskListView.getSite().getShell(), theCalendar, ReminderCellEditor.REMINDER_DIALOG_TITLE);
				int result = reminderDialog.open();
				if (result == Window.OK) {
					MylarTaskListPlugin.getTaskListManager().setReminder(task, reminderDialog.getDate());
				}
			}
		};
		action.setText(LABEL_CALENDAR);
		action.setEnabled(canSchedule());
		subMenuManager.add(action);
		action = new Action() {
			@Override
			public void run() {
				MylarTaskListPlugin.getTaskListManager().setReminder(task, null);
			}
		};
		action.setText(LABEL_CLEAR);
		action.setEnabled(task != null);
		subMenuManager.add(action);
		return subMenuManager;
	}

	public MenuManager getSubMenuManager(TaskListView view, ITaskListElement selection) {
		final ITaskListElement selectedElement = selection;
		final TaskListView taskListView = view;
		final MenuManager subMenuManager = new MenuManager(LABEL_REMINDER);
		if (selectedElement instanceof ITask) {
			task = (ITask) selectedElement;
		} else if (selectedElement instanceof AbstractQueryHit) {
			if (((AbstractQueryHit) selectedElement).getCorrespondingTask() != null) {
				task = ((AbstractQueryHit) selectedElement).getCorrespondingTask();
			}
		}
		Action action = new Action() {
			@Override
			public void run() {
				Calendar reminderCalendar = GregorianCalendar.getInstance();
				MylarTaskListPlugin.getTaskListManager().setScheduledToday(reminderCalendar);
				MylarTaskListPlugin.getTaskListManager().setReminder(task, reminderCalendar.getTime());
			}
		};
		action.setText(LABEL_TODAY);
		action.setEnabled(canSchedule());
		subMenuManager.add(action);
		if (MylarTaskListPlugin.getTaskListManager().isReminderToday(task)) {
			action.setChecked(true);
		}
		subMenuManager.add(new Separator());
		final int today = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
		boolean reachedEndOfWeek = false;
		for (int i = today+1; i <= 8 && !reachedEndOfWeek; i++) {
			final int day = i;
			action = new Action() {
				@Override
				public void run() {
					Calendar reminderCalendar = GregorianCalendar.getInstance();
					int dueIn = day-today;
					MylarTaskListPlugin.getTaskListManager().setSecheduledIn(reminderCalendar, dueIn);
					MylarTaskListPlugin.getTaskListManager().setReminder(task, reminderCalendar.getTime());
				}
			};
			getDayLabel(i, action);
			if (task != null) {
				int tasksCheduledOn = task.getReminderDate().getDay();
				if (MylarTaskListPlugin.getTaskListManager().isReminderThisWeek(task)) { 
					if (tasksCheduledOn+1 == day) {
						action.setChecked(true);
					} else if (tasksCheduledOn ==0 && day == 8) {
						action.setChecked(true);
					}
				}
			}
			action.setEnabled(canSchedule());
			subMenuManager.add(action);	
		}
		subMenuManager.add(new Separator());
		action = new Action() {
			@Override
			public void run() {
				MylarTaskListPlugin.getTaskListManager().setReminder(task,
						MylarTaskListPlugin.getTaskListManager().getActivityNextWeek().getStart().getTime());
			}
		};
		action.setText(LABEL_NEXT_WEEK);
		action.setEnabled(canSchedule());
		if (MylarTaskListPlugin.getTaskListManager().isReminderAfterThisWeek(task) &&
			!MylarTaskListPlugin.getTaskListManager().isReminderLater(task)) {
			action.setChecked(true);
		}
		subMenuManager.add(action);
		action = new Action() {
			@Override
			public void run() {
				MylarTaskListPlugin.getTaskListManager().setReminder(task,
						MylarTaskListPlugin.getTaskListManager().getActivityFuture().getStart().getTime());
			}
		};
		action.setText(LABEL_FUTURE);
		action.setEnabled(canSchedule());
		if (MylarTaskListPlugin.getTaskListManager().isReminderLater(task)) {
			action.setChecked(true);
		}
		subMenuManager.add(action);
		subMenuManager.add(new Separator());
		action = new Action() {
			@Override
			public void run() {
				Calendar theCalendar = GregorianCalendar.getInstance();
				if(task.getReminderDate() != null) {
					theCalendar.setTime(task.getReminderDate());
				}
				DateSelectionDialog reminderDialog = new DateSelectionDialog(taskListView.getSite().getShell(), theCalendar, ReminderCellEditor.REMINDER_DIALOG_TITLE);
				int result = reminderDialog.open();
				if (result == Window.OK) {
					MylarTaskListPlugin.getTaskListManager().setReminder(task, reminderDialog.getDate());
				}
			}
		};
		action.setText(LABEL_CALENDAR);
		action.setEnabled(canSchedule());
		subMenuManager.add(action);
		action = new Action() {
			@Override
			public void run() {
				MylarTaskListPlugin.getTaskListManager().setReminder(task, null);
			}
		};
		action.setText(LABEL_CLEAR);
		action.setEnabled(task != null);
		subMenuManager.add(action);
		return subMenuManager;
	}
