KickJava   Java API By Example, From Geeks To Geeks.

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


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.IAdaptable;
15 import org.eclipse.team.internal.ccvs.core.ICVSResource;
16 import org.eclipse.ui.model.IWorkbenchAdapter;
17
18 public abstract class CVSResourceElement extends CVSModelElement implements IAdaptable {
19     public Object JavaDoc getAdapter(Class JavaDoc adapter) {
20         if (adapter == IWorkbenchAdapter.class) return this;
21         return null;
22     }
23     /**
24      * Initial implementation: return the resource's name
25      */

26     public String JavaDoc getLabel(Object JavaDoc o) {
27         if (!(o instanceof ICVSResource)) return null;
28         return ((ICVSResource)o).getName();
29     }
30     /**
31      * Return null.
32      */

33     public Object JavaDoc getParent(Object JavaDoc o) {
34         if (!(o instanceof ICVSResource)) return null;
35         return null;
36     }
37     
38     abstract public ICVSResource getCVSResource();
39 }
40
Popular Tags