KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > classpath > VariableClasspathEntryWorkbenchAdapter


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  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui.classpath;
12
13 import org.eclipse.jdt.internal.launching.VariableClasspathEntry;
14 import org.eclipse.jdt.ui.ISharedImages;
15 import org.eclipse.jdt.ui.JavaUI;
16 import org.eclipse.jface.resource.ImageDescriptor;
17 import org.eclipse.ui.model.IWorkbenchAdapter;
18
19 /**
20  * Workbench adapter for a string substitution runtime classpath entry.
21  *
22  * @since 3.0
23  */

24 public class VariableClasspathEntryWorkbenchAdapter implements IWorkbenchAdapter {
25     /* (non-Javadoc)
26      * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
27      */

28     public Object JavaDoc[] getChildren(Object JavaDoc o) {
29         return null;
30     }
31     /* (non-Javadoc)
32      * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
33      */

34     public ImageDescriptor getImageDescriptor(Object JavaDoc object) {
35         if (object instanceof VariableClasspathEntry) {
36             return JavaUI.getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_JAR);
37         }
38         return null;
39     }
40         
41     /* (non-Javadoc)
42      * @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
43      */

44     public String JavaDoc getLabel(Object JavaDoc o) {
45         if (o instanceof VariableClasspathEntry) {
46             return ((VariableClasspathEntry)o).getName();
47         }
48         return ""; //$NON-NLS-1$
49
}
50     /* (non-Javadoc)
51      * @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
52      */

53     public Object JavaDoc getParent(Object JavaDoc o) {
54         return null;
55     }
56 }
57
Popular Tags