51
51
public class TodoTaskConfigurationBlock extends OptionsConfigurationBlock {
52
52
private static final Key PREF_TODO_TASK_TAGS = getCDTCoreKey(CCorePreferenceConstants.TODO_TASK_TAGS);
53
53
private static final Key PREF_TODO_TASK_PRIORITIES = getCDTCoreKey(CCorePreferenceConstants.TODO_TASK_PRIORITIES);
55
54
private static final Key PREF_TODO_TASK_CASE_SENSITIVE = getCDTCoreKey(CCorePreferenceConstants.TODO_TASK_CASE_SENSITIVE);
56
private static final Key[] ALL_KEYS = new Key[] {
57
PREF_TODO_TASK_TAGS, PREF_TODO_TASK_PRIORITIES, PREF_TODO_TASK_CASE_SENSITIVE
57
60
private static final String TASK_PRIORITY_HIGH = CCorePreferenceConstants.TASK_PRIORITY_HIGH;
58
61
private static final String TASK_PRIORITY_NORMAL = CCorePreferenceConstants.TASK_PRIORITY_NORMAL;
59
62
private static final String TASK_PRIORITY_LOW = CCorePreferenceConstants.TASK_PRIORITY_LOW;
68
71
public TodoTaskLabelProvider() {
72
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
75
75
public Image getImage(Object element) {
76
return null; // JavaPluginImages.get(JavaPluginImages.IMG_OBJS_REFACTORING_INFO);
80
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
83
80
public String getText(Object element) {
84
81
return getColumnText(element, 0);
88
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
91
85
public Image getColumnImage(Object element, int columnIndex) {
95
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
98
90
public String getColumnText(Object element, int columnIndex) {
99
91
TodoTask task = (TodoTask) element;
133
122
return getComparator().compare(((TodoTask) e1).name, ((TodoTask) e2).name);
137
126
private static final int IDX_ADD = 0;
138
127
private static final int IDX_EDIT = 1;
139
128
private static final int IDX_REMOVE = 2;
147
136
public TodoTaskConfigurationBlock(IStatusChangeListener context, IProject project, IWorkbenchPreferenceContainer container) {
148
super(context, project, getKeys(), container);
137
super(context, project, ALL_KEYS, container);
150
139
TaskTagAdapter adapter = new TaskTagAdapter();
151
140
String[] buttons = new String[] {
199
188
fTodoTasksList.enableButton(IDX_DEFAULT, false);
202
private static Key[] getKeys() {
204
PREF_TODO_TASK_TAGS, PREF_TODO_TASK_PRIORITIES, PREF_TODO_TASK_CASE_SENSITIVE
208
191
public class TaskTagAdapter implements IListAdapter<TodoTask>, IDialogFieldListener {
209
192
private boolean canEdit(List<TodoTask> selectedElements) {
210
193
return selectedElements.size() == 1;
243
226
protected Control createContents(Composite parent) {
244
227
setShell(parent.getShell());
246
Composite markersComposite = createMarkersTabContent(parent);
248
validateSettings(null, null, null);
250
return markersComposite;
253
private Composite createMarkersTabContent(Composite folder) {
254
228
GridLayout layout = new GridLayout();
255
229
layout.marginHeight = 0;
256
230
layout.marginWidth = 0;
257
231
layout.numColumns = 2;
259
PixelConverter conv = new PixelConverter(folder);
233
PixelConverter conv = new PixelConverter(parent);
261
Composite markersComposite = new Composite(folder, SWT.NULL);
262
markersComposite.setLayout(layout);
263
markersComposite.setFont(folder.getFont());
235
Composite composite = new Composite(parent, SWT.NULL);
236
composite.setLayout(layout);
237
composite.setFont(parent.getFont());
265
239
GridData data = new GridData(GridData.FILL_BOTH);
266
240
data.widthHint = conv.convertWidthInCharsToPixels(50);
267
Control listControl = fTodoTasksList.getListControl(markersComposite);
241
Control listControl = fTodoTasksList.getListControl(composite);
268
242
listControl.setLayoutData(data);
270
Control buttonsControl = fTodoTasksList.getButtonBox(markersComposite);
244
Control buttonsControl = fTodoTasksList.getButtonBox(composite);
271
245
buttonsControl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING));
273
fCaseSensitiveCheckBox.doFillIntoGrid(markersComposite, 2);
275
return markersComposite;
247
fCaseSensitiveCheckBox.doFillIntoGrid(composite, 2);
249
validateSettings(null, null, null);
298
274
return new StatusInfo();
301
protected final void updateModel(DialogField field) {
277
private void updateModel(DialogField field) {
302
278
if (field == fTodoTasksList) {
303
279
StringBuffer tags = new StringBuffer();
304
280
StringBuffer prios = new StringBuffer();