2 * Copyright (C) 2006 Shawn Pearce <spearce@spearce.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License, version 2.1, as published by the Free Software Foundation.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
17 package org
.spearce
.egit
.core
;
19 import org
.eclipse
.core
.resources
.team
.IMoveDeleteHook
;
20 import org
.eclipse
.core
.runtime
.CoreException
;
21 import org
.eclipse
.team
.core
.RepositoryProvider
;
22 import org
.eclipse
.team
.core
.history
.IFileHistoryProvider
;
23 import org
.spearce
.egit
.core
.internal
.mapping
.GitFileHistoryProvider
;
24 import org
.spearce
.egit
.core
.project
.GitProjectData
;
27 * The Team provider class for a Git repository.
29 public class GitProvider
extends RepositoryProvider
{
30 private GitProjectData data
;
32 private GitMoveDeleteHook hook
;
34 private GitFileHistoryProvider historyProvider
;
36 public String
getID() {
37 return getClass().getName();
40 public void configureProject() throws CoreException
{
41 getData().markTeamPrivateResources();
44 public void deconfigure() throws CoreException
{
45 GitProjectData
.delete(getProject());
48 public boolean canHandleLinkedResources() {
52 public synchronized IMoveDeleteHook
getMoveDeleteHook() {
54 hook
= new GitMoveDeleteHook(getData());
60 * @return information about the mapping of an Eclipse project
61 * to a Git repository.
63 public synchronized GitProjectData
getData() {
65 data
= GitProjectData
.get(getProject());
70 public synchronized IFileHistoryProvider
getFileHistoryProvider() {
71 if (historyProvider
== null) {
72 historyProvider
= new GitFileHistoryProvider();
74 return historyProvider
;