1 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 21 public class WorkbenchStatus extends WorkbenchAdapter implements IAdaptable { 22 private IStatus status; 23 24 private Object [] children; 25 26 public WorkbenchStatus(IStatus status) { 27 this.status = status; 28 } 29 30 35 public Object getAdapter(Class adapter) { 36 if (adapter == IWorkbenchAdapter.class) { 37 return this; 38 } 39 return null; 40 } 41 42 45 public Object [] getChildren(Object o) { 46 if (children == null) { 47 IStatus[] childStatii = status.getChildren(); 48 children = new Object [childStatii.length]; 49 for (int i = 0; i < childStatii.length; i++) { 50 children[i] = new WorkbenchStatus(childStatii[i]); 51 } 52 } 53 return children; 54 } 55 56 59 public String getLabel(Object o) { 60 return status.getMessage(); 61 } 62 63 66 public IStatus getStatus() { 67 return status; 68 } 69 } 70 | Popular Tags |