KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > ccvs > ui > operations > RemoteProjectFolder


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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  * Philippe Ombredanne - bug 84808
11  *******************************************************************************/

12 package org.eclipse.team.internal.ccvs.ui.operations;
13
14 import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
15
16 /**
17  * This specialized RemoteFolder represents a RemoteFolder that contains
18  * a .project metafile and has an additional field representing the project
19  * name retrieved from this .project metafile
20  */

21 public class RemoteProjectFolder extends RemoteFolder {
22
23     protected String JavaDoc projectName;
24
25     /**
26      * The Constructor for the RemoteProjectFolder
27      * @param folder the original RemoteFolder to 'clone'
28      * @param projectName the project name retrieved from the project metafile
29      */

30     public RemoteProjectFolder(RemoteFolder folder, String JavaDoc projectName) {
31         super((RemoteFolder) folder.getParent(), folder.getName(), folder.getRepository(),
32                 folder.getRepositoryRelativePath(), folder.getTag(), folder.getFolderSyncInfo().getIsStatic());
33         this.projectName = projectName;
34     }
35
36     /**
37      * @return true is the project name has been set and is not null or empty, false otherwise.
38      */

39     public boolean hasProjectName() {
40         if (isProjectNameEmpty())
41             return false;
42         return true;
43     }
44
45     /**
46      * @return the project name derived from the project description The name is guaranteed to be a null or a non empty string
47      */

48     public String JavaDoc getProjectName() {
49         if (isProjectNameEmpty())
50             return null;
51         return projectName;
52     }
53     
54     private boolean isProjectNameEmpty() {
55         return projectName == null || projectName.equals(""); //$NON-NLS-1$
56
}
57 }
58
Popular Tags