Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 166595 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java (-2 / +180 lines)
Lines 11-27 Link Here
11
11
12
package org.eclipse.mylyn.internal.bugzilla.ui.editor;
12
package org.eclipse.mylyn.internal.bugzilla.ui.editor;
13
13
14
import java.util.Collections;
15
import java.util.HashMap;
16
import java.util.List;
17
import java.util.Map;
14
import java.util.Set;
18
import java.util.Set;
15
19
16
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.core.runtime.CoreException;
21
import org.eclipse.core.runtime.IStatus;
22
import org.eclipse.core.runtime.NullProgressMonitor;
17
import org.eclipse.jface.dialogs.IMessageProvider;
23
import org.eclipse.jface.dialogs.IMessageProvider;
24
import org.eclipse.mylyn.commons.core.StatusHandler;
18
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
25
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
19
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
26
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
20
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField;
27
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField;
28
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler;
29
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
21
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
30
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
31
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
32
import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin;
33
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
22
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
34
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
23
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
35
import org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData;
24
import org.eclipse.mylyn.tasks.core.data.TaskData;
36
import org.eclipse.mylyn.tasks.core.data.TaskData;
37
import org.eclipse.mylyn.tasks.core.data.TaskDataModel;
38
import org.eclipse.mylyn.tasks.core.data.TaskDataModelEvent;
39
import org.eclipse.mylyn.tasks.core.data.TaskDataModelListener;
25
import org.eclipse.mylyn.tasks.ui.TasksUi;
40
import org.eclipse.mylyn.tasks.ui.TasksUi;
26
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
41
import org.eclipse.mylyn.tasks.ui.editors.AbstractAttributeEditor;
27
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
42
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
Lines 29-34 Link Here
29
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory;
44
import org.eclipse.mylyn.tasks.ui.editors.AttributeEditorFactory;
30
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
45
import org.eclipse.mylyn.tasks.ui.editors.LayoutHint;
31
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
46
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
47
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorInput;
32
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
48
import org.eclipse.mylyn.tasks.ui.editors.TaskEditorPartDescriptor;
33
49
34
/**
50
/**
Lines 41-48 Link Here
41
57
42
	public static final String ID_PART_BUGZILLA_FLAGS = "org.eclipse.mylyn.bugzilla.ui.editors.part.flags"; //$NON-NLS-1$
58
	public static final String ID_PART_BUGZILLA_FLAGS = "org.eclipse.mylyn.bugzilla.ui.editors.part.flags"; //$NON-NLS-1$
43
59
60
	private final Map<TaskAttribute, AbstractAttributeEditor> attributeEditorMap;
61
62
	private TaskDataModelListener productListener;
63
44
	public BugzillaTaskEditorPage(TaskEditor editor) {
64
	public BugzillaTaskEditorPage(TaskEditor editor) {
45
		super(editor, BugzillaCorePlugin.CONNECTOR_KIND);
65
		this(editor, BugzillaCorePlugin.CONNECTOR_KIND);
46
	}
66
	}
47
67
48
	/**
68
	/**
Lines 53-58 Link Here
53
	 */
73
	 */
54
	public BugzillaTaskEditorPage(TaskEditor editor, String connectorKind) {
74
	public BugzillaTaskEditorPage(TaskEditor editor, String connectorKind) {
55
		super(editor, connectorKind);
75
		super(editor, connectorKind);
76
		this.attributeEditorMap = new HashMap<TaskAttribute, AbstractAttributeEditor>();
56
	}
77
	}
57
78
58
	@Override
79
	@Override
Lines 138-144 Link Here
138
						}
159
						}
139
					});
160
					});
140
				}
161
				}
141
162
				BugzillaTaskEditorPage.this.addToAttributeEditorMap(taskAttribute, editor);
142
				return editor;
163
				return editor;
143
			}
164
			}
144
		};
165
		};
Lines 193-196 Link Here
193
		super.doSubmit();
214
		super.doSubmit();
194
	}
215
	}
195
216
217
	@Override
218
	protected void createParts() {
219
		attributeEditorMap.clear();
220
		super.createParts();
221
	}
222
223
	@Override
224
	protected TaskDataModel createModel(TaskEditorInput input) throws CoreException {
225
		TaskDataModel model = super.createModel(input);
226
		BugzillaVersion bugzillaVersion = null;
227
		RepositoryConfiguration repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(
228
				input.getTaskRepository(), false, new NullProgressMonitor());
229
		if (repositoryConfiguration != null) {
230
			bugzillaVersion = repositoryConfiguration.getInstallVersion();
231
		} else {
232
			bugzillaVersion = BugzillaVersion.MIN_VERSION;
233
		}
234
		if (bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_0) >= 0) {
235
			productListener = new ProductSelectionListener();
236
			model.addModelListener(productListener);
237
		}
