001: /**
002: * LibreSource
003: * Copyright (C) 2004-2008 Artenum SARL / INRIA
004: * http://www.libresource.org - contact@artenum.com
005: *
006: * This file is part of the LibreSource software,
007: * which can be used and distributed under license conditions.
008: * The license conditions are provided in the LICENSE.TXT file
009: * at the root path of the packaging that enclose this file.
010: * More information can be found at
011: * - http://dev.libresource.org/home/license
012: *
013: * Initial authors :
014: *
015: * Guillaume Bort / INRIA
016: * Francois Charoy / Universite Nancy 2
017: * Julien Forest / Artenum
018: * Claude Godart / Universite Henry Poincare
019: * Florent Jouille / INRIA
020: * Sebastien Jourdain / INRIA / Artenum
021: * Yves Lerumeur / Artenum
022: * Pascal Molli / Universite Henry Poincare
023: * Gerald Oster / INRIA
024: * Mariarosa Penzi / Artenum
025: * Gerard Sookahet / Artenum
026: * Raphael Tani / INRIA
027: *
028: * Contributors :
029: *
030: * Stephane Bagnier / Artenum
031: * Amadou Dia / Artenum-IUP Blois
032: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033: */package org.libresource.so6.plugin.core;
034:
035: /**
036: * @author Guillaume Bort
037: */
038: import org.eclipse.core.runtime.CoreException;
039: import org.eclipse.core.runtime.IStatus;
040: import org.eclipse.core.runtime.Status;
041:
042: import org.eclipse.team.core.RepositoryProvider;
043:
044: import org.libresource.so6.plugin.Plugin;
045: import org.libresource.so6.plugin.ui.So6ResourceUILabelDecorator;
046:
047: /**
048: * DOCUMENT ME!
049: *
050: * @author $author$
051: * @version $Revision: 1.3 $
052: */
053: public class So6TeamProvider extends RepositoryProvider {
054: /** DOCUMENT ME! */
055: public static final String ID = "org.libresource.so6.plugin.core.so6provider";
056:
057: /**
058: * DOCUMENT ME!
059: *
060: * @throws CoreException DOCUMENT ME!
061: */
062: public void configureProject() throws CoreException {
063: try {
064: Runnable mesTaches = new Runnable() {
065: public void run() {
066: try {
067: // TODO conflict finder
068: //So6Util.addConflictFinder(getProject());
069: try {
070: So6Util.getPrivateSo6DirectoryResource(
071: getProject()).setTeamPrivateMember(
072: true);
073: } catch (Exception e) {
074: e.printStackTrace();
075: }
076:
077: So6ResourceUILabelDecorator.update();
078: So6Util.refresh(getProject(), null);
079: } catch (Exception e) {
080: e.printStackTrace();
081: }
082: }
083: };
084:
085: new Thread(mesTaches).start();
086: } catch (Exception e) {
087: throw new CoreException(new Status(IStatus.ERROR,
088: Plugin.ID, IStatus.OK, e.getMessage(), e));
089: }
090: }
091:
092: /**
093: * DOCUMENT ME!
094: *
095: * @throws CoreException DOCUMENT ME!
096: */
097: public void deconfigure() throws CoreException {
098: So6Util.deleteProblemMarkers(getProject());
099:
100: try {
101: So6Util.getPrivateSo6DirectoryResource(getProject())
102: .setTeamPrivateMember(false);
103: } catch (Exception e) {
104: //
105: }
106:
107: So6ResourceUILabelDecorator.update();
108:
109: // TODO conflict finder
110: //So6Util.removeConflictFinder(getProject());
111: }
112:
113: /**
114: * DOCUMENT ME!
115: *
116: * @return DOCUMENT ME!
117: */
118: public String getID() {
119: return ID;
120: }
121: }
|