Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2007-11-21 22:14:58 +0000
committerspingel2007-11-21 22:14:58 +0000
commit7284f998b44bdfb86b754a964d0d3953c8285eae (patch)
treef8437108dc6b391a80ab2e3d20919d32306301be /org.eclipse.mylyn.bugzilla.ui
parentde8d415884aca6bec93b8d4ba1fc7c7b955e3e36 (diff)
downloadorg.eclipse.mylyn.tasks-7284f998b44bdfb86b754a964d0d3953c8285eae.tar.gz
org.eclipse.mylyn.tasks-7284f998b44bdfb86b754a964d0d3953c8285eae.tar.xz
org.eclipse.mylyn.tasks-7284f998b44bdfb86b754a964d0d3953c8285eae.zip
NEW - bug 210590: [api] add support for creating subtasks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=210590
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/sub-task-new.gifbin381 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/plugin.xml24
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/actions/NewBugzillaSubTaskAction.java107
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java1
5 files changed, 1 insertions, 133 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/etool16/sub-task-new.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/sub-task-new.gif
deleted file mode 100644
index ec27050fe..000000000
--- a/org.eclipse.mylyn.bugzilla.ui/icons/etool16/sub-task-new.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/plugin.xml b/org.eclipse.mylyn.bugzilla.ui/plugin.xml
index eb1cf04d8..d7620a368 100644
--- a/org.eclipse.mylyn.bugzilla.ui/plugin.xml
+++ b/org.eclipse.mylyn.bugzilla.ui/plugin.xml
@@ -36,28 +36,4 @@
</perspectiveExtension>
</extension>
- <extension point="org.eclipse.ui.popupMenus">
- <objectContribution
- id="org.eclipse.mylyn.bugzilla.ui.BugzillaTask"
- objectClass="org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask">
- <action
- class="org.eclipse.mylyn.internal.bugzilla.ui.actions.NewBugzillaSubTaskAction"
- enablesFor="org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask"
- icon="icons/etool16/sub-task-new.gif"
- id="org.eclipse.mylyn.bugzilla.ui.new.subtask"
- label="Subtask"
- menubarPath="org.eclipse.mylyn.tasks.ui.menu.new/repository"
- tooltip="New Bugzilla Subtask">
- </action>
- <menu
- id="org.eclipse.mylyn.tasks.ui.menu.new"
- label="New"
- path="new">
- <separator
- name="repository">
- </separator>
- </menu>
- </objectContribution>
- </extension>
-
</plugin>
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java
index a38b3b747..9ba54c306 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java
@@ -52,8 +52,6 @@ public class BugzillaImages {
public static final ImageDescriptor OVERLAY_MINOR = create(T_VIEW, "overlay-minor.gif");
- public static final ImageDescriptor NEW_SUB_TASK = create(T_TOOL, "sub-task-new.gif");
-
private static ImageDescriptor create(String prefix, String name) {
try {
return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/actions/NewBugzillaSubTaskAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/actions/NewBugzillaSubTaskAction.java
deleted file mode 100644
index 88a2aa36e..000000000
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/actions/NewBugzillaSubTaskAction.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Mylyn project committers 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
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.bugzilla.ui.actions;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler;
-import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaImages;
-import org.eclipse.mylyn.monitor.core.StatusHandler;
-import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.RepositoryTaskData;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
-import org.eclipse.mylyn.tasks.ui.editors.NewTaskEditorInput;
-import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
-import org.eclipse.ui.IViewActionDelegate;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Frank Becker
- */
-public class NewBugzillaSubTaskAction extends Action implements IViewActionDelegate, IExecutableExtension {
-
- private static final String LABEL = "Subtask";
-
- public static final String ID = "org.eclipse.mylyn.bugzilla.ui.new.subtask";
-
- private BugzillaTask selectedTask;
-
- public NewBugzillaSubTaskAction() {
- super(LABEL);
- setToolTipText(LABEL);
- setId(ID);
- setImageDescriptor(BugzillaImages.NEW_SUB_TASK);
- }
-
- public void init(IViewPart view) {
- // ignore
-
- }
-
- @SuppressWarnings("restriction")
- public void run(IAction action) {
- AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
- BugzillaCorePlugin.REPOSITORY_KIND);
-
- String repositoryUrl = selectedTask.getRepositoryUrl();
- TaskRepository taskRepository = TasksUiPlugin.getRepositoryManager().getRepository(repositoryUrl);
- RepositoryTaskData selectedTaskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(repositoryUrl,
- selectedTask.getTaskId());
-
- BugzillaTaskDataHandler taskDataHandler = (BugzillaTaskDataHandler) connector.getTaskDataHandler();
- AbstractAttributeFactory attributeFactory = taskDataHandler.getAttributeFactory(taskRepository.getUrl(),
- taskRepository.getConnectorKind(), AbstractTask.DEFAULT_TASK_KIND);
- RepositoryTaskData taskData = new RepositoryTaskData(attributeFactory, BugzillaCorePlugin.REPOSITORY_KIND,
- taskRepository.getUrl(), TasksUiPlugin.getDefault().getNextNewRepositoryTaskId());
- taskData.setNew(true);
- try {
- taskDataHandler.initializeSubTaskData(taskRepository, taskData, selectedTaskData, new NullProgressMonitor());
- } catch (CoreException e) {
- StatusHandler.displayStatus("Unable to create Subtask", e.getStatus());
- }
-
- // open editor
- NewTaskEditorInput editorInput = new NewTaskEditorInput(taskRepository, taskData);
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- TasksUiUtil.openEditor(editorInput, TaskEditor.ID_EDITOR, page);
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- selectedTask = null;
- if (selection instanceof StructuredSelection) {
- Object selectedObject = ((StructuredSelection) selection).getFirstElement();
- if (selectedObject instanceof BugzillaTask) {
- selectedTask = (BugzillaTask) selectedObject;
- }
- }
-
- action.setEnabled(selectedTask != null);
- }
-
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data)
- throws CoreException {
- // ignore
-
- }
-
-}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java
index c45bca77f..4e126abde 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java
@@ -671,4 +671,5 @@ public class BugzillaTaskEditor extends AbstractRepositoryTaskEditor {
}
return super.attributeChanged(attribute);
}
+
}

Back to the top