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 [StandardPropertiesAdapterFactory.java]

nameclass, %method, %block, %line, %
StandardPropertiesAdapterFactory.java100% (1/1)67%  (2/3)25%  (18/71)16%  (1.7/11)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class StandardPropertiesAdapterFactory100% (1/1)67%  (2/3)25%  (18/71)16%  (1.7/11)
getAdapter (Object, Class): Object 0%   (0/1)0%   (0/47)0%   (0/9)
getAdapterList (): Class [] 100% (1/1)71%  (15/21)71%  (0.7/1)
StandardPropertiesAdapterFactory (): void 100% (1/1)100% (3/3)100% (1/1)

1/*******************************************************************************
2 * Copyright (c) 2000, 2007 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.IFile;
14import org.eclipse.core.resources.IResource;
15import org.eclipse.core.runtime.IAdapterFactory;
16import org.eclipse.ui.views.properties.FilePropertySource;
17import org.eclipse.ui.views.properties.IPropertySource;
18import org.eclipse.ui.views.properties.ResourcePropertySource;
19 
20/**
21 * Dispenses an <code>IPropertySource</code> adapter for the core resource objects.
22 */
23/* package */class StandardPropertiesAdapterFactory implements IAdapterFactory {
24    /* (non-Javadoc)
25     * Method declared on IAdapterFactory.
26     */
27    public Object getAdapter(Object o, Class adapterType) {
28        if (adapterType.isInstance(o)) {
29            return o;
30        }
31        if (adapterType == IPropertySource.class) {
32            if (o instanceof IResource) {
33                IResource resource = (IResource) o;
34                if (resource.getType() == IResource.FILE) {
35                                        return new FilePropertySource((IFile) o);
36                                }
37                                return new ResourcePropertySource((IResource) o);
38            }
39        }
40        return null;
41    }
42 
43    /* (non-Javadoc)
44     * Method declared on IAdapterFactory.
45     */
46    public Class[] getAdapterList() {
47        return new Class[] { IPropertySource.class };
48    }
49}

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