View | Details | Raw Unified | Return to bug 226851 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/DateAttributeEditor.java (-2 / +6 lines)
Lines 64-72 Link Here
64
			layout.verticalSpacing = 2;
64
			layout.verticalSpacing = 2;
65
			layout.horizontalSpacing = 2;
65
			layout.horizontalSpacing = 2;
66
			dateWithClearComposite.setLayout(layout);
66
			dateWithClearComposite.setLayout(layout);
67
			datePicker = new DatePicker(dateWithClearComposite, SWT.FLAT, getTextValue(), false, 0);
67
			datePicker = new DatePicker(dateWithClearComposite, SWT.FLAT, getTextValue(), showTime, 0);
68
			datePicker.setFont(EditorUtil.TEXT_FONT);
68
			datePicker.setFont(EditorUtil.TEXT_FONT);
69
			datePicker.setDateFormat(EditorUtil.getDateFormat());
69
			if (!showTime) {
70
				datePicker.setDateFormat(EditorUtil.getDateFormat());
71
			} else {
72
				datePicker.setDateFormat(EditorUtil.getDateTimeFormat());
73
			}
70
			if (getValue() != null) {
74
			if (getValue() != null) {
71
				Calendar cal = Calendar.getInstance();
75
				Calendar cal = Calendar.getInstance();
72
				cal.setTime(getValue());
76
				cal.setTime(getValue());
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttributePart.java (-5 / +22 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
* Copyright (c) 2004, 2008 Tasktop Technologies and others.
2
 * Copyright (c) 2004, 2008 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 65-71 Link Here
65
65
66
	private static final int MULTI_ROW_HEIGHT = 55;
66
	private static final int MULTI_ROW_HEIGHT = 55;
67
67
68
	private List<AbstractAttributeEditor> attributeEditors;
68
	protected List<AbstractAttributeEditor> attributeEditors;
69
69
70
	private boolean hasIncoming;
70
	private boolean hasIncoming;
71
71
Lines 143-148 Link Here
143
143
144
	@Override
144
	@Override
145
	public void createControl(Composite parent, final FormToolkit toolkit) {
145
	public void createControl(Composite parent, final FormToolkit toolkit) {
146
		attributeEditors = new ArrayList<AbstractAttributeEditor>();
146
		initialize();
147
		initialize();
147
148
148
		boolean expand = getTaskData().isNew() || hasIncoming;
149
		boolean expand = getTaskData().isNew() || hasIncoming;
Lines 251-258 Link Here
251
		toolBar.add(repositoryConfigRefresh);
252
		toolBar.add(repositoryConfigRefresh);
252
	}
253
	}
253
254
254
	private void initialize() {
255
	protected void initialize() {
255
		attributeEditors = new ArrayList<AbstractAttributeEditor>();
256
		hasIncoming = false;
256
		hasIncoming = false;
257
257
258
		Map<String, TaskAttribute> attributes = getTaskData().getRoot().getAttributes();
258
		Map<String, TaskAttribute> attributes = getTaskData().getRoot().getAttributes();
Lines 264-270 Link Here
264
264
265
			AbstractAttributeEditor attributeEditor = createAttributeEditor(attribute);
265
			AbstractAttributeEditor attributeEditor = createAttributeEditor(attribute);
266
			if (attributeEditor != null) {
266
			if (attributeEditor != null) {
267
				attributeEditors.add(attributeEditor);
267
				String attributeId = attribute.getId();
268
				if (attributeId.startsWith("cf_"/*BugzillaCustomField.CUSTOM_FIELD_PREFIX*/)
269
						&& attributeEditor instanceof DateAttributeEditor) {
270
					((DateAttributeEditor) attributeEditor).setShowTime(true);
271
				}
272
273
				addAttributeEditor(attributeEditor);
268
				if (getModel().hasIncomingChanges(attribute)) {
274
				if (getModel().hasIncomingChanges(attribute)) {
269
					hasIncoming = true;
275
					hasIncoming = true;
270
				}
276
				}
Lines 280-283 Link Here
280
		});
286
		});
281
	}
287
	}
282
288
289
	public boolean isHasIncoming() {
290
		return hasIncoming;
291
	}
292
293
	public void setHasIncoming(boolean hasIncoming) {
294
		this.hasIncoming = hasIncoming;
295
	}
296
297
	public void addAttributeEditor(AbstractAttributeEditor attributeEditor) {
298
		attributeEditors.add(attributeEditor);
299
	}
283
}
300
}
(-)src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java (-5 / +49 lines)
Lines 189-195 Link Here
189
					atr.getMetaData().defaults().setLabel(desc).setReadOnly(false);
