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 250257 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorAttachmentPart.java (-12 / +129 lines)
Lines 13-22 Link Here
13
13
14
package org.eclipse.mylyn.internal.tasks.ui.editors;
14
package org.eclipse.mylyn.internal.tasks.ui.editors;
15
15
16
import java.io.File;
17
import java.io.FileInputStream;
18
import java.io.FileOutputStream;
19
import java.io.IOException;
20
import java.io.ObjectInputStream;
21
import java.io.ObjectOutputStream;
16
import java.util.ArrayList;
22
import java.util.ArrayList;
17
import java.util.Date;
23
import java.util.Date;
18
import java.util.List;
24
import java.util.List;
19
25
26
import org.eclipse.core.runtime.IPath;
27
import org.eclipse.core.runtime.IStatus;
28
import org.eclipse.core.runtime.Platform;
29
import org.eclipse.core.runtime.Status;
20
import org.eclipse.jface.action.Action;
30
import org.eclipse.jface.action.Action;
21
import org.eclipse.jface.action.IMenuListener;
31
import org.eclipse.jface.action.IMenuListener;
22
import org.eclipse.jface.action.IMenuManager;
32
import org.eclipse.jface.action.IMenuManager;
Lines 32-39 Link Here
32
import org.eclipse.jface.viewers.Viewer;
42
import org.eclipse.jface.viewers.Viewer;
33
import org.eclipse.jface.viewers.ViewerSorter;
43
import org.eclipse.jface.viewers.ViewerSorter;
34
import org.eclipse.jface.window.ToolTip;
44
import org.eclipse.jface.window.ToolTip;
45
import org.eclipse.mylyn.commons.core.StatusHandler;
35
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
46
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
36
import org.eclipse.mylyn.internal.tasks.core.TaskAttachment;
47
import org.eclipse.mylyn.internal.tasks.core.TaskAttachment;
48
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
49
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
37
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus;
50
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus;
38
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskAttachmentWizard.Mode;
51
import org.eclipse.mylyn.internal.tasks.ui.wizards.TaskAttachmentWizard.Mode;
39
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
52
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
Lines 41-46 Link Here
41
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
54
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
42
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
55
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
43
import org.eclipse.swt.SWT;
56
import org.eclipse.swt.SWT;
57
import org.eclipse.swt.events.ControlEvent;
58
import org.eclipse.swt.events.ControlListener;
44
import org.eclipse.swt.events.SelectionAdapter;
59
import org.eclipse.swt.events.SelectionAdapter;
45
import org.eclipse.swt.events.SelectionEvent;
60
import org.eclipse.swt.events.SelectionEvent;
46
import org.eclipse.swt.layout.GridData;
61
import org.eclipse.swt.layout.GridData;
Lines 65-76 Link Here
65
80
66
	private static final String ID_POPUP_MENU = "org.eclipse.mylyn.tasks.ui.editor.menu.attachments"; //$NON-NLS-1$
81
	private static final String ID_POPUP_MENU = "org.eclipse.mylyn.tasks.ui.editor.menu.attachments"; //$NON-NLS-1$
67
82
68
	private final String[] attachmentsColumns = { Messages.TaskEditorAttachmentPart_Name,
69
			Messages.TaskEditorAttachmentPart_Description, /*"Type", */Messages.TaskEditorAttachmentPart_Size,
70
			Messages.TaskEditorAttachmentPart_Creator, Messages.TaskEditorAttachmentPart_Created };
71
72
	private final int[] attachmentsColumnWidths = { 130, 150, /*100,*/70, 100, 100 };
73
74
	private List<TaskAttribute> attachments;
83
	private List<TaskAttribute> attachments;
75
84
76
	private boolean hasIncoming;
85
	private boolean hasIncoming;
Lines 79-84 Link Here
79
88
80
	private Composite attachmentsComposite;
89
	private Composite attachmentsComposite;
81
90
91
	static ArrayList<ColumnState> columnInfos = new ArrayList<ColumnState>(5);
