1 19 20 package org.netbeans.modules.refactoring.spi.ui; 21 22 import org.openide.util.Lookup; 23 24 30 public final class TreeElementFactory { 31 32 private static final Lookup.Result<TreeElementFactoryImplementation> implementations = 33 Lookup.getDefault().lookup(new Lookup.Template(TreeElementFactoryImplementation.class)); 34 35 private TreeElementFactory() {} 36 37 41 public static TreeElement getTreeElement(Object object) { 42 if (object == null) throw new IllegalArgumentException (); 43 for (TreeElementFactoryImplementation fac: implementations.allInstances()) { 44 TreeElement result = fac.getTreeElement(object); 45 if (result != null) { 46 return result; 47 } 48 } 49 return null; 50 } 51 } 52 | Popular Tags |