diff options
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiMenus.java')
-rw-r--r-- | org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiMenus.java | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiMenus.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiMenus.java deleted file mode 100644 index d309b3f02..000000000 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiMenus.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 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.util; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.mylyn.internal.tasks.ui.actions.SaveAttachmentsAction; -import org.eclipse.mylyn.tasks.core.ITaskAttachment; -import org.eclipse.swt.dnd.Clipboard; -import org.eclipse.swt.dnd.TextTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.PlatformUI; - -/** - * @author Steffen Pingel - */ -public class TasksUiMenus { - - public static void fillTaskAttachmentMenu(IMenuManager manager) { - final Action saveAction = new SaveAttachmentsAction(Messages.TasksUiMenus_Save_); - - final Action copyURLToClipAction = new Action(Messages.TasksUiMenus_Copy_URL) { - @Override - public void run() { - ITaskAttachment attachment = AttachmentUtil.getSelectedAttachment(); - if (attachment != null) { - Clipboard clip = new Clipboard(PlatformUI.getWorkbench().getDisplay()); - clip.setContents(new Object[] { attachment.getUrl() }, - new Transfer[] { TextTransfer.getInstance() }); - clip.dispose(); - } - } - }; - - final Action copyToClipAction = new Action(Messages.TasksUiMenus_Copy_Contents) { - @Override - public void run() { - ITaskAttachment attachment = AttachmentUtil.getSelectedAttachment(); - if (attachment != null) { - CopyAttachmentToClipboardJob job = new CopyAttachmentToClipboardJob(attachment); - job.setUser(true); - job.schedule(); - } - } - }; - - manager.add(new Separator("group.open")); //$NON-NLS-1$ - manager.add(new Separator("group.save")); //$NON-NLS-1$ - manager.add(saveAction); - manager.add(copyURLToClipAction); - manager.add(copyToClipAction); - manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - } -} |