1 19 20 package org.netbeans.modules.java.ui.nodes; 21 22 import org.netbeans.modules.java.JavaDataObject; 23 import org.netbeans.modules.java.ui.nodes.elements.ElementFormat; 24 25 import java.text.Format ; 26 27 30 public final class SourceNodes { 31 32 private static SourceNodeFactory BROWSER_FACTORY; 33 private static SourceNodeFactory EXPLORER_FACTORY; 34 35 public static SourceNodeFactory getExplorerFactory() { 36 if (EXPLORER_FACTORY == null) { 37 EXPLORER_FACTORY = createSourceNodeFactory( 38 (ExElementNodeFactory) JavaDataObject.getExplorerFactory()); 39 } 40 return EXPLORER_FACTORY; 41 } 42 43 public static SourceNodeFactory getBrowserFactory() { 44 if (BROWSER_FACTORY == null) { 45 JavaSourceNodeFactory f = new JavaSourceNodeFactory(); 46 f.setGenerateForTree(true); 47 BROWSER_FACTORY = f; 48 } 49 return BROWSER_FACTORY; 50 } 51 52 57 public static ExElementNodeFactory createElementNodeFactory(SourceNodeFactory factory) { 58 return new BridgeSource2Element(factory); 59 } 60 61 66 public static SourceNodeFactory createSourceNodeFactory(ExElementNodeFactory factory) { 67 return new BridgeElement2Source(factory); 68 } 69 70 75 public static Format createElementFormat(String pattern) { 76 return new ElementFormat(pattern); 77 } 78 79 } 80 | Popular Tags |