189
					atr.getMetaData().defaults().setLabel(desc).setReadOnly(false);
190
					atr.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
190
					atr.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
191
					atr.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
191
					atr.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
192
					atr.getMetaData().setReadOnly(true);
192
					switch (customField.getType()) {
193
					case 1: // Free Text
194
						atr.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
195
						break;
196
					case 2: // Drop Down
197
						atr.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT);
198
						break;
199
					case 3: // Multiple-Selection Box
200
						atr.getMetaData().setType(TaskAttribute.TYPE_MULTI_SELECT);
201
						break;
202
					case 4: // Large Text Box
203
						atr.getMetaData().setType(TaskAttribute.TYPE_LONG_TEXT);
204
						break;
205
					case 5: // Date/Time
206
						atr.getMetaData().setType(TaskAttribute.TYPE_DATE);
207
						break;
208
209
					default:
210
						List<String> options = customField.getOptions();
211
						if (options.size() > 0) {
212
							atr.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT);
213
						} else {
214
							atr.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
215
						}
216
					}
217
					atr.getMetaData().setReadOnly(false);
193
					atr.setValue(parsedText);
218
					atr.setValue(parsedText);
194
				}
219
				}
195
			} else {
220
			} else {
Lines 374-384 Link Here
374
					atr.getMetaData().defaults().setLabel(bugzillaCustomField.getDescription());
399
					atr.getMetaData().defaults().setLabel(bugzillaCustomField.getDescription());
375
					atr.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
400
					atr.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
376
401
377
					List<String> options = bugzillaCustomField.getOptions();
402
					switch (bugzillaCustomField.getType()) {
378
					if (options.size() > 0) {
403
					case 1: // Free Text
379
						atr.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT);
380
					} else {
381
						atr.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
404
						atr.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
405
						break;
406
					case 2: // Drop Down
407
						atr.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT);
408
						break;
409
					case 3: // Multiple-Selection Box
410
						atr.getMetaData().setType(TaskAttribute.TYPE_MULTI_SELECT);
411
						break;
412
					case 4: // Large Text Box
413
						atr.getMetaData().setType(TaskAttribute.TYPE_LONG_TEXT);
414
						break;
415
					case 5: // Date/Time
416
						atr.getMetaData().setType(TaskAttribute.TYPE_DATE);
417
						break;
418
419
					default:
420
						List<String> options = bugzillaCustomField.getOptions();
421
						if (options.size() > 0) {
422
							atr.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT);
423
						} else {
424
							atr.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
425
						}
382
					}
426
					}
383
					atr.getMetaData().setReadOnly(false);
427
					atr.getMetaData().setReadOnly(false);
384
				}
428
				}
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCustomField.java (-2 / +41 lines)
Lines 23-29 Link Here
23
 */
23
 */
