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 112518 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 part of patch
patch166595.txt (text/plain), 8.93 KB, created by
Frank Becker
on 2008-09-14 15:33:07 EDT
(
hide
)
Description:
first part of patch
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2008-09-14 15:33:07 EDT
Size:
8.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.7 >diff -u -r1.7 BugzillaAttribute.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java 12 Sep 2008 04:17:45 -0000 1.7 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java 14 Sep 2008 19:29:18 -0000 >@@ -100,7 +100,7 @@ > > PRIORITY("Priority:", "priority", TaskAttribute.TYPE_SINGLE_SELECT, false, false), > >- PRODUCT("Product:", "product", TaskAttribute.TYPE_SHORT_TEXT, false, true), >+ PRODUCT("Product:", "product", IBugzillaConstants.EDITOR_TYPE_PRODUCT, false, false), > > REP_PLATFORM("Platform:", "rep_platform", TaskAttribute.TYPE_SINGLE_SELECT, false, false), > >Index: src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java,v >retrieving revision 1.70 >diff -u -r1.70 IBugzillaConstants.java >--- src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java 12 Sep 2008 04:17:45 -0000 1.70 >+++ src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java 14 Sep 2008 19:29:18 -0000 >@@ -276,6 +276,8 @@ > > public static final String EDITOR_TYPE_VOTES = "bugzilla.editor.votes"; > >+ public static final String EDITOR_TYPE_PRODUCT = "bugzilla.editor.product"; >+ > public static final String ATTRIBUTE_BUGZILLA_QUERY_CUSTOM = "bugzilla.query.custom"; > > // Old Tags used for migration >#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.14 >diff -u -r1.14 BugzillaTaskEditorPage.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java 12 Sep 2008 04:15:33 -0000 1.14 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java 14 Sep 2008 19:29:20 -0000 >@@ -96,6 +96,8 @@ > editor = new BugzillaCcAttributeEditor(getModel(), taskAttribute); > } else if (IBugzillaConstants.EDITOR_TYPE_VOTES.equals(type)) { > editor = new BugzillaVotesEditor(getModel(), taskAttribute); >+ } else if (IBugzillaConstants.EDITOR_TYPE_PRODUCT.equals(type)) { >+ editor = new BugzillaProductEditor(getModel(), taskAttribute); > } else { > editor = super.createEditor(type, taskAttribute); > if (TaskAttribute.TYPE_BOOLEAN.equals(type)) { >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaProductEditor.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaProductEditor.java >diff -N src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaProductEditor.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaProductEditor.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,164 @@ >+/******************************************************************************* >+ * 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Tasktop Technologies - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.bugzilla.ui.editor; >+ >+import java.util.Collections; >+import java.util.List; >+import java.util.Map; >+ >+import org.eclipse.core.runtime.Assert; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute; >+import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin; >+import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration; >+import org.eclipse.mylyn.internal.tasks.ui.editors.EditorUtil; >+import org.eclipse.mylyn.tasks.core.data.TaskAttribute; >+import org.eclipse.mylyn.tasks.core.data.TaskDataModel; >+import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.CCombo; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Text; >+import org.eclipse.ui.forms.widgets.FormToolkit; >+ >+public class BugzillaProductEditor extends AbstractAttributeEditor { >+ >+ private String[] values; >+ >+ private CCombo combo; >+ >+ public BugzillaProductEditor(TaskDataModel manager, TaskAttribute taskAttribute) { >+ super(manager, taskAttribute); >+ // ignore >+ } >+ >+ @Override >+ public void createControl(Composite parent, FormToolkit toolkit) { >+ if (isReadOnly()) { >+ Text text = new Text(parent, SWT.FLAT | SWT.READ_ONLY); >+ text.setFont(EditorUtil.TEXT_FONT); >+ toolkit.adapt(text, false, false); >+ text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE); >+ String label = getValueLabel(); >+ if ("".equals(label)) { >+ // if set to the empty string the label will use 64px on GTK >+ text.setText(" "); >+ } else { >+ text.setText(label); >+ } >+ setControl(text); >+ } else { >+ combo = new CCombo(parent, SWT.FLAT | SWT.READ_ONLY); >+ toolkit.adapt(combo, false, false); >+ combo.setFont(EditorUtil.TEXT_FONT); >+ combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER); >+ >+ 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()); >+ >+ if (values != null) { >+ combo.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent event) { >+ int index = combo.getSelectionIndex(); >+ if (index > -1) { >+ Assert.isNotNull(values); >+ Assert.isLegal(index >= 0 && index <= values.length - 1); >+ setValue(values[index]); >+ RepositoryConfiguration repositoryConfiguration = null; >+ try { >+ repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration( >+ getModel().getTaskRepository(), false, new NullProgressMonitor()); >+ TaskAttribute attributeComponent = getModel().getTaskData() >+ .getRoot() >+ .getMappedAttribute(BugzillaAttribute.COMPONENT.getKey()); >+ TaskAttribute targetComponent = getModel().getTaskData().getRoot().getMappedAttribute( >+ BugzillaAttribute.TARGET_MILESTONE.getKey()); >+ >+ if (attributeComponent != null) { >+ attributeComponent.setValue(""); >+ List<String> optionValues = repositoryConfiguration.getComponents(values[index]); >+ Collections.sort(optionValues); >+ attributeComponent.clearOptions(); >+ for (String option : optionValues) { >+ attributeComponent.putOption(option, option); >+ } >+ if (optionValues.size() == 1) { >+ attributeComponent.setValue(optionValues.get(0)); >+ } >+ } >+ if (targetComponent != null) { >+ List<String> optionValues = repositoryConfiguration.getTargetMilestones(values[index]); >+ Collections.sort(optionValues); >+ targetComponent.clearOptions(); >+ for (String option : optionValues) { >+ targetComponent.putOption(option, option); >+ } >+ if (optionValues.size() == 1) { >+ targetComponent.setValue(optionValues.get(0)); >+ } >+ } >+ } catch (CoreException e1) { >+ // ignore >+ } >+ } >+ } >+ }); >+ } >+ setControl(combo); >+ } >+ } >+ >+ public String getValue() { >+ return getAttributeMapper().getValue(getTaskAttribute()); >+ } >+ >+ public String getValueLabel() { >+ return getAttributeMapper().getValueLabel(getTaskAttribute()); >+ } >+ >+ private void select(String value, String label) { >+ if (values != null) { >+ for (int i = 0; i < values.length; i++) { >+ if (values[i].equals(value)) { >+ combo.select(i); >+ break; >+ } >+ } >+ } else { >+ combo.setText(label); >+ } >+ } >+ >+ public void setValue(String value) { >+ getAttributeMapper().setValue(getTaskAttribute(), value); >+ attributeChanged(); >+ } >+ >+ void selectDefaultValue() { >+ if (combo.getSelectionIndex() == -1 && values.length > 0) { >+ combo.select(0); >+ setValue(values[0]); >+ } >+ } >+ >+}
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