1 /*******************************************************************************
2 * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2007, Shawn O. Pearce <spearce@spearce.org>
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *******************************************************************************/
10 package org
.eclipse
.egit
.ui
.internal
.actions
;
12 import java
.util
.ArrayList
;
13 import java
.util
.List
;
15 import org
.eclipse
.core
.resources
.IProject
;
16 import org
.eclipse
.core
.resources
.IResource
;
17 import org
.eclipse
.egit
.core
.op
.DisconnectProviderOperation
;
18 import org
.eclipse
.egit
.core
.op
.IEGitOperation
;
19 import org
.eclipse
.egit
.ui
.UIText
;
20 import org
.eclipse
.egit
.ui
.internal
.decorators
.GitLightweightDecorator
;
23 * Action to disassociate a project from its Git repository.
25 * @see DisconnectProviderOperation
27 public class Disconnect
extends AbstractResourceOperationAction
{
28 protected IEGitOperation
createOperation(final List
<IResource
> sel
) {
29 List
<IProject
> projects
= new ArrayList
<IProject
>();
30 for(IResource resource
:sel
)
31 projects
.add((IProject
) resource
);
32 return new DisconnectProviderOperation(projects
);
35 protected void postOperation() {
36 GitLightweightDecorator
.refresh();
40 protected String
getJobName() {
41 return UIText
.Disconnect_disconnect
;