24
public class BugzillaCustomField implements Serializable {
24
public class BugzillaCustomField implements Serializable {
25
25
26
	private static final long serialVersionUID = 5703683576871326128L;
26
	// old version	private static final long serialVersionUID = 5703683576871326128L;
27
	private static final long serialVersionUID = 7273310489883205486L;
27
28
28
	public static final String CUSTOM_FIELD_PREFIX = "cf_";
29
	public static final String CUSTOM_FIELD_PREFIX = "cf_";
29
30
Lines 33-41 Link Here
33
34
34
	private List<String> options = new ArrayList<String>();
35
	private List<String> options = new ArrayList<String>();
35
36
36
	public BugzillaCustomField(String description, String name) {
37
	private int type = -1;
38
39
	private String typeDesc = null;
40
41
	private boolean enterBug = false;
42
43
	public BugzillaCustomField(String description, String name, String type, String typeDesc, String enterBug) {
37
		this.description = description;
44
		this.description = description;
38
		this.name = name;
45
		this.name = name;
46
47
		if (type != null && !type.equals("")) {
48
			this.type = Integer.parseInt(type);
49
		}
50
		if (typeDesc != null && !typeDesc.equals("")) {
51
			this.typeDesc = typeDesc;
52
		}
53
		if (enterBug != null && !enterBug.equals("")) {
54
			this.enterBug = enterBug.equals("1");
55
		}
39
	}
56
	}
40
57
41
	public String getName() {
58
	public String getName() {
Lines 57-60 Link Here
57
	public void addOption(String option) {
74
	public void addOption(String option) {
58
		this.options.add(option);
75
		this.options.add(option);
59
	}
76
	}
77
78
	/*
79
	* @since 3.0.2
80
	*/
81
	public int getType() {
82
		return type;
83
	}
84
85
	/*
86
	* @since 3.0.2
87
	*/
88
	public String getTypeDesc() {
89
		return typeDesc;
90
	}
91
92
	/*
93
	* @since 3.0.2
94
	*/
95
	public boolean isEnterBug() {
96
		return enterBug;
97
	}
98
60
}
99
}
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java (+6 lines)
Lines 41-46 Link Here
41
41
42
	private static final String deadline_format = DATE_FORMAT_3;
42
	private static final String deadline_format = DATE_FORMAT_3;
43
43
44
	private static final String customAttribute_format = DATE_FORMAT_2;
45
44
	/**
46
	/**
45
	 * public for testing Bugzilla 2.18 uses DATE_FORMAT_1 but later versions use DATE_FORMAT_2 Using lowest common
47
	 * public for testing Bugzilla 2.18 uses DATE_FORMAT_1 but later versions use DATE_FORMAT_2 Using lowest common
46
	 * denominator DATE_FORMAT_1
48
	 * denominator DATE_FORMAT_1
Lines 100-105 Link Here
100
				parsedDate = new SimpleDateFormat(attachment_creation_ts_format).parse(dateString);
102
				parsedDate = new SimpleDateFormat(attachment_creation_ts_format).parse(dateString);
101
			} else if (attributeId.equals(BugzillaAttribute.DEADLINE.getKey())) {
103
			} else if (attributeId.equals(BugzillaAttribute.DEADLINE.getKey())) {
102
				parsedDate = new SimpleDateFormat(deadline_format).parse(dateString);
104
				parsedDate = new SimpleDateFormat(deadline_format).parse(dateString);
105
			} else if (attributeId.startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)) {
106
				parsedDate = new SimpleDateFormat(customAttribute_format).parse(dateString);
103
			}
107
			}
104
		} catch (ParseException e) {
108
		} catch (ParseException e) {
105
			return null;
109
			return null;
Lines 125-130 Link Here
125
				dateString = new SimpleDateFormat(attachment_creation_ts_format).format(date);
129
				dateString = new SimpleDateFormat(attachment_creation_ts_format).format(date);
126
			} else if (attributeId.equals(BugzillaAttribute.DEADLINE.getKey())) {
130
			} else if (attributeId.equals(BugzillaAttribute.DEADLINE.getKey())) {
127
				dateString = new SimpleDateFormat(deadline_format).format(date);
131
				dateString = new SimpleDateFormat(deadline_format).format(date);
132
			} else if (attributeId.startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)) {
133
				dateString = new SimpleDateFormat(customAttribute_format).format(date);
128
			}
134
			}
129
135
130
			if (dateString == null) {
136
			if (dateString == null) {
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java (-1 / +53 lines)
Lines 144-150 Link Here
144
				updateAttribute(data, BugzillaAttribute.SHORT_DESC);
144
				updateAttribute(data, BugzillaAttribute.SHORT_DESC);
145
			}
145
			}
146
		},
146
		},
147
		VERSION_CURRENT(4.5f) {
147
		VERSION_4_5(4.5f) {
148
			@Override
149
			void migrate(TaskRepository repository, TaskData data) {
150
				// migrate custom attributes
151
				for (TaskAttribute attribute : data.getRoot().getAttributes().values()) {
152
					if (attribute.getId().startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)) {
153
						RepositoryConfiguration configuration = BugzillaCorePlugin.getRepositoryConfiguration(repository.getRepositoryUrl());
154
155
						BugzillaCustomField customField = null;
156
						String actName = attribute.getId();
157
						for (BugzillaCustomField bugzillaCustomField : configuration.getCustomFields()) {
158
							if (actName.equals(bugzillaCustomField.getName())) {
159
								customField = bugzillaCustomField;
160
								break;
161
							}
162
						}
163
						if (customField != null) {
164
							String desc = customField.getDescription();
165
							attribute.getMetaData().defaults().setLabel(desc).setReadOnly(false);
166
							attribute.getMetaData().setKind(TaskAttribute.KIND_DEFAULT);
167
							attribute.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
168
							switch (customField.getType()) {
169
							case 1: // Free Text
170
								attribute.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
171
								break;
172
							case 2: // Drop Down
173
								attribute.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT);
174
								break;
175
							case 3: // Multiple-Selection Box
176
								attribute.getMetaData().setType(TaskAttribute.TYPE_MULTI_SELECT);
177
								break;
178
							case 4: // Large Text Box
179
								attribute.getMetaData().setType(TaskAttribute.TYPE_LONG_TEXT);
180
								break;
181
							case 5: // Date/Time
182
								attribute.getMetaData().setType(TaskAttribute.TYPE_DATE);
183
								break;
184
185
							default:
186
								List<String> options = customField.getOptions();
187
								if (options.size() > 0) {
188
									attribute.getMetaData().setType(TaskAttribute.TYPE_SINGLE_SELECT);
189
								} else {
190
									attribute.getMetaData().setType(TaskAttribute.TYPE_SHORT_TEXT);
191
								}
192
							}
193
							attribute.getMetaData().setReadOnly(false);
194
						}
195
					}
196
				}
197
			}
198
		},
199
		VERSION_CURRENT(4.6f) {
148
			@Override
200
			@Override
149
			void migrate(TaskRepository repository, TaskData data) {
201
			void migrate(TaskRepository repository, TaskData data) {
150
				data.setVersion(TaskDataVersion.VERSION_CURRENT.toString());
202
				data.setVersion(TaskDataVersion.VERSION_CURRENT.toString());
(-)src/org/eclipse/mylyn/internal/bugzilla/core/SaxConfigurationContentHandler.java (-1 / +19 lines)
Lines 85-90 Link Here
85
85
86
	private static final String ELEMENT_TYPE = "type";
86
	private static final String ELEMENT_TYPE = "type";
87
87
88
	private static final String ELEMENT_TYPE_DESC = "type_desc";
89
90
	private static final String ELEMENT_ENTER_BUG = "enter_bug";
91
88
	private static final String ELEMENT_REQUESTABLE = "requestable";
92
	private static final String ELEMENT_REQUESTABLE = "requestable";
89
93
90
	private static final String ELEMENT_SPECIFICALLY_REQUESTABLE = "specifically_requestable";
94
	private static final String ELEMENT_SPECIFICALLY_REQUESTABLE = "specifically_requestable";
Lines 159-164 Link Here
159
163
160
	private String currentMultiplicable;
164
	private String currentMultiplicable;
161
165
166
	private String currentTypeDesc = "";
167
168
	private String currentEnterBug = "";
169
162
	private StringBuffer characters = new StringBuffer();
170
	private StringBuffer characters = new StringBuffer();
163
171
164
	private String about;
172
	private String about;
Lines 242-247 Link Here
242
		} else if (localName.equals(ELEMENT_FIELD)) {
250
		} else if (localName.equals(ELEMENT_FIELD)) {
243
			state = state | IN_FIELD;
251
			state = state | IN_FIELD;
244
			parseResource(attributes);
252
			parseResource(attributes);
253
			currentName = "";
254
			currentDescription = "";
255
			currentType = "";
256
			currentTypeDesc = "";
257
			currentEnterBug = "";
245
		} else if (localName.equals(ELEMENT_FLAG_TYPES)) {
258
		} else if (localName.equals(ELEMENT_FLAG_TYPES)) {
246
			state = state | IN_FLAG_TYPES;
259
			state = state | IN_FLAG_TYPES;
247
		} else if (localName.equals(ELEMENT_FLAG_TYPE)) {
260
		} else if (localName.equals(ELEMENT_FLAG_TYPE)) {
Lines 366-372 Link Here
366
			state = state & ~IN_FIELDS;
379
			state = state & ~IN_FIELDS;
367
		} else if (localName.equals(ELEMENT_FIELD)) {
380
		} else if (localName.equals(ELEMENT_FIELD)) {
368
			if (currentName.startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)) {
381
			if (currentName.startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)) {
369
				BugzillaCustomField newField = new BugzillaCustomField(currentDescription, currentName);
382
				BugzillaCustomField newField = new BugzillaCustomField(currentDescription, currentName, currentType,
383
						currentTypeDesc, currentEnterBug);
370
				List<String> customOptionList = customOption.get(currentName);
384
				List<String> customOptionList = customOption.get(currentName);
371
				if (customOptionList != null && !customOptionList.isEmpty()) {
385
				if (customOptionList != null && !customOptionList.isEmpty()) {
372
					newField.setOptions(customOptionList);
386
					newField.setOptions(customOptionList);
Lines 378-383 Link Here
378
			currentDescription = characters.toString();
392
			currentDescription = characters.toString();
379
		} else if (localName.equals(ELEMENT_TYPE)) {
393
		} else if (localName.equals(ELEMENT_TYPE)) {
380
			currentType = characters.toString();
394
			currentType = characters.toString();
395
		} else if (localName.equals(ELEMENT_TYPE_DESC)) {
396
			currentTypeDesc = characters.toString();
397
		} else if (localName.equals(ELEMENT_ENTER_BUG)) {
398
			currentEnterBug = characters.toString();
381
		} else if (localName.equals(ELEMENT_REQUESTABLE)) {
399
		} else if (localName.equals(ELEMENT_REQUESTABLE)) {
382
			currentRequestable = characters.toString();
400
			currentRequestable = characters.toString();
383
		} else if (localName.equals(ELEMENT_SPECIFICALLY_REQUESTABLE)) {
401
		} else if (localName.equals(ELEMENT_SPECIFICALLY_REQUESTABLE)) {
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java (-2 / +7 lines)
Lines 982-989 Link Here
982
			if (a.getId().equals(BugzillaAttribute.GROUP.getKey()) && a.getValue().length() > 0) {
982
			if (a.getId().equals(BugzillaAttribute.GROUP.getKey()) && a.getValue().length() > 0) {
983
				groupSecurityEnabled = true;
983
				groupSecurityEnabled = true;
984
			}
984
			}
985
985
			if (a.getMetaData().getType().equals(TaskAttribute.TYPE_MULTI_SELECT)) {
986
			if (a.getId() != null && a.getId().compareTo("") != 0) {
986
				List<String> values = a.getValues();
987
				int i = 0;
988
				for (String string : values) {
989
					fields.put(a.getId() + i++, new NameValuePair(a.getId(), string != null ? string : ""));
990
				}
991
			} else if (a.getId() != null && a.getId().compareTo("") != 0) {
987
				String value = a.getValue();
992
				String value = a.getValue();
988
				if (a.getId().equals(BugzillaAttribute.DELTA_TS.getKey())) {
993
				if (a.getId().equals(BugzillaAttribute.DELTA_TS.getKey())) {
989
					value = stripTimeZone(value);
994
					value = stripTimeZone(value);
(-)src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java (-1 / +10 lines)
Lines 56-62 Link Here
56
56
57
		// remove unnecessary default editor parts
57
		// remove unnecessary default editor parts
58
		for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) {
58
		for (TaskEditorPartDescriptor taskEditorPartDescriptor : descriptors) {
59
			if (taskEditorPartDescriptor.getId().equals(ID_PART_PEOPLE)) {
59
			if (taskEditorPartDescriptor.getId().equals(ID_PART_PEOPLE)
60
					|| taskEditorPartDescriptor.getId().equals(ID_PART_ATTRIBUTES)) {
60
				descriptors.remove(taskEditorPartDescriptor);
61
				descriptors.remove(taskEditorPartDescriptor);
61
				break;
62
				break;
62
			}
63
			}
Lines 89-94 Link Here
89
			}
90
			}
90
		}.setPath(PATH_PEOPLE));
91
		}.setPath(PATH_PEOPLE));
91
92
93
		// Add the updated Bugzilla people part
94
		descriptors.add(new TaskEditorPartDescriptor(ID_PART_ATTRIBUTES) {
95
			@Override
96
			public AbstractTaskEditorPart createPart() {
97
				return new BugzillaAttributePart();
98
			}
99
		}.setPath(PATH_ATTRIBUTES));
100
92
		return descriptors;
101
		return descriptors;
93
	}
102
	}
94
103
(-)src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaAttributePart.java (+52 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 Tasktop Technologies and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     Tasktop Technologies - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.bugzilla.ui.editor;
13
14
import java.util.Map;
15
16
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField;
17
import org.eclipse.mylyn.internal.tasks.ui.editors.DateAttributeEditor;
18
import org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorAttributePart;
19
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
20
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
21
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
22
23
@SuppressWarnings("restriction")
24
public class BugzillaAttributePart extends TaskEditorAttributePart {
25
26
	@Override
27
	protected void initialize() {
28
		setHasIncoming(false);
29
30
		Map<String, TaskAttribute> attributes = getTaskData().getRoot().getAttributes();
31
		for (TaskAttribute attribute : attributes.values()) {
32
			TaskAttributeMetaData properties = attribute.getMetaData();
33
			if (!TaskAttribute.KIND_DEFAULT.equals(properties.getKind())) {
34
				continue;
35
			}
36
37
			AbstractAttributeEditor attributeEditor = createAttributeEditor(attribute);
38
			if (attributeEditor != null) {
39
				String attributeId = attribute.getId();
40
				if (attributeId.startsWith(BugzillaCustomField.CUSTOM_FIELD_PREFIX)
41
						&& attributeEditor instanceof DateAttributeEditor) {
42
					((DateAttributeEditor) attributeEditor).setShowTime(true);
43
				}
44
45
				addAttributeEditor(attributeEditor);
46
				if (getModel().hasIncomingChanges(attribute)) {
47
					setHasIncoming(true);
48
				}
49
			}
50
		}
51
	}
52
}

Return to bug 226851