diff options
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java')
-rw-r--r-- | org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java deleted file mode 100644 index d86b433c9..000000000 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListViewActionGroup.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009 Tasktop Technologies and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Tasktop Technologies - initial API and implementation - *******************************************************************************/ - -package org.eclipse.mylyn.internal.tasks.ui.actions; - -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; -import org.eclipse.mylyn.tasks.core.ITask; -import org.eclipse.mylyn.tasks.core.ITaskContainer; -import org.eclipse.ui.part.DrillDownAdapter; - -/** - * @author Steffen Pingel - */ -public class TaskListViewActionGroup extends RepositoryElementActionGroup { - - private final RenameAction renameAction; - - private final TaskListView view; - - private final GoIntoAction goIntoAction; - - private final GoUpAction goUpAction; - - private final DrillDownAdapter drillDownAdapter; - - public TaskListViewActionGroup(TaskListView view, DrillDownAdapter drillDownAdapter) { - this.view = view; - this.drillDownAdapter = drillDownAdapter; - - goIntoAction = new GoIntoAction(); - goUpAction = new GoUpAction(drillDownAdapter); - renameAction = new RenameAction(view); - view.getViewer().addSelectionChangedListener(renameAction); - - setSelectionProvider(view.getViewer()); - } - - public void updateDrillDownActions() { - if (drillDownAdapter.canGoBack()) { - goUpAction.setEnabled(true); - } else { - goUpAction.setEnabled(false); - } - } - - @Override - public void fillContextMenu(final IMenuManager manager) { - super.fillContextMenu(manager); - - updateDrillDownActions(); - - Object element = ((IStructuredSelection) view.getViewer().getSelection()).getFirstElement(); - if (element instanceof ITaskContainer && !(element instanceof ITask)) { - ITaskContainer cat = (ITaskContainer) element; - if (cat.getChildren().size() > 0) { - goIntoAction.setEnabled(true); - } else { - goIntoAction.setEnabled(false); - } - } else { - goIntoAction.setEnabled(false); - } - if (goIntoAction.isEnabled()) { - manager.appendToGroup(ID_SEPARATOR_NAVIGATE, goIntoAction); - } - if (goUpAction.isEnabled()) { - manager.appendToGroup(ID_SEPARATOR_NAVIGATE, goUpAction); - } - if (!(element instanceof ITask) && renameAction.isEnabled() && element != null) { - manager.appendToGroup(ID_SEPARATOR_EDIT, renameAction); - } - } - - public GoUpAction getGoUpAction() { - return goUpAction; - } - - public GoIntoAction getGoIntoAction() { - return goIntoAction; - } - - public RenameAction getRenameAction() { - return renameAction; - } - -} |