KickJava   Java API By Example, From Geeks To Geeks.

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


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  
14 import org.eclipse.core.runtime.IProgressMonitor;
15 import org.eclipse.jface.resource.ImageDescriptor;
16 import org.eclipse.team.internal.ccvs.core.CVSException;
17 import org.eclipse.team.internal.ccvs.core.CVSTag;
18 import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
19 import org.eclipse.team.internal.ccvs.ui.*;
20 import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin;
21 import org.eclipse.team.internal.ccvs.ui.ICVSUIConstants;
22 /**
23  * BranchCategory is the model element for the branches category
24  * for a particular repository in the repositories view. Its children
25  * are the array of all known branch tags, other than HEAD, for the
26  * given repository.
27  */

28 public class BranchCategory extends TagCategory {
29
30     public BranchCategory(ICVSRepositoryLocation repository) {
31         super(repository);
32     }
33     
34     protected CVSTag[] getTags(IProgressMonitor monitor) throws CVSException {
35         return CVSUIPlugin.getPlugin().getRepositoryManager().getKnownTags(repository, getWorkingSet(), CVSTag.BRANCH, monitor);
36     }
37
38     /**
39      * Returns an image descriptor to be used for displaying an object in the workbench.
40      * Returns null if there is no appropriate image.
41      *
42      * @param object The object to get an image descriptor for.
43      */

44     public ImageDescriptor getImageDescriptor(Object JavaDoc object) {
45         return CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_BRANCHES_CATEGORY);
46     }
47     
48     /**
49      * Returns the name of this element. This will typically
50      * be used to assign a label to this object when displayed
51      * in the UI. Returns an empty string if there is no appropriate
52      * name for this object.
53      *
54      * @param object The object to get a label for.
55      */

56     public String JavaDoc getLabel(Object JavaDoc o) {
57         return CVSUIMessages.BranchCategory_Branches_1;
58     }
59 }
60
Popular Tags