KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > model > DateTagCategory


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.model;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.jface.resource.ImageDescriptor;
15 import org.eclipse.team.internal.ccvs.core.*;
16 import org.eclipse.team.internal.ccvs.ui.*;
17 import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
18 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
19
20 /**
21  * The DateTagCategory is the parent of all the date tags in the repositories view.
22  */

23 public class DateTagCategory extends TagCategory {
24
25     public DateTagCategory(ICVSRepositoryLocation repository) {
26         super(repository);
27     }
28
29     /* (non-Javadoc)
30      * @see org.eclipse.team.internal.ccvs.ui.model.TagCategory#getTags(org.eclipse.core.runtime.IProgressMonitor)
31      */

32     protected CVSTag[] getTags(IProgressMonitor monitor) throws CVSException {
33         return CVSUIPlugin.getPlugin().getRepositoryManager().getRepositoryRootFor(repository).getDateTags();
34     }
35
36     /* (non-Javadoc)
37      * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
38      */

39     public ImageDescriptor getImageDescriptor(Object JavaDoc object) {
40         return CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_DATES_CATEGORY);
41     }
42
43     /* (non-Javadoc)
44      * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
45      */

46     public String JavaDoc getLabel(Object JavaDoc o) {
47         return CVSUIMessages.DateTagCategory_0;
48     }
49     
50     /* (non-Javadoc)
51      * @see org.eclipse.team.internal.ccvs.ui.model.TagCategory#getAdapter(java.lang.Class)
52      */

53     public Object JavaDoc getAdapter(Class JavaDoc adapter) {
54         if (adapter.equals(ICVSRepositoryLocation.class)) {
55             return getRepository(null);
56         }
57         return super.getAdapter(adapter);
58     }
59
60 }
61
Popular Tags