Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 121030 Details for
Bug 166595
support moving bugs across products
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
first cut patch
patch166595.txt (text/plain), 18.03 KB, created by
Frank Becker
on 2008-12-21 13:44:53 EST
(
hide
)
Description:
first cut patch
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2008-12-21 13:44:53 EST
Size:
18.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.ui >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java,v >retrieving revision 1.19 >diff -u -r1.19 BugzillaTaskEditorPage.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java 16 Dec 2008 00:21:39 -0000 1.19 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java 21 Dec 2008 18:40:17 -0000 >@@ -11,16 +11,22 @@ > > package org.eclipse.mylyn.internal.bugzilla.ui.editor; > >+import java.util.Collections; >+import java.util.List; > import java.util.Set; > > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.NullProgressMonitor; > import org.eclipse.jface.dialogs.IMessageProvider; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; > import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField; > import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants; >+import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; > import org.eclipse.mylyn.tasks.core.data.TaskAttribute; > import org.eclipse.mylyn.tasks.core.data.TaskData; >+import org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent; >+import org.eclipse.mylyn.tasks.core.data.TaskDataModelListener; > import org.eclipse.mylyn.tasks.ui.TasksUi; > import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor; > import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage; >@@ -94,12 +100,76 @@ > return descriptors; > } > >+ private TaskDataModelListener productListener = null; >+ > @Override > protected AttributeEditorFactory createAttributeEditorFactory() { > AttributeEditorFactory factory = new AttributeEditorFactory(getModel(), getTaskRepository(), getEditorSite()) { > @Override > public AbstractAttributeEditor createEditor(String type, final TaskAttribute taskAttribute) { > AbstractAttributeEditor editor; >+ if (taskAttribute.getId().equals(BugzillaAttribute.PRODUCT.getKey())) { >+ if (productListener == null) { >+ productListener = new TaskDataModelListener() { >+ @Override >+ public void attributeChanged(TaskDataModelEvent event) { >+ TaskAttribute taskAttribute = event.getTaskAttribute(); >+ if (taskAttribute != null) { >+ if (taskAttribute.getId().equals(BugzillaAttribute.PRODUCT.getKey())) { >+ RepositoryConfiguration repositoryConfiguration = null; >+ try { >+ repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration( >+ getModel().getTaskRepository(), false, new NullProgressMonitor()); >+ TaskAttribute attributeComponent = taskAttribute.getTaskData() >+ .getRoot() >+ .getMappedAttribute(BugzillaAttribute.COMPONENT.getKey()); >+ TaskAttribute attributeTargetMilestone = taskAttribute.getTaskData() >+ .getRoot() >+ .getMappedAttribute(BugzillaAttribute.TARGET_MILESTONE.getKey()); >+ >+ if (attributeComponent != null) { >+ List<String> optionValues = repositoryConfiguration.getComponents(taskAttribute.getValue()); >+ Collections.sort(optionValues); >+ attributeComponent.clearOptions(); >+ for (String option : optionValues) { >+ attributeComponent.putOption(option, option); >+ } >+ if (optionValues.size() == 1) { >+ attributeComponent.setValue(optionValues.get(0)); >+ } else { >+ attributeComponent.setValue(""); //$NON-NLS-1$ >+ } >+ >+ } >+ if (attributeTargetMilestone != null) { >+ List<String> optionValues = repositoryConfiguration.getTargetMilestones(taskAttribute.getValue()); >+ Collections.sort(optionValues); >+ attributeTargetMilestone.clearOptions(); >+ for (String option : optionValues) { >+ attributeTargetMilestone.putOption(option, option); >+ } >+ if (optionValues.size() == 1) { >+ attributeTargetMilestone.setValue(optionValues.get(0)); >+ } else { >+ attributeTargetMilestone.setValue("---"); //$NON-NLS-1$ >+ } >+ >+ } >+ BugzillaTaskEditorPage.this.getEditorForAttribute(attributeComponent) >+ .refresh(); >+ BugzillaTaskEditorPage.this.getEditorForAttribute(attributeTargetMilestone) >+ .refresh(); >+ } catch (CoreException e) { >+ // TODO Auto-generated catch block >+ e.printStackTrace(); >+ } >+ } >+ } >+ } >+ }; >+ getModel().addModelListener(productListener); >+ } >+ } > if (IBugzillaConstants.EDITOR_TYPE_KEYWORDS.equals(type)) { > editor = new BugzillaKeywordAttributeEditor(getModel(), taskAttribute); > } else if (IBugzillaConstants.EDITOR_TYPE_REMOVECC.equals(type)) { >@@ -125,6 +195,7 @@ > }); > } > >+ BugzillaTaskEditorPage.this.addToAttributeEditorMap(taskAttribute, editor); > return editor; > } > }; >@@ -136,7 +207,8 @@ > > TaskAttribute summaryAttribute = getModel().getTaskData().getRoot().getMappedAttribute(TaskAttribute.SUMMARY); > if (summaryAttribute != null && summaryAttribute.getValue().length() == 0) { >- getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_Please_enter_a_short_summary_before_submitting, IMessageProvider.ERROR); >+ getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_Please_enter_a_short_summary_before_submitting, >+ IMessageProvider.ERROR); > AbstractTaskEditorPart part = getPart(ID_PART_SUMMARY); > if (part != null) { > part.setFocus(); >@@ -147,7 +219,8 @@ > TaskAttribute componentAttribute = getModel().getTaskData().getRoot().getMappedAttribute( > BugzillaAttribute.COMPONENT.getKey()); > if (componentAttribute != null && componentAttribute.getValue().length() == 0) { >- getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_Please_select_a_component_before_submitting, IMessageProvider.ERROR); >+ getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_Please_select_a_component_before_submitting, >+ IMessageProvider.ERROR); > AbstractTaskEditorPart part = getPart(ID_PART_ATTRIBUTES); > if (part != null) { > part.setFocus(); >@@ -158,7 +231,8 @@ > TaskAttribute descriptionAttribute = getModel().getTaskData().getRoot().getMappedAttribute( > TaskAttribute.DESCRIPTION); > if (descriptionAttribute != null && descriptionAttribute.getValue().length() == 0) { >- getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_Please_enter_a_description_before_submitting, IMessageProvider.ERROR); >+ getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_Please_enter_a_description_before_submitting, >+ IMessageProvider.ERROR); > AbstractTaskEditorPart descriptionPart = getPart(ID_PART_DESCRIPTION); > if (descriptionPart != null) { > descriptionPart.setFocus(); >#P org.eclipse.mylyn.bugzilla.core >Index: src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java,v >retrieving revision 1.12 >diff -u -r1.12 BugzillaAttribute.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java 16 Dec 2008 17:44:07 -0000 1.12 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java 21 Dec 2008 18:40:18 -0000 >@@ -109,7 +109,7 @@ > > PRIORITY(Messages.BugzillaAttribute_Priority, "priority", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$ > >- PRODUCT(Messages.BugzillaAttribute_Product, "product", TaskAttribute.TYPE_SHORT_TEXT, false, true), //$NON-NLS-1$ >+ PRODUCT(Messages.BugzillaAttribute_Product, "product", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$ > > REP_PLATFORM(Messages.BugzillaAttribute_Platform, "rep_platform", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$ > >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPart.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPart.java,v >retrieving revision 1.7 >diff -u -r1.7 AbstractTaskEditorPart.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPart.java 12 Sep 2008 04:19:26 -0000 1.7 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPart.java 21 Dec 2008 18:40:20 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >-* Copyright (c) 2004, 2008 Tasktop Technologies and others. >+ * Copyright (c) 2004, 2008 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 >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java,v >retrieving revision 1.91 >diff -u -r1.91 AbstractTaskEditorPage.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java 5 Dec 2008 23:26:36 -0000 1.91 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractTaskEditorPage.java 21 Dec 2008 18:40:20 -0000 >@@ -17,10 +17,12 @@ > import java.util.Collection; > import java.util.Collections; > import java.util.Date; >+import java.util.HashMap; > import java.util.Iterator; > import java.util.LinkedHashSet; > import java.util.LinkedList; > import java.util.List; >+import java.util.Map; > import java.util.Set; > > import org.eclipse.core.runtime.Assert; >@@ -349,9 +351,8 @@ > // automatically refresh if the user has not made any changes and there is no chance of missing incomings > refreshFormContent(); > } else { >- getTaskEditor().setMessage( >- Messages.AbstractTaskEditorPage_Task_has_incoming_changes, IMessageProvider.WARNING, >- new HyperlinkAdapter() { >+ getTaskEditor().setMessage(Messages.AbstractTaskEditorPage_Task_has_incoming_changes, >+ IMessageProvider.WARNING, new HyperlinkAdapter() { > @Override > public void linkActivated(HyperlinkEvent e) { > refreshFormContent(); >@@ -450,6 +451,8 @@ > > private TaskAttachmentDropListener defaultDropListener; > >+ private final Map<TaskAttribute, AbstractAttributeEditor> attributeEditorMap = new HashMap<TaskAttribute, AbstractAttributeEditor>(); >+ > // TODO 3.1 define constructor for setting id and label > public AbstractTaskEditorPage(TaskEditor editor, String connectorKind) { > super(editor, "id", "label"); //$NON-NLS-1$ //$NON-NLS-2$ >@@ -559,9 +562,8 @@ > > AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(getConnectorKind()); > if (connectorUi == null) { >- getTaskEditor().setMessage( >- Messages.AbstractTaskEditorPage_Synchronize_to_update_editor_contents, IMessageProvider.INFORMATION, >- new HyperlinkAdapter() { >+ getTaskEditor().setMessage(Messages.AbstractTaskEditorPage_Synchronize_to_update_editor_contents, >+ IMessageProvider.INFORMATION, new HyperlinkAdapter() { > @Override > public void linkActivated(HyperlinkEvent e) { > refreshFormContent(); >@@ -791,12 +793,11 @@ > model.save(monitor); > } catch (final CoreException e) { > StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Error saving task", e)); //$NON-NLS-1$ >- getTaskEditor().setMessage( >- Messages.AbstractTaskEditorPage_Could_not_save_task, IMessageProvider.ERROR, new HyperlinkAdapter() { >+ getTaskEditor().setMessage(Messages.AbstractTaskEditorPage_Could_not_save_task, IMessageProvider.ERROR, >+ new HyperlinkAdapter() { > @Override > public void linkActivated(HyperlinkEvent event) { >- TasksUiInternal.displayStatus( >- Messages.AbstractTaskEditorPage_Save_failed, e.getStatus()); >+ TasksUiInternal.displayStatus(Messages.AbstractTaskEditorPage_Save_failed, e.getStatus()); > } > }); > } >@@ -844,8 +845,7 @@ > public void fillToolBar(IToolBarManager toolBarManager) { > final TaskRepository taskRepository = (model != null) ? getModel().getTaskRepository() : null; > if (taskRepository != null) { >- ControlContribution repositoryLabelControl = new ControlContribution( >- Messages.AbstractTaskEditorPage_Title) { >+ ControlContribution repositoryLabelControl = new ControlContribution(Messages.AbstractTaskEditorPage_Title) { > @Override > protected Control createControl(Composite parent) { > FormToolkit toolkit = getTaskEditor().getHeaderForm().getToolkit(); >@@ -1100,8 +1100,7 @@ > getTaskEditor().setMessage(message, IMessageProvider.ERROR, new HyperlinkAdapter() { > @Override > public void linkActivated(HyperlinkEvent e) { >- TasksUiInternal.displayStatus( >- Messages.AbstractTaskEditorPage_Submit_failed, status); >+ TasksUiInternal.displayStatus(Messages.AbstractTaskEditorPage_Submit_failed, status); > } > }); > } >@@ -1139,8 +1138,8 @@ > > } catch (final CoreException e) { > StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Error opening task", e)); //$NON-NLS-1$ >- getTaskEditor().setStatus( >- Messages.AbstractTaskEditorPage_Error_opening_task, Messages.AbstractTaskEditorPage_Open_failed, e.getStatus()); >+ getTaskEditor().setStatus(Messages.AbstractTaskEditorPage_Error_opening_task, >+ Messages.AbstractTaskEditorPage_Open_failed, e.getStatus()); > } > } > >@@ -1272,8 +1271,8 @@ > refreshDisabled = true; > model.refresh(null); > } catch (CoreException e) { >- getTaskEditor().setMessage( >- Messages.AbstractTaskEditorPage_Failed_to_read_task_data_ + e.getMessage(), IMessageProvider.ERROR); >+ getTaskEditor().setMessage(Messages.AbstractTaskEditorPage_Failed_to_read_task_data_ + e.getMessage(), >+ IMessageProvider.ERROR); > taskData = null; > return; > } finally { >@@ -1417,9 +1416,8 @@ > > private void updateHeaderMessage() { > if (taskData == null) { >- getTaskEditor().setMessage( >- Messages.AbstractTaskEditorPage_Synchronize_to_retrieve_task_data, IMessageProvider.WARNING, >- new HyperlinkAdapter() { >+ getTaskEditor().setMessage(Messages.AbstractTaskEditorPage_Synchronize_to_retrieve_task_data, >+ IMessageProvider.WARNING, new HyperlinkAdapter() { > @Override > public void linkActivated(HyperlinkEvent e) { > if (synchronizeEditorAction != null) { >@@ -1430,4 +1428,41 @@ > } > } > >+ /** >+ * @since 3.1 >+ */ >+ public void addToAttributeEditorMap(TaskAttribute attribute, AbstractAttributeEditor editor) { >+ if (attributeEditorMap.containsKey(attribute)) { >+ attributeEditorMap.remove(attribute); >+ } >+ attributeEditorMap.put(attribute, editor); >+ } >+ >+ /** >+ * @since 3.1 >+ */ >+ public AbstractAttributeEditor getEditorForAttribute(TaskAttribute attribute) { >+ return attributeEditorMap.get(attribute); >+ } >+ >+ /** >+ * @since 3.1 >+ */ >+ public Map<TaskAttribute, AbstractAttributeEditor> getAttributeEditorMap() { >+ return attributeEditorMap; >+ } >+ >+ /** >+ * @since 3.1 >+ */ >+ public void refresh() { >+ try { >+ showEditorBusy(true); >+ for (AbstractAttributeEditor abstractAttributeEditor : attributeEditorMap.values()) { >+ abstractAttributeEditor.refresh(); >+ } >+ } finally { >+ showEditorBusy(false); >+ } >+ } > } >Index: src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java,v >retrieving revision 1.11 >diff -u -r1.11 AbstractAttributeEditor.java >--- src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java 7 Dec 2008 03:26:58 -0000 1.11 >+++ src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java 21 Dec 2008 18:40:19 -0000 >@@ -213,4 +213,10 @@ > this.readOnly = readOnly; > } > >+ /** >+ * @since 3.1 >+ */ >+ public void refresh() { >+ // subclasses should overwrite this method >+ } > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java,v >retrieving revision 1.15 >diff -u -r1.15 SingleSelectionAttributeEditor.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java 5 Dec 2008 23:25:50 -0000 1.15 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java 21 Dec 2008 18:40:19 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >-* Copyright (c) 2004, 2008 Tasktop Technologies and others. >+ * Copyright (c) 2004, 2008 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 >@@ -109,8 +109,11 @@ > } > > public void setValue(String value) { >- getAttributeMapper().setValue(getTaskAttribute(), value); >- attributeChanged(); >+ String oldValue = getAttributeMapper().getValue(getTaskAttribute()); >+ if (!oldValue.equals(value)) { >+ getAttributeMapper().setValue(getTaskAttribute(), value); >+ attributeChanged(); >+ } > } > > void selectDefaultValue() { >@@ -120,4 +123,19 @@ > } > } > >+ @Override >+ public void refresh() { >+ combo.removeAll(); >+ Map<String, String> labelByValue = getAttributeMapper().getOptions(getTaskAttribute()); >+ if (labelByValue != null) { >+ values = labelByValue.keySet().toArray(new String[0]); >+ for (String value : values) { >+ combo.add(labelByValue.get(value)); >+ } >+ } >+ >+ select(getValue(), getValueLabel()); >+ combo.redraw(); >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 166595
:
112518
|
112519
| 121030 |
121031
|
121482
|
121483
|
121492
|
121493
|
122759
|
122761
|
125946
|
125947
|
125965
|
126067
|
126068