KickJava   Java API By Example, From Geeks To Geeks.

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


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;
12
13 import org.eclipse.osgi.util.NLS;
14 import org.eclipse.team.internal.ccvs.core.CVSTag;
15 import org.eclipse.ui.dialogs.PropertyPage;
16
17 public abstract class CVSPropertiesPage extends PropertyPage {
18
19     /**
20      * Return the appropriate Tag label for properties pages
21      * based on the tag type.
22      * @param tag
23      * @return String
24      */

25     
26     public static String JavaDoc getTagLabel(CVSTag tag) {
27     
28     if (tag == null) {
29         return CVSUIMessages.CVSFilePropertiesPage_none;
30     }
31     
32     switch (tag.getType()) {
33         case CVSTag.HEAD:
34             return tag.getName();
35         case CVSTag.VERSION:
36             return NLS.bind(CVSUIMessages.CVSFilePropertiesPage_version, new String JavaDoc[] { tag.getName() });
37         case CVSTag.BRANCH:
38             return NLS.bind(CVSUIMessages.CVSFilePropertiesPage_branch, new String JavaDoc[] { tag.getName() });
39         case CVSTag.DATE:
40             return NLS.bind(CVSUIMessages.CVSFilePropertiesPage_date, new String JavaDoc[] { tag.getName() });
41         default :
42             return tag.getName();
43         }
44     }
45 }
46
Popular Tags