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

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/tasks/ui/util/AttachmentUtil.java (-3 / +42 lines)
Lines 19-24 Link Here
19
import java.io.OutputStream;
19
import java.io.OutputStream;
20
import java.lang.reflect.InvocationTargetException;
20
import java.lang.reflect.InvocationTargetException;
21
import java.util.ArrayList;
21
import java.util.ArrayList;
22
import java.util.Collections;
22
import java.util.List;
23
import java.util.List;
23
24
24
import org.eclipse.core.runtime.Assert;
25
import org.eclipse.core.runtime.Assert;
Lines 29-34 Link Here
29
import org.eclipse.core.runtime.Status;
30
import org.eclipse.core.runtime.Status;
30
import org.eclipse.jface.operation.IRunnableContext;
31
import org.eclipse.jface.operation.IRunnableContext;
31
import org.eclipse.jface.operation.IRunnableWithProgress;
32
import org.eclipse.jface.operation.IRunnableWithProgress;
33
import org.eclipse.jface.viewers.ISelection;
34
import org.eclipse.jface.viewers.IStructuredSelection;
32
import org.eclipse.mylyn.commons.core.StatusHandler;
35
import org.eclipse.mylyn.commons.core.StatusHandler;
33
import org.eclipse.mylyn.commons.net.Policy;
36
import org.eclipse.mylyn.commons.net.Policy;
34
import org.eclipse.mylyn.context.core.ContextCore;
37
import org.eclipse.mylyn.context.core.ContextCore;
Lines 48-53 Link Here
48
import org.eclipse.mylyn.tasks.core.data.TaskData;
51
import org.eclipse.mylyn.tasks.core.data.TaskData;
49
import org.eclipse.mylyn.tasks.core.sync.SubmitJob;
52
import org.eclipse.mylyn.tasks.core.sync.SubmitJob;
50
import org.eclipse.mylyn.tasks.ui.TasksUi;
53
import org.eclipse.mylyn.tasks.ui.TasksUi;
54
import org.eclipse.ui.IWorkbenchWindow;
55
import org.eclipse.ui.PlatformUI;
51
56
52
/**
57
/**
53
 * @author Steffen Pingel
58
 * @author Steffen Pingel
Lines 140-146 Link Here
140
			});
145
			});
141
		} catch (InvocationTargetException e) {
146
		} catch (InvocationTargetException e) {
142
			if (e.getCause() instanceof CoreException) {
147
			if (e.getCause() instanceof CoreException) {
143
				TasksUiInternal.displayStatus(Messages.AttachmentUtil_Mylyn_Information, ((CoreException) e.getCause()).getStatus());
148
				TasksUiInternal.displayStatus(Messages.AttachmentUtil_Mylyn_Information,
149
						((CoreException) e.getCause()).getStatus());
144
			} else {
150
			} else {
145
				StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
151
				StatusHandler.fail(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
146
						"Unexpected error while retrieving context", e)); //$NON-NLS-1$
152
						"Unexpected error while retrieving context", e)); //$NON-NLS-1$
Lines 160-167 Link Here
160
		ContextCorePlugin.getContextStore().saveActiveContext();
166
		ContextCorePlugin.getContextStore().saveActiveContext();
161
		File sourceContextFile = ContextCorePlugin.getContextStore().getFileForContext(task.getHandleIdentifier());
167
		File sourceContextFile = ContextCorePlugin.getContextStore().getFileForContext(task.getHandleIdentifier());
162
		if (!sourceContextFile.exists()) {
168
		if (!sourceContextFile.exists()) {
163
			TasksUiInternal.displayStatus(Messages.AttachmentUtil_Mylyn_Information, new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN,
169
			TasksUiInternal.displayStatus(Messages.AttachmentUtil_Mylyn_Information, new Status(IStatus.WARNING,
164
					Messages.AttachmentUtil_The_context_is_empty));
170
					TasksUiPlugin.ID_PLUGIN, Messages.AttachmentUtil_The_context_is_empty));
165
			return false;
171
			return false;
166
		}
172
		}
167
173
Lines 272-275 Link Here
272
		}
278
		}
273
	}
279
	}
274
280
281
	public static ITaskAttachment getSelectedAttachment() {
282
		List<ITaskAttachment> attachments = getSelectedAttachments();
283
		if (attachments.isEmpty()) {
284
			return null;
285
		}
286
287
		return attachments.get(0);
288
	}
289
290
	public static List<ITaskAttachment> getSelectedAttachments() {
291
		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
292
		ISelection windowSelection = window.getSelectionService().getSelection();
293
294
		IStructuredSelection selection = null;
295
		if (windowSelection instanceof IStructuredSelection) {
296
			selection = (IStructuredSelection) windowSelection;
297
		}
298
299
		if (selection == null || selection.isEmpty()) {
300
			return Collections.emptyList();
301
		}
302
303
		List<ITaskAttachment> attachments = new ArrayList<ITaskAttachment>();
304
305
		List<?> items = selection.toList();
306
		for (Object o : items) {
307
			if (o instanceof ITaskAttachment) {
308
				attachments.add((ITaskAttachment) o);
309
			}
310
		}
311
312
		return attachments;
313
	}
275
}
314
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/util/Messages.java (+12 lines)
Lines 41-46 Link Here
41
41
42
	public static String ImportExportUtil_Tasks_and_queries_Filter0;
42
	public static String ImportExportUtil_Tasks_and_queries_Filter0;
43
43
44
	public static String SaveAttachmentsAction_directoryDoesntExist;
45
46
	public static String SaveAttachmentsAction_directoryDoesntExist0;
47
48
	public static String SaveAttachmentsAction_fileExists_doYouWantToOverwrite0;
49
50
	public static String SaveAttachmentsAction_overwriteFile0;
51
52
	public static String SaveAttachmentsAction_selectDirectory;
53
54
	public static String SaveAttachmentsAction_selectDirectoryHint;
55
44
	public static String TaskDataExportOperation_exporting_task_data;
56
	public static String TaskDataExportOperation_exporting_task_data;
45
57
46
	public static String TasksUiInternal_Configuration_Refresh_Failed;
58
	public static String TasksUiInternal_Configuration_Refresh_Failed;
(-)src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiMenus.java (-83 / +3 lines)
Lines 11-32 Link Here
11
11
12
package org.eclipse.mylyn.internal.tasks.ui.util;
12
package org.eclipse.mylyn.internal.tasks.ui.util;
13
13
14
import java.io.File;
15
16
import org.eclipse.jface.action.Action;
14
import org.eclipse.jface.action.Action;
17
import org.eclipse.jface.action.IMenuManager;
15
import org.eclipse.jface.action.IMenuManager;
18
import org.eclipse.jface.action.Separator;
16
import org.eclipse.jface.action.Separator;
19
import org.eclipse.jface.dialogs.MessageDialog;
20
import org.eclipse.jface.viewers.ISelection;
21
import org.eclipse.jface.viewers.IStructuredSelection;
22
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
17
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
23
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.dnd.Clipboard;
18
import org.eclipse.swt.dnd.Clipboard;
25
import org.eclipse.swt.dnd.TextTransfer;
19
import org.eclipse.swt.dnd.TextTransfer;
26
import org.eclipse.swt.dnd.Transfer;
20
import org.eclipse.swt.dnd.Transfer;
27
import org.eclipse.swt.widgets.FileDialog;
28
import org.eclipse.ui.IWorkbenchActionConstants;
21
import org.eclipse.ui.IWorkbenchActionConstants;
29
import org.eclipse.ui.IWorkbenchWindow;
30
import org.eclipse.ui.PlatformUI;
22
import org.eclipse.ui.PlatformUI;
31
23
32
/**
24
/**
Lines 34-101 Link Here
34
 */
