Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 859e57085dd80bcee5d3f1f2d3fd1e00f900fe55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
 * Copyright (c) 2000, 2009 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.examples.filesystem.ui;

import java.lang.reflect.InvocationTargetException;

import org.eclipse.jface.action.IAction;
import org.eclipse.team.examples.filesystem.Policy;

/**
 * Action for getting the contents of the selected resources
 */
public class GetAction extends FileSystemAction {

	protected void execute(IAction action) {
		try {
			GetOperation operation = new GetOperation(getTargetPart(),
								FileSystemOperation.createScopeManager(Policy.bind("GetAction.working"), getSelectedMappings())); //$NON-NLS-1$
			operation.setOverwriteOutgoing(isOverwriteOutgoing());
			operation.run();
		} catch (InvocationTargetException e) {
			handle(e, null, Policy.bind("GetAction.problemMessage")); //$NON-NLS-1$
		} catch (InterruptedException e) {
			// Ignore
		}
	}

	/**
	 * Indicate whether the action should overwrite outgoing changes.
	 * By default, the get action does not override local modifications.
	 * @return whether the action should overwrite outgoing changes.
	 */
	protected boolean isOverwriteOutgoing() {
		return false;
	}
}

Back to the top