/*******************************************************************************
 * Copyright (c) 2005, 2006 Subclipse project and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Subclipse project committers - initial API and implementation
 ******************************************************************************/
package org.tigris.subversion.subclipse.ui.actions;

import java.lang.reflect.InvocationTargetException;

import org.eclipse.jface.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.tigris.subversion.subclipse.ui.ISVNUIConstants;
import org.tigris.subversion.subclipse.ui.Policy;
import org.tigris.subversion.subclipse.ui.operations.ExportOperation;

public class ExportAction extends WorkbenchWindowAction {

	protected void execute(IAction action) throws InvocationTargetException, InterruptedException {
		DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SAVE);
		dialog.setText(Policy.bind("ExportAction.exportTo"));
		String directory = dialog.open();
		if (directory == null) return;
		new ExportOperation(getTargetPart(), getSelectedResources(), directory).run();
	}

	/*
	 * @see org.tigris.subversion.subclipse.ui.actions.ReplaceableIconAction#getImageId()
	 */
	protected String getImageId() {
		return ISVNUIConstants.IMG_MENU_EXPORT;
	}

}

@@ -677,28 +677,123 @@
 pse.
-jface.action.IAction
+core.resources.IResource;%0Aimport org.eclipse.jface.action.IAction;%0Aimport org.eclipse.jface.dialogs.IDialogSettings
 ;%0Aim
@@ -975,16 +975,71 @@
 Policy;%0A
+import org.tigris.subversion.subclipse.ui.SVNUIPlugin;%0A
 import o
@@ -1158,16 +1158,235 @@
 Action %7B
+%0A%09private IDialogSettings settings;%0A%09private final static String settingsKey = %22ExportAction.lastLocation%22; //$NON-NLS-1$%0A%0A%09public ExportAction() %7B%0A%09%09super();%0A%09%09settings = SVNUIPlugin.getPlugin().getDialogSettings();%0A%09%7D
 %0A%0A%09prote
@@ -1601,16 +1601,73 @@
 rtTo%22));
+ //$NON-NLS-1$%0A%09%09dialog.setFilterPath(getLastLocation());
 %0A%09%09Strin
@@ -1728,16 +1728,43 @@
 return;%0A
+%09%09saveLocation(directory);%0A
 %09%09new Ex
@@ -1969,16 +1969,16 @@
 eId() %7B%0A
-
 %09%09return
@@ -2013,12 +2013,732 @@
 PORT;%0A%09%7D
+%0A%09%0A%09private String getLastLocation() %7B%0A%09%09String lastLocation = null;%0A%09%09IResource%5B%5D resources = getSelectedResources();%0A%09%09%0A%09%09// If just one resource selected, first see if this resource has%0A%09%09// previously been exported.%0A%09%09if (resources.length == 1) %7B%0A%09%09%09lastLocation = settings.get(settingsKey + %22.%22 + resources%5B0%5D.getFullPath()); //$NON-NLS-1$%0A%09%09%7D%0A%09%09if (lastLocation == null) %7B%0A%09%09%09lastLocation = settings.get(settingsKey);%0A%09%09%7D%0A%09%09return lastLocation;%0A%09%7D%0A%09%0A%09private void saveLocation(String directory) %7B%0A%09%09IResource%5B%5D resources = getSelectedResources();%0A%09%09if (resources.length == 1) %7B%0A%09%09%09settings.put(settingsKey + %22.%22 + resources%5B0%5D.getFullPath(), directory); //$NON-NLS-1$%0A%09%09%7D%0A%09%09settings.put(settingsKey, directory);%0A%09%7D
 %0A%0A%7D%0A

Make export dialog remember the last location. Issue #: 729