EMMA Coverage Report (generated Mon Sep 29 15:05:28 EDT 2008)
[all classes][org.eclipse.ui.internal.ide.model]

COVERAGE SUMMARY FOR SOURCE FILE [WorkbenchRootResource.java]

nameclass, %method, %block, %line, %
WorkbenchRootResource.java100% (1/1)75%  (3/4)69%  (11/16)67%  (4/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class WorkbenchRootResource100% (1/1)75%  (3/4)69%  (11/16)67%  (4/6)
getImageDescriptor (Object): ImageDescriptor 0%   (0/1)0%   (0/5)0%   (0/2)
WorkbenchRootResource (): void 100% (1/1)100% (3/3)100% (1/1)
getChildren (Object): Object [] 100% (1/1)100% (6/6)100% (2/2)
getLabel (Object): String 100% (1/1)100% (2/2)100% (1/1)

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 *******************************************************************************/
11package org.eclipse.ui.internal.ide.model;
12 
13import org.eclipse.core.resources.IWorkspaceRoot;
14import org.eclipse.jface.resource.ImageDescriptor;
15import org.eclipse.ui.ISharedImages;
16import org.eclipse.ui.PlatformUI;
17import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
18import org.eclipse.ui.model.WorkbenchAdapter;
19 
20/**
21 * An IWorkbenchAdapter implementation for IWorkspaceRoot objects.
22 */
23public class WorkbenchRootResource extends WorkbenchAdapter {
24    /**
25     * @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(Object)
26     * Returns the children of the root resource.
27     */
28    public Object[] getChildren(Object o) {
29        IWorkspaceRoot root = (IWorkspaceRoot) o;
30        return root.getProjects();
31    }
32 
33    /**
34     * @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(Object)
35     */
36    public ImageDescriptor getImageDescriptor(Object object) {
37            return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
38                ISharedImages.IMG_OBJ_ELEMENT);
39    }
40 
41    /**
42     * Returns the name of this element.  This will typically
43     * be used to assign a label to this object when displayed
44     * in the UI.
45     */
46    public String getLabel(Object o) {
47        //root resource has no name
48        return IDEWorkbenchMessages.Workspace;
49    }
50}

[all classes][org.eclipse.ui.internal.ide.model]
EMMA 2.0.5312 EclEmma Fix 1 (C) Vladimir Roubtsov