238
		return model;
239
	}
240
241
	/**
242
	 * @since 3.1
243
	 */
244
	public void addToAttributeEditorMap(TaskAttribute attribute, AbstractAttributeEditor editor) {
245
		if (attributeEditorMap.containsKey(attribute)) {
246
			attributeEditorMap.remove(attribute);
247
		}
248
		attributeEditorMap.put(attribute, editor);
249
	}
250
251
	/**
252
	 * @since 3.1
253
	 */
254
	public AbstractAttributeEditor getEditorForAttribute(TaskAttribute attribute) {
255
		return attributeEditorMap.get(attribute);
256
	}
257
258
	/**
259
	 * @since 3.1
260
	 */
261
	public Map<TaskAttribute, AbstractAttributeEditor> getAttributeEditorMap() {
262
		return attributeEditorMap;
263
	}
264
265
	/**
266
	 * @since 3.1
267
	 */
268
	public void refresh() {
269
		try {
270
			showEditorBusy(true);
271
			for (AbstractAttributeEditor abstractAttributeEditor : attributeEditorMap.values()) {
272
				try {
273
					abstractAttributeEditor.refresh();
274
				} catch (UnsupportedOperationException e) {
275
					// ignore
276
				}
277
			}
278
		} finally {
279
			showEditorBusy(false);
280
		}
281
	}
282
283
	public void refresh(TaskAttribute attributeComponent) {
284
		AbstractAttributeEditor editor = getEditorForAttribute(attributeComponent);
285
		if (editor != null) {
286
			try {
287
				editor.refresh();
288
			} catch (UnsupportedOperationException e) {
289
				// ignore
290
			}
291
		}
292
	}
293
294
	private class ProductSelectionListener extends TaskDataModelListener {
295
		@Override
296
		public void attributeChanged(TaskDataModelEvent event) {
297
			TaskAttribute taskAttribute = event.getTaskAttribute();
298
			if (taskAttribute != null) {
299
				if (taskAttribute.getId().equals(BugzillaAttribute.PRODUCT.getKey())) {
300
					RepositoryConfiguration repositoryConfiguration = null;
301
					try {
302
						repositoryConfiguration = BugzillaCorePlugin.getRepositoryConfiguration(
303
								getModel().getTaskRepository(), false, new NullProgressMonitor());
304
					} catch (CoreException e) {
305
						StatusHandler.log(new RepositoryStatus(getTaskRepository(), IStatus.ERROR,
306
								BugzillaUiPlugin.ID_PLUGIN, 0, "Failed to obtain repository configuration", e)); //$NON-NLS-1$
307
						getTaskEditor().setMessage("Problem occured when updating attributes", IMessageProvider.ERROR); //$NON-NLS-1$
308
						return;
309
					}
310
311
					TaskAttribute attributeComponent = taskAttribute.getTaskData().getRoot().getMappedAttribute(
312
							BugzillaAttribute.COMPONENT.getKey());
313
					if (attributeComponent != null) {
314
						List<String> optionValues = repositoryConfiguration.getComponents(taskAttribute.getValue());
315
						Collections.sort(optionValues);
316
						attributeComponent.clearOptions();
317
						for (String option : optionValues) {
318
							attributeComponent.putOption(option, option);
319
						}
320
						if (optionValues.size() == 1) {
321
							attributeComponent.setValue(optionValues.get(0));
322
						} else {
323
							attributeComponent.setValue(""); //$NON-NLS-1$
324
						}
325
						refresh(attributeComponent);
326
					}
327
328
					TaskAttribute attributeTargetMilestone = taskAttribute.getTaskData().getRoot().getMappedAttribute(
329
							BugzillaAttribute.TARGET_MILESTONE.getKey());
330
					if (attributeTargetMilestone != null) {
331
						List<String> optionValues = repositoryConfiguration.getTargetMilestones(taskAttribute.getValue());
332
						Collections.sort(optionValues);
333
						attributeTargetMilestone.clearOptions();
334
						for (String option : optionValues) {
335
							attributeTargetMilestone.putOption(option, option);
336
						}
337
						if (optionValues.size() == 1) {
338
							attributeTargetMilestone.setValue(optionValues.get(0));
339
						} else {
340
							attributeTargetMilestone.setValue("---"); //$NON-NLS-1$
341
						}
342
						refresh(attributeTargetMilestone);
343
					}
344
345
					TaskAttribute attributeDefaultAssignee = taskAttribute.getTaskData().getRoot().getMappedAttribute(
346
							BugzillaAttribute.SET_DEFAULT_ASSIGNEE.getKey());
347
					if (attributeDefaultAssignee != null) {
348
						attributeDefaultAssignee.setValue("1"); //$NON-NLS-1$
349
						refresh(attributeDefaultAssignee);
350
					}
351
352
/*
353
 * 					add confirm_product_change to avoid verification page on submit
354
 */
355
					TaskAttribute attributeConfirmeProductChange = taskAttribute.getTaskData()
356
							.getRoot()
357
							.getMappedAttribute(BugzillaAttribute.CONFIRM_PRODUCT_CHANGE.getKey());
358
					if (attributeConfirmeProductChange == null) {
359
//						attributeConfirmeProductChange = taskAttribute.getTaskData().getRoot().createAttribute(
360
//								BugzillaAttribute.CONFIRM_PRODUCT_CHANGE.getKey());
361
						BugzillaTaskDataHandler.createAttribute(taskAttribute.getTaskData().getRoot(),
362
								BugzillaAttribute.CONFIRM_PRODUCT_CHANGE);
363
						attributeConfirmeProductChange = taskAttribute.getTaskData().getRoot().getMappedAttribute(
364
								BugzillaAttribute.CONFIRM_PRODUCT_CHANGE.getKey());
365
					}
366
					if (attributeConfirmeProductChange != null) {
367
						attributeConfirmeProductChange.setValue("1");
368
					}
369
				}
370
			}
371
		}
372
	}
