1 17 package org.eclipse.emf.edit.provider; 18 19 20 import java.util.Collections ; 21 import java.util.Iterator ; 22 23 import org.eclipse.emf.common.notify.AdapterFactory; 24 import org.eclipse.emf.common.util.AbstractTreeIterator; 25 26 27 31 public class AdapterFactoryTreeIterator extends AbstractTreeIterator 32 { 33 36 protected AdapterFactory adapterFactory; 37 38 41 public AdapterFactoryTreeIterator(AdapterFactory adapterFactory, Object object) 42 { 43 super(object); 44 this.adapterFactory = adapterFactory; 45 } 46 47 51 public AdapterFactoryTreeIterator(AdapterFactory adapterFactory, Object object, boolean includeRoot) 52 { 53 super(object, includeRoot); 54 this.adapterFactory = adapterFactory; 55 } 56 57 protected Iterator getChildren(Object o) 58 { 59 ITreeItemContentProvider treeItemContentProvider = (ITreeItemContentProvider)adapterFactory.adapt(o, ITreeItemContentProvider.class); 60 return 61 treeItemContentProvider != null ? 62 treeItemContentProvider.getChildren(o).iterator() : 63 Collections.EMPTY_LIST.iterator(); 64 } 65 } 66 | Popular Tags |