26
 */
35
public class TasksUiMenus {
27
public class TasksUiMenus {
36
28
37
	private static final String ATTACHMENT_DEFAULT_NAME = "attachment"; //$NON-NLS-1$
38
39
	private static final String CTYPE_ZIP = "zip"; //$NON-NLS-1$
40
41
	private static final String CTYPE_OCTET_STREAM = "octet-stream"; //$NON-NLS-1$
42
43
	private static final String CTYPE_TEXT = "text"; //$NON-NLS-1$
44
45
	private static final String CTYPE_HTML = "html"; //$NON-NLS-1$
46
47
	public static void fillTaskAttachmentMenu(IMenuManager manager) {
29
	public static void fillTaskAttachmentMenu(IMenuManager manager) {
48
		final Action saveAction = new Action(Messages.TasksUiMenus_Save_) {
30
		final Action saveAction = new SaveAttachmentsAction(Messages.TasksUiMenus_Save_);
49
			@Override
50
			public void run() {
51
				ITaskAttachment attachment = getSelectedAttachment();
52
				if (attachment == null) {
53
					return;
54
				}
55
56
				/* Launch Browser */
57
				FileDialog fileChooser = new FileDialog(TasksUiInternal.getShell(), SWT.SAVE);
58
				String fname = attachment.getFileName();
59
				// default name if none is found
60
				if (fname.equals("")) { //$NON-NLS-1$
61
					String ctype = attachment.getContentType();
62
					if (ctype.endsWith(CTYPE_HTML)) {
63
						fname = ATTACHMENT_DEFAULT_NAME + ".html"; //$NON-NLS-1$
64
					} else if (ctype.startsWith(CTYPE_TEXT)) {
65
						fname = ATTACHMENT_DEFAULT_NAME + ".txt"; //$NON-NLS-1$
66
					} else if (ctype.endsWith(CTYPE_OCTET_STREAM)) {
67
						fname = ATTACHMENT_DEFAULT_NAME;
68
					} else if (ctype.endsWith(CTYPE_ZIP)) {
69
						fname = ATTACHMENT_DEFAULT_NAME + "." + CTYPE_ZIP; //$NON-NLS-1$
70
					} else {
71
						fname = ATTACHMENT_DEFAULT_NAME + "." + ctype.substring(ctype.indexOf("/") + 1); //$NON-NLS-1$ //$NON-NLS-2$
72
					}
73
				}
74
				fileChooser.setFileName(fname);
75
				String filePath = fileChooser.open();
76
				// check if the dialog was canceled or an error occurred
77
				if (filePath == null) {
78
					return;
79
				}
80
81
				File file = new File(filePath);
82
				if (file.exists()) {
83
					if (!MessageDialog.openConfirm(TasksUiInternal.getShell(), Messages.TasksUiMenus_File_exists_,
84
							Messages.TasksUiMenus_Overwrite_existing_file_ + file.getName())) {
85
						return;
86
					}
87
				}
88
89
				DownloadAttachmentJob job = new DownloadAttachmentJob(attachment, file);
90
				job.setUser(true);
91
				job.schedule();
92
			}
93
		};
94
31
95
		final Action copyURLToClipAction = new Action(Messages.TasksUiMenus_Copy_URL) {
32
		final Action copyURLToClipAction = new Action(Messages.TasksUiMenus_Copy_URL) {
96
			@Override
33
			@Override
97
			public void run() {
34
			public void run() {
98
				ITaskAttachment attachment = getSelectedAttachment();
35
				ITaskAttachment attachment = AttachmentUtil.getSelectedAttachment();
99
				if (attachment != null) {
36
				if (attachment != null) {
100
					Clipboard clip = new Clipboard(PlatformUI.getWorkbench().getDisplay());
37
					Clipboard clip = new Clipboard(PlatformUI.getWorkbench().getDisplay());
101
					clip.setContents(new Object[] { attachment.getUrl() },
38
					clip.setContents(new Object[] { attachment.getUrl() },
Lines 108-114 Link Here
108
		final Action copyToClipAction = new Action(Messages.TasksUiMenus_Copy_Contents) {
45
		final Action copyToClipAction = new Action(Messages.TasksUiMenus_Copy_Contents) {
109
			@Override
46
			@Override
110
			public void run() {
47
			public void run() {
111
				ITaskAttachment attachment = getSelectedAttachment();
48
				ITaskAttachment attachment = AttachmentUtil.getSelectedAttachment();
112
				if (attachment != null) {
49
				if (attachment != null) {
113
					CopyAttachmentToClipboardJob job = new CopyAttachmentToClipboardJob(attachment);
50
					CopyAttachmentToClipboardJob job = new CopyAttachmentToClipboardJob(attachment);
114
					job.setUser(true);
51
					job.setUser(true);
Lines 124-144 Link Here
124
		manager.add(copyToClipAction);
61
		manager.add(copyToClipAction);
125
		manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
62
		manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
126
	}
63
	}
127
128
	private static ITaskAttachment getSelectedAttachment() {
129
		IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
130
		ISelection windowSelection = window.getSelectionService().getSelection();
131
		IStructuredSelection selection = null;
132
		if (windowSelection instanceof IStructuredSelection) {
133
			selection = (IStructuredSelection) windowSelection;
134
		}
135
		if (selection == null || selection.isEmpty()) {
136
			return null;
137
		}
138
		if (selection.getFirstElement() instanceof ITaskAttachment) {
139
			return (ITaskAttachment) selection.getFirstElement();
140
		}
141
		return null;
142
	}
143
144
}
64
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/util/messages.properties (+7 lines)
Lines 9-14 Link Here
9
DownloadAttachmentJob_Downloading_Attachment=Downloading Attachment
9
DownloadAttachmentJob_Downloading_Attachment=Downloading Attachment
10
ImportExportUtil_Tasks_and_queries_Filter0=Mylyn Tasks and Queries (*{0})
10
ImportExportUtil_Tasks_and_queries_Filter0=Mylyn Tasks and Queries (*{0})
11
11
12
SaveAttachmentsAction_directoryDoesntExist=Directory doesn't exist
13
SaveAttachmentsAction_directoryDoesntExist0=Directory {0} doesn't exist.
14
SaveAttachmentsAction_fileExists_doYouWantToOverwrite0=File {0} already exists. Do you want to overwrite it?
15
SaveAttachmentsAction_overwriteFile0=Overwrite file {0}
16
SaveAttachmentsAction_selectDirectory=Select directory
17
SaveAttachmentsAction_selectDirectoryHint=Attachments will be saved to selected directory
18
12
TaskDataExportOperation_exporting_task_data=Exporting Task Data
19
TaskDataExportOperation_exporting_task_data=Exporting Task Data
13
20
14
TasksUiInternal_Configuration_Refresh_Failed=Configuration Refresh Failed
21
TasksUiInternal_Configuration_Refresh_Failed=Configuration Refresh Failed
(-).refactorings/2009/4/14/refactorings.index (+6 lines)
Added Link Here
1
1238791256608	Extract method 'getAttachmentFilename'
2
1238791450143	Inline local variable 'fname'
3
1238791547356	Extract method 'saveSingleAttachment'
4
1238791553451	Inline local variable 'attachment'
5
1238792111538	Convert anonymous class to nested
6
1238792256048	Convert member type 'SaveAction' to top level
(-)src/org/eclipse/mylyn/internal/tasks/ui/util/SaveAttachmentsAction.java (+207 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.tasks.ui.util;
13
14
import java.io.File;
15
import java.util.List;
16
17
import org.eclipse.core.runtime.preferences.ConfigurationScope;
18
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
19
import org.eclipse.jface.action.Action;
20
import org.eclipse.jface.dialogs.MessageDialog;
21
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
22
import org.eclipse.mylyn.tasks.core.ITaskAttachment;
23
import org.eclipse.osgi.util.NLS;
24
import org.eclipse.swt.SWT;
25
import org.eclipse.swt.widgets.DirectoryDialog;
26
import org.eclipse.swt.widgets.FileDialog;
27
import org.eclipse.swt.widgets.Shell;
28
import org.osgi.service.prefs.BackingStoreException;
29
30
final class SaveAttachmentsAction extends Action {
31
	private static final String DEFAULT_DIRECTORY = "saveAttachments.defaultDirectory"; //$NON-NLS-1$
32
33
	private static final String ATTACHMENT_DEFAULT_NAME = "attachment"; //$NON-NLS-1$
34
35
	private static final String CTYPE_ZIP = "zip"; //$NON-NLS-1$
36
37
	private static final String CTYPE_OCTET_STREAM = "octet-stream"; //$NON-NLS-1$
38
39
	private static final String CTYPE_TEXT = "text"; //$NON-NLS-1$
40
41
	private static final String CTYPE_HTML = "html"; //$NON-NLS-1$
42
43
	SaveAttachmentsAction(String text) {
44
		super(text);
45
	}
46
47
	@Override
48
	public void run() {
49
		List<ITaskAttachment> attachments = AttachmentUtil.getSelectedAttachments();
50
		if (attachments.isEmpty()) {
51
			return;
52
		}
53
54
		if (attachments.size() == 1) {
55
			saveSingleAttachment(attachments.get(0));
56
		} else {
57
			saveAllAttachments(attachments);
58
		}
59
	}
60
61
	/*
62
	 * Single attachment saving -- displays Save File dialog, then downloads and saves single attachment
63
	 */
64
	private void saveSingleAttachment(ITaskAttachment attachment) {
65
		/* Launch Browser */
66
		FileDialog fileChooser = new FileDialog(TasksUiInternal.getShell(), SWT.SAVE);
67
		fileChooser.setFileName(getAttachmentFilename(attachment));
68
69
		File initDirectory = getInitialDirectory();
70
		if (initDirectory != null) {
71
			fileChooser.setFilterPath(initDirectory.getAbsolutePath());
72
		}
73
74
		String filePath = fileChooser.open();
75
76
		// check if the dialog was canceled or an error occurred
77
		if (filePath == null) {
78
			return;
79
		}
80
81
		File file = new File(filePath);
82
		if (file.exists()) {
83
			if (!MessageDialog.openConfirm(TasksUiInternal.getShell(), Messages.TasksUiMenus_File_exists_,
84
					Messages.TasksUiMenus_Overwrite_existing_file_ + file.getName())) {
85
				return;
86
			}
87
		}
88
89
		initDirectory = file.getParentFile();
90
		if (initDirectory != null) {
91
			saveInitialDirectory(initDirectory.getAbsolutePath());
92
		}
93
94
		DownloadAttachmentJob job = new DownloadAttachmentJob(attachment, file);
95
		job.setUser(true);
96
		job.schedule();
97
	}
98
99
	private void saveAllAttachments(List<ITaskAttachment> attachments) {
100
		DirectoryDialog dialog = new DirectoryDialog(TasksUiInternal.getShell());
101
		dialog.setText(Messages.SaveAttachmentsAction_selectDirectory);
102
		dialog.setMessage(Messages.SaveAttachmentsAction_selectDirectoryHint);
103
104
		File initDirectory = getInitialDirectory();
105
		if (initDirectory != null) {
106
			dialog.setFilterPath(initDirectory.getAbsolutePath());
107
		}
108
109
		String directoryPath = dialog.open();
110
		if (directoryPath == null) {
111
			return;
112
		}
113
114
		saveInitialDirectory(directoryPath);
115
116
		final File directory = new File(directoryPath);
117
		if (!directory.exists()) {
118
			MessageDialog.openError(TasksUiInternal.getShell(), Messages.SaveAttachmentsAction_directoryDoesntExist,
119
					NLS.bind(Messages.SaveAttachmentsAction_directoryDoesntExist0, directoryPath));
120
			return;
121
		}
122
123
		for (ITaskAttachment a : attachments) {
124
			String filename = getAttachmentFilename(a);
125
126
			File file = getTargetFile(TasksUiInternal.getShell(), directory, filename);
127
128
			DownloadAttachmentJob job = new DownloadAttachmentJob(a, file);
129
			job.setUser(true);
130
			job.schedule();
131
		}
132
	}
133
134
	private File getTargetFile(Shell shell, File directory, String filename) {
135
		File attachFile = new File(directory, filename);
136
137
		while (true) {
138
			if (!attachFile.exists()) {
139
				return attachFile;
140
			}
141
142
			boolean overwrite = MessageDialog.openQuestion(shell, NLS.bind(
143
					Messages.SaveAttachmentsAction_overwriteFile0, attachFile.getName()), NLS.bind(
144
					Messages.SaveAttachmentsAction_fileExists_doYouWantToOverwrite0, attachFile.getAbsolutePath()));
145
146
			if (overwrite) {
147
				return attachFile;
148
			}
149
150
			FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
151
			fileDialog.setFilterPath(directory.getAbsolutePath());
152
			filename = fileDialog.open();
153
154
			if (filename == null) {
155
				return null;
156
			}
157
158
			attachFile = new File(filename);
159
		}
160
	}
161
162
	private String getAttachmentFilename(ITaskAttachment attachment) {
163
		String fname = attachment.getFileName();
164
		// default name if none is found
165
		if (fname.equals("")) { //$NON-NLS-1$
166
			String ctype = attachment.getContentType();
167
			if (ctype.endsWith(CTYPE_HTML)) {
168
				fname = ATTACHMENT_DEFAULT_NAME + ".html"; //$NON-NLS-1$
169
			} else if (ctype.startsWith(CTYPE_TEXT)) {
170
				fname = ATTACHMENT_DEFAULT_NAME + ".txt"; //$NON-NLS-1$
171
			} else if (ctype.endsWith(CTYPE_OCTET_STREAM)) {
172
				fname = ATTACHMENT_DEFAULT_NAME;
173
			} else if (ctype.endsWith(CTYPE_ZIP)) {
174
				fname = ATTACHMENT_DEFAULT_NAME + "." + CTYPE_ZIP; //$NON-NLS-1$
175
			} else {
176
				fname = ATTACHMENT_DEFAULT_NAME + "." + ctype.substring(ctype.indexOf("/") + 1); //$NON-NLS-1$ //$NON-NLS-2$
177
			}
178
		}
179
		return fname;
180
	}
181
182
	private File getInitialDirectory() {
183
		IEclipsePreferences prefs = new ConfigurationScope().getNode(TasksUiPlugin.ID_PLUGIN);
184
		String dir = prefs.get(DEFAULT_DIRECTORY, null);
185
186
		if (dir == null) {
187
			return null;
188
		}
189
190
		File file = new File(dir).getAbsoluteFile();
191
		while (file != null && !file.exists()) {
192
			file = file.getParentFile();
193
		}
194
195
		return file;
196
	}
197
198
	private void saveInitialDirectory(String directory) {
199
		IEclipsePreferences prefs = new ConfigurationScope().getNode(TasksUiPlugin.ID_PLUGIN);
200
		prefs.put(DEFAULT_DIRECTORY, directory);
201
		try {
202
			prefs.flush();
203
		} catch (BackingStoreException e) {
204
			// ignore
205
		}
206
	}
207
}
(-).refactorings/2009/4/14/refactorings.history (+3 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<session version="1.0">&#x0A;<refactoring comment="Extract method &apos;private String getAttachmentFilename(ITaskAttachment attachment)&apos; from &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}.run()&apos; to &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}&apos;&#x0D;&#x0A;- Original project: &apos;org.eclipse.mylyn.tasks.ui&apos;&#x0D;&#x0A;- Method name: &apos;getAttachmentFilename&apos;&#x0D;&#x0A;- Destination type: &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}&apos;&#x0D;&#x0A;- Declared visibility: &apos;private&apos;" comments="false" description="Extract method &apos;getAttachmentFilename&apos;" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src&lt;org.eclipse.mylyn.internal.tasks.ui.util{TasksUiMenus.java" name="getAttachmentFilename" replace="false" selection="2217 752" stamp="1238791256608" version="1.0" visibility="2"/>&#x0A;<refactoring comment="Inline local variable &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}.run().fname&apos; in &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}.run()&apos;&#x0D;&#x0A;- Original project: &apos;org.eclipse.mylyn.tasks.ui&apos;&#x0D;&#x0A;- Original element: &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}.run().fname&apos;" description="Inline local variable &apos;fname&apos;" id="org.eclipse.jdt.ui.inline.temp" input="/src&lt;org.eclipse.mylyn.internal.tasks.ui.util{TasksUiMenus.java" selection="2367 0" stamp="1238791450143" version="1.0"/>&#x0A;<refactoring comment="Extract method &apos;private void saveSingleAttachment(ITaskAttachment attachment)&apos; from &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}.run()&apos; to &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}&apos;&#x0D;&#x0A;- Original project: &apos;org.eclipse.mylyn.tasks.ui&apos;&#x0D;&#x0A;- Method name: &apos;saveSingleAttachment&apos;&#x0D;&#x0A;- Destination type: &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}&apos;&#x0D;&#x0A;- Declared visibility: &apos;private&apos;" comments="false" description="Extract method &apos;saveSingleAttachment&apos;" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src&lt;org.eclipse.mylyn.internal.tasks.ui.util{TasksUiMenus.java" name="saveSingleAttachment" replace="false" selection="2200 703" stamp="1238791547356" version="1.0" visibility="2"/>&#x0A;<refactoring comment="Inline local variable &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}.run().attachment&apos; in &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}.run()&apos;&#x0D;&#x0A;- Original project: &apos;org.eclipse.mylyn.tasks.ui&apos;&#x0D;&#x0A;- Original element: &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}.run().attachment&apos;" description="Inline local variable &apos;attachment&apos;" id="org.eclipse.jdt.ui.inline.temp" input="/src&lt;org.eclipse.mylyn.internal.tasks.ui.util{TasksUiMenus.java" selection="2225 0" stamp="1238791553451" version="1.0"/>&#x0A;<refactoring comment="Convert anonymous class &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}&apos; in &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu()&apos; to nested class&#x0D;&#x0A;- Original project: &apos;org.eclipse.mylyn.tasks.ui&apos;&#x0D;&#x0A;- Original element: &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.fillTaskAttachmentMenu().new Action() {...}&apos;&#x0D;&#x0A;- Class name: &apos;SaveAction&apos;&#x0D;&#x0A;- Declared visibility: &apos;private&apos;&#x0D;&#x0A;- Declare class &apos;final&apos; and &apos;static&apos;" description="Convert anonymous class to nested" final="true" flags="786434" id="org.eclipse.jdt.ui.convert.anonymous" input="/src&lt;org.eclipse.mylyn.internal.tasks.ui.util{TasksUiMenus.java" name="SaveAction" selection="2001 3867" stamp="1238792111538" static="true" version="1.0" visibility="2"/>&#x0A;<refactoring comment="Convert member type &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.SaveAction&apos; in &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus&apos; to top level type&#x0D;&#x0A;- Original project: &apos;org.eclipse.mylyn.tasks.ui&apos;&#x0D;&#x0A;- Original element: &apos;org.eclipse.mylyn.internal.tasks.ui.util.TasksUiMenus.SaveAction&apos;&#x0D;&#x0A;- Field name: &apos;tasksUiMenus&apos;&#x0D;&#x0A;- Declare field &apos;final&apos;" description="Convert member type &apos;SaveAction&apos; to top level" field="false" fieldName="tasksUiMenus" final="true" flags="786438" id="org.eclipse.jdt.ui.move.inner" input="/src&lt;org.eclipse.mylyn.internal.tasks.ui.util{TasksUiMenus.java[TasksUiMenus[SaveAction" mandatory="false" possible="false" stamp="1238792256048" version="1.0"/>
3
</session>

Return to bug 271197