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

nameclass, %method, %block, %line, %
WorkbenchStatus.java0%   (0/1)0%   (0/5)0%   (0/67)0%   (0/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class WorkbenchStatus0%   (0/1)0%   (0/5)0%   (0/67)0%   (0/14)
WorkbenchStatus (IStatus): void 0%   (0/1)0%   (0/6)0%   (0/3)
getAdapter (Class): Object 0%   (0/1)0%   (0/21)0%   (0/3)
getChildren (Object): Object [] 0%   (0/1)0%   (0/33)0%   (0/6)
getLabel (Object): String 0%   (0/1)0%   (0/4)0%   (0/1)
getStatus (): IStatus 0%   (0/1)0%   (0/3)0%   (0/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.runtime.IAdaptable;
14import org.eclipse.core.runtime.IStatus;
15 
16import org.eclipse.ui.model.IWorkbenchAdapter;
17import org.eclipse.ui.model.WorkbenchAdapter;
18 
19/**
20 * UI manifestation of a status object.
21 */
22public class WorkbenchStatus extends WorkbenchAdapter implements IAdaptable {
23    private IStatus status;
24 
25    private Object[] children;
26 
27    /**
28     * Creates a workbench status for the given status.
29     * 
30     * @param status the status
31     */
32    public WorkbenchStatus(IStatus status) {
33        this.status = status;
34    }
35 
36    /**
37     * Returns an object which is an instance of the given class
38     * associated with this object. Returns <code>null</code> if
39     * no such object can be found.
40     */
41    public Object getAdapter(Class adapter) {
42        if (adapter == IWorkbenchAdapter.class) {
43                        return this;
44                }
45        return null;
46    }
47 
48    /**
49     * Returns the children of this element.
50     */
51    public Object[] getChildren(Object o) {
52        if (children == null) {
53            IStatus[] childStatii = status.getChildren();
54            children = new Object[childStatii.length];
55            for (int i = 0; i < childStatii.length; i++) {
56                children[i] = new WorkbenchStatus(childStatii[i]);
57            }
58        }
59        return children;
60    }
61 
62    /**
63     * @see IWorkbenchAdapter#getLabel
64     */
65    public String getLabel(Object o) {
66        return status.getMessage();
67    }
68 
69    /**
70     * Returns the wrapped status object.
71     * 
72     * @return the wrapped status object
73     */
74    public IStatus getStatus() {
75        return status;
76    }
77}

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