1 19 20 package org.netbeans.api.java.loaders; 21 22 import org.netbeans.modules.java.JavaDataLoader; 23 import org.netbeans.modules.java.JavaNode; 24 import org.openide.filesystems.FileObject; 25 import org.openide.loaders.DataObject; 26 import org.openide.loaders.DataObjectNotFoundException; 27 import org.openide.loaders.MultiDataObject; 28 import org.openide.nodes.Node; 29 30 36 public final class JavaDataSupport { 37 38 39 private JavaDataSupport() { 40 } 41 42 50 public static MultiDataObject.Entry createJavaFileEntry(MultiDataObject mdo, FileObject javafile) { 51 return new JavaDataLoader.JavaFileEntry(mdo, javafile); 52 } 53 54 59 public static Node createJavaNode(FileObject javafile) { 60 try { 61 DataObject jdo = DataObject.find(javafile); 62 return new JavaNode(jdo, true); 63 } catch (DataObjectNotFoundException ex) { 64 throw new IllegalStateException (ex); 65 } 66 } 67 68 } 69 | Popular Tags |