KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > CVSTeamStateProvider


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.ccvs.ui;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.team.core.subscribers.Subscriber;
16 import org.eclipse.team.ui.mapping.*;
17 import org.eclipse.team.ui.synchronize.SubscriberTeamStateProvider;
18
19 public class CVSTeamStateProvider extends SubscriberTeamStateProvider {
20
21     public CVSTeamStateProvider(Subscriber subscriber) {
22         super(subscriber);
23     }
24
25     public ITeamStateDescription getStateDescription(Object JavaDoc element, final int requestedStateMask, String JavaDoc[] properties, IProgressMonitor monitor) throws CoreException {
26         if (properties != null && properties.length == 0) {
27             return new CVSTeamStateDescription(getSynchronizationState(element, requestedStateMask, monitor));
28         }
29         CVSDecoration d = CVSLightweightDecorator.decorate(element, new SynchronizationStateTester() {
30             public int getState(Object JavaDoc element, int stateMask, IProgressMonitor monitor) throws CoreException {
31                 if (requestedStateMask != USE_DECORATED_STATE_MASK) {
32                     stateMask = requestedStateMask & stateMask;
33                 }
34                 return getSynchronizationState(element, requestedStateMask & stateMask, monitor);
35             }
36         });
37         return d.asTeamStateDescription(properties);
38     }
39 }
40
Popular Tags