92
93
	private static boolean propertyListenerIstalled = false;
94
95
	private static org.eclipse.jface.util.IPropertyChangeListener PROPERTY_LISTENER = new org.eclipse.jface.util.IPropertyChangeListener() {
96
97
		public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) {
98
			if (event.getProperty().equals(ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH)) {
99
				if (TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(
100
						ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH)) {
101
					columnInfos.clear();
102
					readState();
103
				}
104
			}
105
		}
106
	};
107
82
	public TaskEditorAttachmentPart() {
108
	public TaskEditorAttachmentPart() {
83
		setPartName(Messages.TaskEditorAttachmentPart_Attachments);
109
		setPartName(Messages.TaskEditorAttachmentPart_Attachments);
84
	}
110
	}
Lines 91-108 Link Here
91
		GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).hint(500, SWT.DEFAULT).applyTo(
117
		GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, false).hint(500, SWT.DEFAULT).applyTo(
92
				attachmentsTable);
118
				attachmentsTable);
93
		attachmentsTable.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
119
		attachmentsTable.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);
120
		boolean showAttachmentID = TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(
121
				ITasksUiPreferenceConstants.ATTACHMENT_SHOW_ID);
122
		int offset = showAttachmentID ? 0 : -1;
123
		for (int i = 0; i < columnInfos.size(); i++) {
124
			if (!showAttachmentID && i == 0) {
125
				continue;
126
			}
127
			final int index = i + offset;
128
			final TableColumn column = new TableColumn(attachmentsTable, SWT.LEFT, index);
129
			column.setText(columnInfos.get(i).getName());
130
			column.setWidth(columnInfos.get(i).getWidths());
131
			column.addControlListener(new ControlListener() {
132
133
				public void controlResized(ControlEvent e) {
134
					if (!TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(
135
							ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH)) {
136
						columnInfos.get(index).setWidths(column.getWidth());
137
						writeState();
138
					}
139
				}
94
140
95
		for (int i = 0; i < attachmentsColumns.length; i++) {
141
				public void controlMoved(ControlEvent e) {
96
			TableColumn column = new TableColumn(attachmentsTable, SWT.LEFT, i);
142
					// ignore
97
			column.setText(attachmentsColumns[i]);
143
				}
98
			column.setWidth(attachmentsColumnWidths[i]);
144
			});
99
		}
145
		}
100
		// size column
146
		// size column
101
		attachmentsTable.getColumn(2).setAlignment(SWT.RIGHT);
147
		attachmentsTable.getColumn(2).setAlignment(SWT.RIGHT);
102
148
103
		TableViewer attachmentsViewer = new TableViewer(attachmentsTable);
149
		TableViewer attachmentsViewer = new TableViewer(attachmentsTable);
104
		attachmentsViewer.setUseHashlookup(true);
150
		attachmentsViewer.setUseHashlookup(true);
105
		attachmentsViewer.setColumnProperties(attachmentsColumns);
106
		ColumnViewerToolTipSupport.enableFor(attachmentsViewer, ToolTip.NO_RECREATE);
151
		ColumnViewerToolTipSupport.enableFor(attachmentsViewer, ToolTip.NO_RECREATE);
