Javadoc update for Egit
[egit.git] / org.spearce.egit.core / src / org / spearce / egit / core / GitProvider.java
blobe42f6facd2e32b1bf737c2fc5915a9c1b8301a3d
1 /*
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;
26 /**
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() {
49 return true;
52 public synchronized IMoveDeleteHook getMoveDeleteHook() {
53 if (hook == null) {
54 hook = new GitMoveDeleteHook(getData());
56 return hook;
59 /**
60 * @return information about the mapping of an Eclipse project
61 * to a Git repository.
63 public synchronized GitProjectData getData() {
64 if (data == null) {
65 data = GitProjectData.get(getProject());
67 return data;
70 public synchronized IFileHistoryProvider getFileHistoryProvider() {
71 if (historyProvider == null) {
72 historyProvider = new GitFileHistoryProvider();
74 return historyProvider;