01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.ide.model;
11:
12: import org.eclipse.core.resources.IWorkspace;
13: import org.eclipse.jface.resource.ImageDescriptor;
14: import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
15: import org.eclipse.ui.model.WorkbenchAdapter;
16:
17: /**
18: * IWorkbenchAdapter adapter for the IWorkspace object.
19: */
20: public class WorkbenchWorkspace extends WorkbenchAdapter {
21: /*
22: * (non-Javadoc)
23: * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
24: */
25: public Object[] getChildren(Object o) {
26: IWorkspace workspace = (IWorkspace) o;
27: return workspace.getRoot().getProjects();
28: }
29:
30: /*
31: * (non-Javadoc)
32: * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
33: */
34: public ImageDescriptor getImageDescriptor(Object object) {
35: return null;
36: }
37:
38: /**
39: * getLabel method comment.
40: */
41: public String getLabel(Object o) {
42: //workspaces don't have a name
43: return IDEWorkbenchMessages.Workspace;
44: }
45: }
|