373
196
}
374
}
(-)src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java (+7 lines)
Lines 368-373 Link Here
368
			addMissingFlags(taskData);
368
			addMissingFlags(taskData);
369
			updateAttributeOptions(taskData);
369
			updateAttributeOptions(taskData);
370
			addValidOperations(taskData);
370
			addValidOperations(taskData);
371
			BugzillaVersion bugzillaVersion = getInstallVersion();
372
			if (bugzillaVersion.compareTo(BugzillaVersion.BUGZILLA_3_0) < 0) {
373
				// Product change is only supported for Versions >= 3.0 without verify html page
374
				TaskAttribute productAttribute = taskData.getRoot().getMappedAttribute(
375
						BugzillaAttribute.PRODUCT.getKey());
376
				productAttribute.getMetaData().setReadOnly(true);
377
			}
371
		}
378
		}
372
	}
379
	}
373
380
(-)src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttribute.java (-1 / +3 lines)
Lines 64-69 Link Here
64
64
65
	COMPONENT(Messages.BugzillaAttribute_Component, "component", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
65
	COMPONENT(Messages.BugzillaAttribute_Component, "component", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
66
66
67
	CONFIRM_PRODUCT_CHANGE(Messages.BugzillaAttribute_confirm_product_change, "confirm_product_change", TaskAttribute.TYPE_BOOLEAN, true, false), //$NON-NLS-1$
68
67
	CREATION_TS(Messages.BugzillaAttribute_Opened, "creation_ts", TaskAttribute.TYPE_DATE, true, false), //$NON-NLS-1$
69
	CREATION_TS(Messages.BugzillaAttribute_Opened, "creation_ts", TaskAttribute.TYPE_DATE, true, false), //$NON-NLS-1$
68
70
69
	CTYPE(Messages.BugzillaAttribute_Content_Type, "ctype", TaskAttribute.TYPE_SHORT_TEXT, false, false), //$NON-NLS-1$
71
	CTYPE(Messages.BugzillaAttribute_Content_Type, "ctype", TaskAttribute.TYPE_SHORT_TEXT, false, false), //$NON-NLS-1$
Lines 109-115 Link Here
109
111
110
	PRIORITY(Messages.BugzillaAttribute_Priority, "priority", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
112
	PRIORITY(Messages.BugzillaAttribute_Priority, "priority", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
111
113
112
	PRODUCT(Messages.BugzillaAttribute_Product, "product", TaskAttribute.TYPE_SHORT_TEXT, false, true), //$NON-NLS-1$
114
	PRODUCT(Messages.BugzillaAttribute_Product, "product", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
113
115
114
	REP_PLATFORM(Messages.BugzillaAttribute_Platform, "rep_platform", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
116
	REP_PLATFORM(Messages.BugzillaAttribute_Platform, "rep_platform", TaskAttribute.TYPE_SINGLE_SELECT, false, false), //$NON-NLS-1$
115
117
(-)src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties (+1 lines)
Lines 31-36 Link Here
31
BugzillaAttribute_Keywords=Keywords:
31
BugzillaAttribute_Keywords=Keywords:
32
BugzillaAttribute_Modified=Modified:
32
BugzillaAttribute_Modified=Modified:
33
BugzillaAttribute_new_comment=new comment
33
BugzillaAttribute_new_comment=new comment
34
BugzillaAttribute_confirm_product_change=Confirm Product Change(never shown in the UI)
34
BugzillaAttribute_Number_of_comments=Number of comments
35
BugzillaAttribute_Number_of_comments=Number of comments
35
BugzillaAttribute_Obsolete=Obsolete
36
BugzillaAttribute_Obsolete=Obsolete
36
BugzillaAttribute_open_status_values=open status values
37
BugzillaAttribute_open_status_values=open status values
(-)src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java (+2 lines)
Lines 91-96 Link Here
91
91
92
	public static String BugzillaAttribute_new_comment;
92
	public static String BugzillaAttribute_new_comment;
93
93
94
	public static String BugzillaAttribute_confirm_product_change;
95
94
	public static String BugzillaAttribute_Number_of_comments;
96
	public static String BugzillaAttribute_Number_of_comments;
95
97
96
	public static String BugzillaAttribute_Obsolete;
98
	public static String BugzillaAttribute_Obsolete;
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/SingleSelectionAttributeEditor.java (-24 / +47 lines)
Lines 34-39 Link Here
34
34
35
	private CCombo combo;
35
	private CCombo combo;
36
36
37
	private boolean ignoreNotification;
38
39
	private Text text;
40
37
	public SingleSelectionAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
41
	public SingleSelectionAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
38
		super(manager, taskAttribute);
42
		super(manager, taskAttribute);
39
	}
43
	}
Lines 41-57 Link Here
41
	@Override
45
	@Override
42
	public void createControl(Composite parent, FormToolkit toolkit) {
46
	public void createControl(Composite parent, FormToolkit toolkit) {
43
		if (isReadOnly()) {
47
		if (isReadOnly()) {
44
			Text text = new Text(parent, SWT.FLAT | SWT.READ_ONLY);
48
			text = new Text(parent, SWT.FLAT | SWT.READ_ONLY);
45
			text.setFont(EditorUtil.TEXT_FONT);
49
			text.setFont(EditorUtil.TEXT_FONT);
46
			toolkit.adapt(text, false, false);
50
			toolkit.adapt(text, false, false);
47
			text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
51
			text.setData(FormToolkit.KEY_DRAW_BORDER, Boolean.FALSE);
48
			String label = getValueLabel();
52
			refresh();
49
			if ("".equals(label)) { //$NON-NLS-1$
50
				// if set to the empty string the label will use 64px on GTK 
51
				text.setText(" "); //$NON-NLS-1$
52
			} else {
53
				text.setText(label);
54
			}
55
			setControl(text);
53
			setControl(text);
56
		} else {
54
		} else {
57
			combo = new CCombo(parent, SWT.FLAT | SWT.READ_ONLY);
55
			combo = new CCombo(parent, SWT.FLAT | SWT.READ_ONLY);
Lines 59-83 Link Here
59
			combo.setFont(EditorUtil.TEXT_FONT);
57
			combo.setFont(EditorUtil.TEXT_FONT);
60
			combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
58
			combo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
61
59
62
			Map<String, String> labelByValue = getAttributeMapper().getOptions(getTaskAttribute());
60
			refresh();
63
			if (labelByValue != null) {
64
				values = labelByValue.keySet().toArray(new String[0]);
65
				for (String value : values) {
66
					combo.add(labelByValue.get(value));
67
				}
68
			}
69
70
			select(getValue(), getValueLabel());
71
61
72
			if (values != null) {
62
			if (values != null) {
73
				combo.addSelectionListener(new SelectionAdapter() {
63
				combo.addSelectionListener(new SelectionAdapter() {
74
					@Override
64
					@Override
75
					public void widgetSelected(SelectionEvent event) {
65
					public void widgetSelected(SelectionEvent event) {
76
						int index = combo.getSelectionIndex();
66
						if (!ignoreNotification) {
77
						if (index > -1) {
67
							int index = combo.getSelectionIndex();
78
							Assert.isNotNull(values);
68
							if (index > -1) {
79
							Assert.isLegal(index >= 0 && index <= values.length - 1);
69
								Assert.isNotNull(values);
80
							setValue(values[index]);
70
								Assert.isLegal(index >= 0 && index <= values.length - 1);
71
								setValue(values[index]);
72
							}
81
						}
73
						}
82
					}
74
					}
83
				});
75
				});
Lines 109-116 Link Here
109
	}
101
	}
110
102
111
	public void setValue(String value) {
103
	public void setValue(String value) {
112
		getAttributeMapper().setValue(getTaskAttribute(), value);
104
		String oldValue = getAttributeMapper().getValue(getTaskAttribute());
113
		attributeChanged();
105
		if (!oldValue.equals(value)) {
106
			getAttributeMapper().setValue(getTaskAttribute(), value);
107
			attributeChanged();
108
		}
114
	}
109
	}
115
110
116
	void selectDefaultValue() {
111
	void selectDefaultValue() {
Lines 120-123 Link Here
120
		}
115
		}
121
	}
116
	}
122
117
118
	@Override
119
	public void refresh() {
120
		try {
121
			ignoreNotification = true;
122
			if (text != null) {
123
				String label = getValueLabel();
124
				if ("".equals(label)) { //$NON-NLS-1$
125
					// if set to the empty string the label will use 64px on GTK 
126
					text.setText(" "); //$NON-NLS-1$
127
				} else {
128
					text.setText(label);
129
				}
130
			} else {
131
				combo.removeAll();
132
				Map<String, String> labelByValue = getAttributeMapper().getOptions(getTaskAttribute());
133
				if (labelByValue != null) {
134
					values = labelByValue.keySet().toArray(new String[0]);
135
					for (String value : values) {
136
						combo.add(labelByValue.get(value));
137
					}
138
				}
139
				select(getValue(), getValueLabel());
140
				combo.redraw();
141
			}
142
		} finally {
143
			ignoreNotification = false;
144
		}
145
	}
123
}
146
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/BooleanAttributeEditor.java (-3 / +18 lines)
Lines 26-46 Link Here
26
 */
26
 */
27
public class BooleanAttributeEditor extends AbstractAttributeEditor {
27
public class BooleanAttributeEditor extends AbstractAttributeEditor {
28
28
29
	private Button button;
30
31
	private boolean ignoreNotification;
32
29
	public BooleanAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
33
	public BooleanAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) {
30
		super(manager, taskAttribute);
34
		super(manager, taskAttribute);
31
	}
35
	}
32
36
33
	@Override
37
	@Override
34
	public void createControl(Composite parent, FormToolkit toolkit) {
38
	public void createControl(Composite parent, FormToolkit toolkit) {
35
		final Button button = toolkit.createButton(parent, super.getLabel(), SWT.CHECK);
39
		button = toolkit.createButton(parent, super.getLabel(), SWT.CHECK);
36
		button.setEnabled(!isReadOnly());
40
		button.setEnabled(!isReadOnly());
37
		button.setSelection(getValue());
38
		button.addSelectionListener(new SelectionAdapter() {
41
		button.addSelectionListener(new SelectionAdapter() {
39
			@Override
42
			@Override
40
			public void widgetSelected(SelectionEvent e) {
43
			public void widgetSelected(SelectionEvent e) {
41
				setValue(button.getSelection());
44
				if (!ignoreNotification) {
45
					setValue(button.getSelection());
46
				}
42
			}
47
			}
43
		});
48
		});
49
		refresh();
44
		setControl(button);
50
		setControl(button);
45
	}
51
	}
46
52
Lines 58-61 Link Here
58
		attributeChanged();
64
		attributeChanged();
59
	}
65
	}
60
66
67
	@Override
68
	public void refresh() {
69
		try {
70
			ignoreNotification = true;
71
			button.setSelection(getValue());
72
		} finally {
73
			ignoreNotification = false;
74
		}
75
	}
61
}
76
}
(-)src/org/eclipse/mylyn/tasks/ui/editors/AbstractAttributeEditor.java (+15 lines)
Lines 213-216 Link Here
213
		this.readOnly = readOnly;
213
		this.readOnly = readOnly;
214
	}
214
	}
215
215
216
	/**
217
	 * Refreshes the state of the widget from the data model. The default implementation throws
218
	 * <code>UnsupportedOperationException</code>.
219
	 * 
220
	 * <p>
221
	 * Subclasses should overwrite this method.
222
	 * 
223
	 * @since 3.1
224
	 * @throws UnsupportedOperationException
225
	 *             if this method is not supported by the editor
226
	 */
227
	public void refresh() {
228
		throw new UnsupportedOperationException();
229
	}
230
216
}
231
}

Return to bug 166595