public static void deleteSelectedTasks(TaskListTablePanel mainPanel)
	{
		List<Task> selectedTasks = mainPanel.getSelectedTasks();

		if (selectedTasks.size() == 0)
		{
			// TODO Gray out the Delete Task Button if there are no tasks
			// selected

			GlobalLogger.getLogger().logp(Level.WARNING, "TaskListTablePanel",
					"actionPerformed(ActionEvent)",
					"There are no rows selected to delete.");
			return;
		}

		boolean deleteAll = false;
		// Option to delete all Tasks without being asked individually
		if (selectedTasks.size() > 1)
		{
			Object[] options = {
					"Delete " + Integer.toString(selectedTasks.size())
							+ " Tasks", "Cancel All", "Confirm Individually" };

			int reply = JOptionPane.showOptionDialog(
					mainPanel,
					"Are you sure you wish to delete these "
							+ Integer.toString(selectedTasks.size())
							+ " Tasks?", "Confirm Delete",
					JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
					null, options, options[1]);
			if (reply == 0)
			{
				// Delete all Tasks without promtping was selected
				GlobalLogger.getLogger().logp(
						Level.INFO,
						"TaskListTablePanel",
						"actionPerformed(ActionEvent)",
						"Deleting " + Integer.toString(selectedTasks.size())
								+ " Tasks without further promtping.");

				deleteAll = true;
			}
			else if (reply == 1)
			{
				// Cancel all deletions was selected
				GlobalLogger.getLogger().logp(Level.INFO, "TaskListTablePanel",
						"actionPerformed(ActionEvent)",
						"User cancelled deletion of Tasks.");

				return;
			}
			else if (reply == 2)
			{
				GlobalLogger.getLogger().logp(Level.INFO, "TaskListTablePanel",
						"actionPerformed(ActionEvent)",
						"User selected to be prompted individually.");
			}
		}

		// Perform delete for each Task the user selected
		for (Task task : selectedTasks)
		{
			if (!deleteAll)
			{
				// Prompt the user to see if they are sure they want to delete
				// the task.
				GlobalLogger
						.getLogger()
						.logp(Level.INFO, "TaskListTablePanel",
								"actionPerformed(ActionEvent)",
								"Delete task button pressed. Prompting for currently selected task.");

				Object[] options = { "Delete Task", "Cancel" };

				int reply = JOptionPane.showOptionDialog(
						mainPanel,
						"Are you sure you wish to delete the task \""
								+ task.getName() + "\"?", "Confirm Delete",
						JOptionPane.DEFAULT_OPTION,
						JOptionPane.WARNING_MESSAGE, null, options, options[1]);
				if (reply == JOptionPane.NO_OPTION)
				{
					// User selected to not delete task
					GlobalLogger.getLogger().logp(Level.INFO,
							"TaskListTablePanel",
							"actionPerformed(ActionEvent)",
							"User cancelled Task deletion.");
					continue;
				}
			}

			deleteTask(task);
		}

		Timeflecks.getSharedApplication().postNotification(
				TimeflecksEvent.INVALIDATED_FILTERED_TASK_LIST);

		Timeflecks.getSharedApplication().postNotification(
				TimeflecksEvent.CHANGED_POSSIBLE_TAGS);
	}