107
152
108
		attachmentsViewer.setSorter(new ViewerSorter() {
153
		attachmentsViewer.setSorter(new ViewerSorter() {
Lines 133-139 Link Here
133
		}
178
		}
134
		attachmentsViewer.setContentProvider(new ArrayContentProvider());
179
		attachmentsViewer.setContentProvider(new ArrayContentProvider());
135
		attachmentsViewer.setLabelProvider(new AttachmentTableLabelProvider(getModel(),
180
		attachmentsViewer.setLabelProvider(new AttachmentTableLabelProvider(getModel(),
136
				getTaskEditorPage().getAttributeEditorToolkit()));
181
				getTaskEditorPage().getAttributeEditorToolkit(), offset));
137
		attachmentsViewer.addOpenListener(new IOpenListener() {
182
		attachmentsViewer.addOpenListener(new IOpenListener() {
138
			public void open(OpenEvent event) {
183
			public void open(OpenEvent event) {
139
				if (!event.getSelection().isEmpty()) {
184
				if (!event.getSelection().isEmpty()) {
Lines 236-242 Link Here
236
		super.dispose();
281
		super.dispose();
237
	}
282
	}
238
283
284
	private static void readState() {
285
		IPath stateLocation = Platform.getStateLocation(TasksUiPlugin.getDefault().getBundle());
286
		File attachmentStateFile = stateLocation.append("TaskEditorAttachment.obj").toFile(); //$NON-NLS-1$
287
		boolean columnStdWidth = TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(
288
				ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH);
289
290
		if (!attachmentStateFile.exists() || columnStdWidth) {
291
			columnInfos.add(new ColumnState(Messages.TaskEditorAttachmentPart_Id, 70));
292
			columnInfos.add(new ColumnState(Messages.TaskEditorAttachmentPart_Name, 130));
293
			columnInfos.add(new ColumnState(Messages.TaskEditorAttachmentPart_Description, 150));
294
			columnInfos.add(new ColumnState(Messages.TaskEditorAttachmentPart_Size, 70));
295
			columnInfos.add(new ColumnState(Messages.TaskEditorAttachmentPart_Creator, 100));
296
			columnInfos.add(new ColumnState(Messages.TaskEditorAttachmentPart_Created, 100));
297
		} else {
298
			ObjectInputStream in = null;
299
			try {
300
				in = new ObjectInputStream(new FileInputStream(attachmentStateFile));
301
				int size = in.readInt();
302
				for (int i = 0; i < size; i++) {
303
					columnInfos.add((ColumnState) in.readObject());
304
				}
305
			} catch (Throwable e) {
306
				StatusHandler.log(new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN,
307
						"The TaskEditorAttachment cache could not be read", e));
308
			} finally {
309
				if (in != null) {
310
					try {
311
						in.close();
312
					} catch (IOException e) {
313
						// ignore
314
					}
315
				}
316
			}
317
		}
318
	}
319
320
	private static void writeState() {
321
		IPath stateLocation = Platform.getStateLocation(TasksUiPlugin.getDefault().getBundle());
322
		File attachmentStateFile = stateLocation.append("TaskEditorAttachment.obj").toFile(); //$NON-NLS-1$
323
324
		if (attachmentStateFile == null) {
325
			return;
326
		}
327
		ObjectOutputStream out = null;
328
		try {
329
			out = new ObjectOutputStream(new FileOutputStream(attachmentStateFile));
330
			out.writeInt(columnInfos.size());
331
			for (ColumnState col : columnInfos) {
332
				out.writeObject(col);
333
			}
334
		} catch (IOException e) {
335
			StatusHandler.log(new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN,
336
					"The TaskEditorAttachment cache could not be written", e));
337
		} finally {
338
			if (out != null) {
339
				try {
340
					out.close();
341
				} catch (IOException e) {
342
					// ignore
343
				}
344
			}
345
		}
346
347
	}
348
239
	private void initialize() {
349
	private void initialize() {
350
		if (!propertyListenerIstalled) {
351
			TasksUiPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER);
352
			propertyListenerIstalled = true;
353
		}
354
		if (columnInfos.size() == 0) {
355
			readState();
356
		}
240
		attachments = getTaskData().getAttributeMapper().getAttributesByType(getTaskData(),
357
		attachments = getTaskData().getAttributeMapper().getAttributesByType(getTaskData(),
241
				TaskAttribute.TYPE_ATTACHMENT);
358
				TaskAttribute.TYPE_ATTACHMENT);
242
		for (TaskAttribute attachmentAttribute : attachments) {
359
		for (TaskAttribute attachmentAttribute : attachments) {
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties (+1 lines)
Lines 62-67 Link Here
62
TaskEditorAttachmentPart_Created=Created
62
TaskEditorAttachmentPart_Created=Created
63
TaskEditorAttachmentPart_Creator=Creator
63
TaskEditorAttachmentPart_Creator=Creator
64
TaskEditorAttachmentPart_Description=Description
64
TaskEditorAttachmentPart_Description=Description
65
TaskEditorAttachmentPart_Id=Id
65
TaskEditorAttachmentPart_Name=Name
66
TaskEditorAttachmentPart_Name=Name
66
TaskEditorAttachmentPart_No_attachments=No attachments
67
TaskEditorAttachmentPart_No_attachments=No attachments
67
TaskEditorAttachmentPart_Size=Size
68
TaskEditorAttachmentPart_Size=Size
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java (-7 / +18 lines)
Lines 46-59 Link Here
46
46
47
	private final AttributeEditorToolkit attributeEditorToolkit;
47
	private final AttributeEditorToolkit attributeEditorToolkit;
48
48
49
	public AttachmentTableLabelProvider(TaskDataModel model, AttributeEditorToolkit attributeEditorToolkit) {
49
	int offset;
50
51
	public AttachmentTableLabelProvider(TaskDataModel model, AttributeEditorToolkit attributeEditorToolkit, int offset) {
50
		this.model = model;
52
		this.model = model;
51
		this.attributeEditorToolkit = attributeEditorToolkit;
53
		this.attributeEditorToolkit = attributeEditorToolkit;
54
		this.offset = offset;
52
	}
55
	}
53
56
54
	public Image getColumnImage(Object element, int columnIndex) {
57
	public Image getColumnImage(Object element, int columnIndex) {
55
		ITaskAttachment attachment = (ITaskAttachment) element;
58
		ITaskAttachment attachment = (ITaskAttachment) element;
56
		if (columnIndex == 0) {
59
		if (columnIndex == 1 + offset) {
57
			if (AttachmentUtil.isContext(attachment)) {
60
			if (AttachmentUtil.isContext(attachment)) {
58
				return CommonImages.getImage(TasksUiImages.CONTEXT_TRANSFER);
61
				return CommonImages.getImage(TasksUiImages.CONTEXT_TRANSFER);
59
			} else if (attachment.isPatch()) {
62
			} else if (attachment.isPatch()) {
Lines 80-87 Link Here
80
83
81
	public String getColumnText(Object element, int columnIndex) {
84
	public String getColumnText(Object element, int columnIndex) {
82
		ITaskAttachment attachment = (ITaskAttachment) element;
85
		ITaskAttachment attachment = (ITaskAttachment) element;
83
		switch (columnIndex) {
86
		switch (columnIndex - offset) {
84
		case 0:
87
		case 0:
88
			String a = attachment.getUrl();
89
			int i = a.indexOf("?id="); //$NON-NLS-1$
90
			if (i != -1) {
91
				return a.substring(i + 4);
92
			} else {
93
				return ""; //$NON-NLS-1$
94
			}
95
		case 1:
85
			if (AttachmentUtil.isContext(attachment)) {
96
			if (AttachmentUtil.isContext(attachment)) {
86
				return Messages.AttachmentTableLabelProvider_Task_Context;
97
				return Messages.AttachmentTableLabelProvider_Task_Context;
87
			} else if (attachment.isPatch()) {
98
			} else if (attachment.isPatch()) {
Lines 89-105 Link Here
89
			} else {
100
			} else {
90
				return " " + attachment.getFileName(); //$NON-NLS-1$
101
				return " " + attachment.getFileName(); //$NON-NLS-1$
91
			}
102
			}
92
		case 1:
93
			return attachment.getDescription();
94
		case 2:
103
		case 2:
104
			return attachment.getDescription();
105
		case 3:
95
			Long length = attachment.getLength();
106
			Long length = attachment.getLength();
96
			if (length < 0) {
107
			if (length < 0) {
97
				return "-"; //$NON-NLS-1$
108
				return "-"; //$NON-NLS-1$
98
			}
109
			}
99
			return sizeFormatter.format(length);
110
			return sizeFormatter.format(length);
100
		case 3:
101
			return (attachment.getAuthor() != null) ? attachment.getAuthor().toString() : ""; //$NON-NLS-1$
102
		case 4:
111
		case 4:
112
			return (attachment.getAuthor() != null) ? attachment.getAuthor().toString() : ""; //$NON-NLS-1$
113
		case 5:
103
			return (attachment.getCreationDate() != null) ? EditorUtil.formatDateTime(attachment.getCreationDate())
114
			return (attachment.getCreationDate() != null) ? EditorUtil.formatDateTime(attachment.getCreationDate())
104
					: ""; //$NON-NLS-1$
115
					: ""; //$NON-NLS-1$
105
		}
116
		}
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java (+2 lines)
Lines 115-120 Link Here
115
115
116
	public static String TaskEditorAttachmentPart_Description;
116
	public static String TaskEditorAttachmentPart_Description;
117
117
118
	public static String TaskEditorAttachmentPart_Id;
119
118
	public static String TaskEditorAttachmentPart_Name;
120
	public static String TaskEditorAttachmentPart_Name;
119
121
120
	public static String TaskEditorAttachmentPart_No_attachments;
122
	public static String TaskEditorAttachmentPart_No_attachments;
(-)src/org/eclipse/mylyn/internal/tasks/ui/preferences/Messages.java (+7 lines)
Lines 88-91 Link Here
88
	public static String TasksUiPreferencePage_Web_Browser;
88
	public static String TasksUiPreferencePage_Web_Browser;
89
89
90
	public static String TasksUiPreferencePage_Week_Start;
90
	public static String TasksUiPreferencePage_Week_Start;
91
92
	public static String TasksUiPreferencePage_Attachment_Table;
93
94
	public static String TasksUiPreferencePage_Attachment_Show_Id;
95
96
	public static String TasksUiPreferencePage_Attachment_Coloumn_Std_Width;
97
91
}
98
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/preferences/TasksUiPreferencePage.java (-1 / +36 lines)
Lines 75-80 Link Here
75
75
76
	private Button useRichEditor;
76
	private Button useRichEditor;
77
77
78
	private Button attachmentShowID;
79
80
	private Button attachmentColumnUseStdWidth;
81
78
	private Button useWebBrowser;
82
	private Button useWebBrowser;
79
83
80
	private Text synchScheduleTime = null;
84
	private Text synchScheduleTime = null;
Lines 122-127 Link Here
122
		createSchedulingGroup(container);
126
		createSchedulingGroup(container);
123
		createOpenWith(container);
127
		createOpenWith(container);
124
		createTaskActivityGroup(container);
128
		createTaskActivityGroup(container);
129
125
		Composite advanced = createAdvancedSection(container);
130
		Composite advanced = createAdvancedSection(container);
126
		createTaskDataControl(advanced);
131
		createTaskDataControl(advanced);
127
132
Lines 132-137 Link Here
132
		}
137
		}
133
138
134
		createLinks(advanced);
139
		createLinks(advanced);
140
		createAttachmentTable(advanced);
135
		updateRefreshGroupEnablements();
141
		updateRefreshGroupEnablements();
136
		applyDialogFont(container);
142
		applyDialogFont(container);
137
		return container;
143
		return container;
Lines 237-242 Link Here
237
				// shouldn't get here
243
				// shouldn't get here
238
			}
244
			}
239
		}
245
		}
246
		getPreferenceStore().setValue(ITasksUiPreferenceConstants.ATTACHMENT_SHOW_ID, attachmentShowID.getSelection());
247
		getPreferenceStore().setValue(ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH,
248
				attachmentColumnUseStdWidth.getSelection());
240
249
241
		return true;
250
		return true;
242
	}
251
	}
Lines 274-279 Link Here
274
		activityTrackingEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
283
		activityTrackingEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
275
				MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED));
284
				MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED));
276
285
286
		attachmentShowID.setSelection(getPreferenceStore().getBoolean(ITasksUiPreferenceConstants.ATTACHMENT_SHOW_ID));
287
		attachmentColumnUseStdWidth.setSelection(getPreferenceStore().getBoolean(
288
				ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH));
277
		return true;
289
		return true;
278
	}
290
	}
279
291
Lines 322-327 Link Here
322
		activityTrackingEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getDefaultBoolean(
334
		activityTrackingEnabledButton.setSelection(MonitorUiPlugin.getDefault().getPreferenceStore().getDefaultBoolean(
323
				MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED));
335
				MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED));
324
336
337
		attachmentShowID.setSelection(getPreferenceStore().getDefaultBoolean(
338
				ITasksUiPreferenceConstants.ATTACHMENT_SHOW_ID));
339
		attachmentColumnUseStdWidth.setSelection(getPreferenceStore().getDefaultBoolean(
340
				ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH));
341
325
		updateRefreshGroupEnablements();
342
		updateRefreshGroupEnablements();
326
	}
