KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > model > WorkbenchStatusList


1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.ide.model;
12
13 import org.eclipse.core.runtime.IAdaptable;
14 import org.eclipse.core.runtime.IStatus;
15 import org.eclipse.ui.model.IWorkbenchAdapter;
16 import org.eclipse.ui.model.WorkbenchAdapter;
17
18 import java.util.*;
19
20 public class WorkbenchStatusList extends WorkbenchAdapter implements IAdaptable {
21     private ArrayList statii = new ArrayList(10);
22 public void add(IStatus status) {
23     statii.add(new WorkbenchStatus(status));
24 }
25 public void clear() {
26     statii.clear();
27 }
28 /**
29  * Returns an object which is an instance of the given class
30  * associated with this object. Returns <code>null</code> if
31  * no such object can be found.
32  */

33 public Object JavaDoc getAdapter(Class JavaDoc adapter) {
34     if (adapter == IWorkbenchAdapter.class) return this;
35     return null;
36 }
37 /**
38  * Returns the children of this element.
39  */

40 public Object JavaDoc[] getChildren(Object JavaDoc o) {
41     return statii.toArray();
42 }
43 public void remove(WorkbenchStatus status) {
44     statii.remove(status);
45 }
46 }
47
Popular Tags