blob: 2c46aa5be459beb14fd547179300070b34891d6f (
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
|
/*******************************************************************************
* Copyright (C) 2011, Mathias Kinzler <mathias.kinzler@sap.com>
* Copyright (C) 2010, Matthias Sohn <matthias.sohn@sap.com>
*
* All rights reserved. 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
*******************************************************************************/
package org.eclipse.egit.ui.internal.actions;
import java.util.Arrays;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IResource;
import org.eclipse.egit.core.internal.job.JobUtil;
import org.eclipse.egit.core.op.AssumeUnchangedOperation;
import org.eclipse.egit.ui.JobFamilies;
import org.eclipse.egit.ui.internal.UIText;
/**
* This operation unsets the assume-valid bit in the index for the selected
* resources.
*
* @see AssumeUnchangedOperation
*/
public class NoAssumeUnchangedActionHandler extends RepositoryActionHandler {
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IResource[] resources = getSelectedResources(event);
if (resources.length == 0)
return null;
AssumeUnchangedOperation op = new AssumeUnchangedOperation(Arrays
.asList(resources), false);
JobUtil.scheduleUserJob(op, UIText.AssumeUnchanged_assumeUnchanged,
JobFamilies.ASSUME_NOASSUME_UNCHANGED);
return null;
}
}
|