343
	}
327
344
Lines 369-378 Link Here
369
386
370
	}
387
	}
371
388
389
	private void createAttachmentTable(Composite parent) {
390
		Group attachmentContainer = new Group(parent, SWT.SHADOW_ETCHED_IN);
391
		attachmentContainer.setLayout(new GridLayout(2, false));
392
		attachmentContainer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
393
		attachmentContainer.setText(Messages.TasksUiPreferencePage_Attachment_Table);
394
395
		attachmentColumnUseStdWidth = new Button(attachmentContainer, SWT.CHECK);
396
		attachmentColumnUseStdWidth.setText(Messages.TasksUiPreferencePage_Attachment_Coloumn_Std_Width);
397
		attachmentColumnUseStdWidth.setSelection(getPreferenceStore().getBoolean(
398
				ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH));
399
400
		attachmentShowID = new Button(attachmentContainer, SWT.CHECK);
401
		attachmentShowID.setText(Messages.TasksUiPreferencePage_Attachment_Show_Id);
402
		attachmentShowID.setSelection(getPreferenceStore().getBoolean(ITasksUiPreferenceConstants.ATTACHMENT_SHOW_ID));
403
404
	}
405
372
	private void createOpenWith(Composite parent) {
406
	private void createOpenWith(Composite parent) {
373
		Group container = new Group(parent, SWT.SHADOW_ETCHED_IN);
407
		Group container = new Group(parent, SWT.SHADOW_ETCHED_IN);
374
		container.setLayout(new GridLayout(3, false));
408
		container.setLayout(new GridLayout(2, false));
375
		container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
409
		container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
410
//		container.setLayoutData(new GridData(SWT.LEFT, 1, true, true));
376
411
377
		container.setText(Messages.TasksUiPreferencePage_Task_Editing);
412
		container.setText(Messages.TasksUiPreferencePage_Task_Editing);
378
		useRichEditor = new Button(container, SWT.RADIO);
413
		useRichEditor = new Button(container, SWT.RADIO);
(-)src/org/eclipse/mylyn/internal/tasks/ui/preferences/messages.properties (+3 lines)
Lines 40-42 Link Here
40
TasksUiPreferencePage_Use_the_Restore_dialog_to_recover_missing_tasks=Use the Restore dialog to recover missing tasks
40
TasksUiPreferencePage_Use_the_Restore_dialog_to_recover_missing_tasks=Use the Restore dialog to recover missing tasks
41
TasksUiPreferencePage_Web_Browser=Web Browser
41
TasksUiPreferencePage_Web_Browser=Web Browser
42
TasksUiPreferencePage_Week_Start=Week Start:
42
TasksUiPreferencePage_Week_Start=Week Start:
43
TasksUiPreferencePage_Attachment_Table=Task Editor Attachment Table
44
TasksUiPreferencePage_Attachment_Show_Id=Show Attachment ID
45
TasksUiPreferencePage_Attachment_Coloumn_Std_Width=use standard Width for Columns
(-)src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java (+4 lines)
Lines 58-63 Link Here
58
58
59
	public static final String EDITOR_TASKS_RICH = "org.eclipse.mylyn.tasks.ui.reporting.open.editor"; //$NON-NLS-1$
59
	public static final String EDITOR_TASKS_RICH = "org.eclipse.mylyn.tasks.ui.reporting.open.editor"; //$NON-NLS-1$
60
60
61
	public static final String ATTACHMENT_SHOW_ID = "org.eclipse.mylyn.tasks.ui.attachment.showid"; //$NON-NLS-1$
62
63
	public static final String ATTACHMENT_COLUMN_STD_WIDTH = "org.eclipse.mylyn.tasks.ui.attachment.column.std.width"; //$NON-NLS-1$
64
61
	public static final String USE_STRIKETHROUGH_FOR_COMPLETED = "org.eclipse.mylyn.tasks.ui.strikethrough.for.completed"; //$NON-NLS-1$
65
	public static final String USE_STRIKETHROUGH_FOR_COMPLETED = "org.eclipse.mylyn.tasks.ui.strikethrough.for.completed"; //$NON-NLS-1$
62
66
63
	public static final String REPOSITORY_SYNCH_SCHEDULE_ENABLED = "org.eclipse.mylyn.tasks.ui.repositories.synch.schedule"; //$NON-NLS-1$
67
	public static final String REPOSITORY_SYNCH_SCHEDULE_ENABLED = "org.eclipse.mylyn.tasks.ui.repositories.synch.schedule"; //$NON-NLS-1$
(-)src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java (+3 lines)
Lines 889-894 Link Here
889
		store.setDefault(ITasksUiPreferenceConstants.PLANNING_ENDHOUR, 18);
889
		store.setDefault(ITasksUiPreferenceConstants.PLANNING_ENDHOUR, 18);
890
890
891
		store.setDefault(ITasksUiPreferenceConstants.AUTO_EXPAND_TASK_LIST, true);
891
		store.setDefault(ITasksUiPreferenceConstants.AUTO_EXPAND_TASK_LIST, true);
892
893
		store.setDefault(ITasksUiPreferenceConstants.ATTACHMENT_SHOW_ID, false);
894
		store.setDefault(ITasksUiPreferenceConstants.ATTACHMENT_COLUMN_STD_WIDTH, true);
892
	}
895
	}
