1 /*******************************************************************************
2 * Copyright (C) 2008, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2008, 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 * See LICENSE for the full license text, also available.
8 *******************************************************************************/
9 package org
.spearce
.egit
.core
;
11 import org
.eclipse
.core
.resources
.team
.IMoveDeleteHook
;
12 import org
.eclipse
.core
.runtime
.CoreException
;
13 import org
.eclipse
.team
.core
.RepositoryProvider
;
14 import org
.eclipse
.team
.core
.history
.IFileHistoryProvider
;
15 import org
.spearce
.egit
.core
.internal
.storage
.GitFileHistoryProvider
;
16 import org
.spearce
.egit
.core
.project
.GitProjectData
;
19 * The Team provider class for a Git repository.
21 public class GitProvider
extends RepositoryProvider
{
22 private GitProjectData data
;
24 private GitMoveDeleteHook hook
;
26 private GitFileHistoryProvider historyProvider
;
28 public String
getID() {
29 return getClass().getName();
32 public void configureProject() throws CoreException
{
33 getData().markTeamPrivateResources();
36 public void deconfigure() throws CoreException
{
37 GitProjectData
.delete(getProject());
40 public boolean canHandleLinkedResources() {
45 public boolean canHandleLinkedResourceURI() {
49 public synchronized IMoveDeleteHook
getMoveDeleteHook() {
51 hook
= new GitMoveDeleteHook(getData());
57 * @return information about the mapping of an Eclipse project
58 * to a Git repository.
60 public synchronized GitProjectData
getData() {
62 data
= GitProjectData
.get(getProject());
67 public synchronized IFileHistoryProvider
getFileHistoryProvider() {
68 if (historyProvider
== null) {
69 historyProvider
= new GitFileHistoryProvider();
71 return historyProvider
;