|
Lines 11-16
Link Here
|
| 11 |
package org.eclipse.mylyn.internal.tasks.ui.editors; |
11 |
package org.eclipse.mylyn.internal.tasks.ui.editors; |
| 12 |
|
12 |
|
| 13 |
import java.util.Collections; |
13 |
import java.util.Collections; |
|
|
14 |
import java.util.HashSet; |
| 14 |
import java.util.List; |
15 |
import java.util.List; |
| 15 |
import java.util.Map; |
16 |
import java.util.Map; |
| 16 |
|
17 |
|
|
Lines 43-48
Link Here
|
| 43 |
|
44 |
|
| 44 |
private Text valueText; |
45 |
private Text valueText; |
| 45 |
|
46 |
|
|
|
47 |
private Composite parent; |
| 48 |
|
| 46 |
public CheckboxMultiSelectAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) { |
49 |
public CheckboxMultiSelectAttributeEditor(TaskDataModel manager, TaskAttribute taskAttribute) { |
| 47 |
super(manager, taskAttribute); |
50 |
super(manager, taskAttribute); |
| 48 |
setLayoutHint(new LayoutHint(RowSpan.SINGLE, ColumnSpan.MULTIPLE)); |
51 |
setLayoutHint(new LayoutHint(RowSpan.SINGLE, ColumnSpan.MULTIPLE)); |
|
Lines 50-61
Link Here
|
| 50 |
|
53 |
|
| 51 |
@Override |
54 |
@Override |
| 52 |
public void createControl(Composite parent, FormToolkit toolkit) { |
55 |
public void createControl(Composite parent, FormToolkit toolkit) { |
|
|
56 |
this.parent = parent; |
| 57 |
|
| 53 |
Composite composite = toolkit.createComposite(parent); |
58 |
Composite composite = toolkit.createComposite(parent); |
| 54 |
GridLayout layout = new GridLayout(2, false); |
59 |
GridLayout layout = new GridLayout(2, false); |
| 55 |
layout.marginWidth = 1; |
60 |
layout.marginWidth = 1; |
| 56 |
composite.setLayout(layout); |
61 |
composite.setLayout(layout); |
| 57 |
|
62 |
|
| 58 |
valueText = toolkit.createText(composite, "", SWT.FLAT); //$NON-NLS-1$ |
63 |
valueText = toolkit.createText(composite, "", SWT.FLAT | SWT.WRAP); //$NON-NLS-1$ |
| 59 |
valueText.setFont(EditorUtil.TEXT_FONT); |
64 |
valueText.setFont(EditorUtil.TEXT_FONT); |
| 60 |
|
65 |
|
| 61 |
GridData gd = new GridData(GridData.FILL_HORIZONTAL); |
66 |
GridData gd = new GridData(GridData.FILL_HORIZONTAL); |
|
Lines 84-92
Link Here
|
| 84 |
|
89 |
|
| 85 |
List<String> newValues = selectionDialog.getSelectedValues(); |
90 |
List<String> newValues = selectionDialog.getSelectedValues(); |
| 86 |
if (responseCode == Window.OK && values != null) { |
91 |
if (responseCode == Window.OK && values != null) { |
| 87 |
setValues(newValues); |
92 |
if (!new HashSet<String>(getValues()).equals(new HashSet<String>(newValues))) { |
| 88 |
attributeChanged(); |
93 |
setValues(newValues); |
| 89 |
updateText(); |
94 |
attributeChanged(); |
|
|
95 |
updateText(); |
| 96 |
} |
| 90 |
} else { |
97 |
} else { |
| 91 |
return; |
98 |
return; |
| 92 |
} |
99 |
} |
|
Lines 111-116
Link Here
|
| 111 |
} |
118 |
} |
| 112 |
} |
119 |
} |
| 113 |
valueText.setText(valueString.toString()); |
120 |
valueText.setText(valueString.toString()); |
|
|
121 |
if (valueText != null && parent != null && parent.getParent() != null |
| 122 |
&& parent.getParent().getParent() != null) { |
| 123 |
valueText.setSize(valueText.computeSize(valueText.getSize().x, SWT.DEFAULT)); |
| 124 |
parent.getParent().getParent().layout(true, true); |
| 125 |
} |
| 114 |
} |
126 |
} |
| 115 |
} |
127 |
} |
| 116 |
|
128 |
|