893
896
894
	public static TaskActivityManager getTaskActivityManager() {
897
	public static TaskActivityManager getTaskActivityManager() {
(-)src/org/eclipse/mylyn/internal/tasks/ui/editors/ColumnState.java (+59 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 Frank Becker 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
 *     Frank Becker - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylyn.internal.tasks.ui.editors;
13
14
import java.io.Serializable;
15
16
import org.eclipse.swt.SWT;
17
18
public class ColumnState implements Serializable {
19
20
	private static final long serialVersionUID = -3746488897344479189L;
21
22
	private String name;
23
24
	private int widths;
25
26
	private int alignment;
27
28
	public ColumnState(String name, int widths) {
29
		super();
30
		this.name = name;
31
		this.widths = widths;
32
		alignment = SWT.LEFT;
33
	}
34
35
	public String getName() {
36
		return name;
37
	}
38
39
	public void setName(String name) {
40
		this.name = name;
41
	}
42
43
	public int getWidths() {
44
		return widths;
45
	}
46
47
	public void setWidths(int widths) {
48
		this.widths = widths;
49
	}
50
51
	public int getAlignment() {
52
		return alignment;
53
	}
54
55
	public void setAlignment(int alignment) {
56
		this.alignment = alignment;
57
	}
58
59
}

Return to bug 250257