diff options
author | spingel | 2008-02-18 05:38:23 +0000 |
---|---|---|
committer | spingel | 2008-02-18 05:38:23 +0000 |
commit | b278cb8424e0e251bf99f0f06b22032874989fef (patch) | |
tree | ce9359518ead5e0f12b935de6b0db5a61917c527 | |
parent | 5c33bbbd87ef17ba2b2aec2cdc1b694557a0f27c (diff) | |
download | org.eclipse.mylyn.tasks-b278cb8424e0e251bf99f0f06b22032874989fef.tar.gz org.eclipse.mylyn.tasks-b278cb8424e0e251bf99f0f06b22032874989fef.tar.xz org.eclipse.mylyn.tasks-b278cb8424e0e251bf99f0f06b22032874989fef.zip |
NEW - bug 212209: provide a flexible bug reporting facility
https://bugs.eclipse.org/bugs/show_bug.cgi?id=212209
5 files changed, 41 insertions, 59 deletions
diff --git a/org.eclipse.mylyn.help.ui/icons/etool16/report-bug.gif b/org.eclipse.mylyn.help.ui/icons/etool16/report-bug.gif Binary files differdeleted file mode 100644 index f88ff0a0c..000000000 --- a/org.eclipse.mylyn.help.ui/icons/etool16/report-bug.gif +++ /dev/null diff --git a/org.eclipse.mylyn.help.ui/plugin.xml b/org.eclipse.mylyn.help.ui/plugin.xml index 74bd42596..c66025d97 100644 --- a/org.eclipse.mylyn.help.ui/plugin.xml +++ b/org.eclipse.mylyn.help.ui/plugin.xml @@ -11,30 +11,6 @@ primary="true"> </toc> </extension> - - <extension point="org.eclipse.ui.actionSets"> - <actionSet - id="org.eclipse.mylyn.doc.actionSet" - label="Mylyn Help" - visible="true"> - <action - class="org.eclipse.mylyn.internal.tasks.ui.actions.ReportBugAction" - icon="icons/etool16/report-bug.gif" - id="org.eclipse.mylyn.tasks.ui.bug.report" - label="Report Bug or Enhancement" - menubarPath="help/helpStart" - style="push" - tooltip="Report Bug or Enhancement"/> - <action - class="org.eclipse.mylyn.internal.help.ui.actions.ShowMylynLegendAction" - definitionId="org.eclipse.mylyn.doc.legend.show" - icon="icons/etool16/icons-legend.gif" - id="org.eclipse.mylyn.doc.legend.show.action" - label="Mylyn UI Legend" - style="push" - tooltip="Mylyn UI Legend"/> - </actionSet> - </extension> <extension point="org.eclipse.ui.commands"> <category diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskSchema.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskSchema.java index f8d0944e5..ce34b60cc 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskSchema.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskSchema.java @@ -10,6 +10,7 @@ package org.eclipse.mylyn.internal.tasks.core; import java.util.Date; +import org.eclipse.core.runtime.Assert; import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; import org.eclipse.mylyn.tasks.core.RepositoryTaskData; import org.eclipse.mylyn.tasks.core.AbstractTask.PriorityLevel; @@ -20,10 +21,12 @@ import org.eclipse.mylyn.tasks.core.AbstractTask.PriorityLevel; * TODO url, due date, completed */ public class DefaultTaskSchema { - + private final RepositoryTaskData taskData; public DefaultTaskSchema(RepositoryTaskData taskData) { + Assert.isNotNull(taskData); + this.taskData = taskData; } @@ -55,10 +58,18 @@ public class DefaultTaskSchema { return getValue(RepositoryTaskAttribute.USER_OWNER); } + public PriorityLevel getPriority() { + return PriorityLevel.fromString(getValue(RepositoryTaskAttribute.PRIORITY)); + } + + public String getProduct() { + return getValue(RepositoryTaskAttribute.PRODUCT); + } + public String getSummary() { return getValue(RepositoryTaskAttribute.SUMMARY); } - + private String getValue(String attributeKey) { RepositoryTaskAttribute attribute = taskData.getAttribute(attributeKey); if (attribute != null) { @@ -94,6 +105,14 @@ public class DefaultTaskSchema { setValue(RepositoryTaskAttribute.USER_OWNER, owner); } + public void setPriority(PriorityLevel priority) { + setValue(RepositoryTaskAttribute.PRIORITY, priority.toString()); + } + + public void setProduct(String product) { + setValue(RepositoryTaskAttribute.PRODUCT, product); + } + // TODO use Person class? public void setReporter(String reporter) { setValue(RepositoryTaskAttribute.USER_REPORTER, reporter); @@ -103,21 +122,19 @@ public class DefaultTaskSchema { setValue(RepositoryTaskAttribute.SUMMARY, summary); } - public void setPriority(PriorityLevel priority) { - setValue(RepositoryTaskAttribute.PRIORITY, priority.toString()); - } - - public PriorityLevel getPriority() { - return PriorityLevel.fromString(getValue(RepositoryTaskAttribute.PRIORITY)); - } - private RepositoryTaskAttribute setValue(String attributeKey, String value) { RepositoryTaskAttribute attribute = taskData.getAttribute(attributeKey); if (attribute == null) { attribute = new RepositoryTaskAttribute(attributeKey, null, false); taskData.addAttribute(attributeKey, attribute); } - taskData.getAttributeFactory().getAttributeMapper().setValue(attribute, value); + + AbstractAttributeMapper attributeMapper = taskData.getAttributeFactory().getAttributeMapper(); + if (attributeMapper != null) { + attributeMapper.setValue(attribute, value); + } else { + attribute.setValue(value); + } return attribute; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskSelection.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskSelection.java index fa35a0dea..8ad98ce50 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskSelection.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskSelection.java @@ -12,6 +12,7 @@ import java.util.Date; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; +import org.eclipse.mylyn.internal.tasks.core.AbstractAttributeMapper; import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants; import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector; import org.eclipse.mylyn.internal.tasks.core.TaskDataManager; @@ -64,6 +65,18 @@ public class TaskSelection { private static final long serialVersionUID = 1L; + private final AbstractAttributeMapper attributeMapper = new AbstractAttributeMapper(this) { + @Override + public String getType(RepositoryTaskAttribute taskAttribute) { + return RepositoryTaskAttribute.TYPE_SHORT_TEXT; + } + }; + + @Override + public AbstractAttributeMapper getAttributeMapper() { + return attributeMapper; + } + @Override public Date getDateForAttributeType(String attributeKey, String dateString) { return null; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ReportBugAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ReportBugAction.java deleted file mode 100644 index 73c066a14..000000000 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ReportBugAction.java +++ /dev/null @@ -1,24 +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.tasks.ui.actions; - -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.IWorkbenchWindowActionDelegate; - -/** - * @author Mik Kersten - */ -public class ReportBugAction extends NewTaskAction implements IWorkbenchWindowActionDelegate { - - public void dispose() { - } - - public void init(IWorkbenchWindow window) { - } -} |