blob: 2d356d520b585180c2832a417f426b503bc67023 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
/*******************************************************************************
* Copyright (c) 2000, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.ui.dialogs.PropertyPage;
public abstract class CVSPropertiesPage extends PropertyPage {
/**
* Return the appropriate Tag label for properties pages
* based on the tag type.
* @param tag
* @return String
*/
public static String getTagLabel(CVSTag tag) {
if (tag == null) {
return Policy.bind("CVSFilePropertiesPage.none"); //$NON-NLS-1$
}
switch (tag.getType()) {
case CVSTag.HEAD:
return tag.getName();
case CVSTag.VERSION:
return Policy.bind("CVSFilePropertiesPage.version", tag.getName()); //$NON-NLS-1$
case CVSTag.BRANCH:
return Policy.bind("CVSFilePropertiesPage.branch", tag.getName()); //$NON-NLS-1$
case CVSTag.DATE:
return Policy.bind("CVSFilePropertiesPage.date", tag.getName()); //$NON-NLS-1$
default :
return tag.getName();
}
}
}
|