1 19 20 package org.netbeans.modules.openide.explorer; 21 22 import java.util.Map ; 23 import java.util.WeakHashMap ; 24 25 26 64 public class TTVEnvBridge { 65 private static Map <Object , TTVEnvBridge> bridges = new WeakHashMap <Object , TTVEnvBridge>(); 66 Object [] beans = null; 67 68 private TTVEnvBridge() { 69 } 70 71 public static TTVEnvBridge getInstance(Object identifier) { 72 TTVEnvBridge result = bridges.get(identifier); 73 if (result == null) { 74 result = new TTVEnvBridge(); 75 bridges.put (identifier, result); 76 } 77 return result; 78 } 79 80 public static TTVEnvBridge findInstance(Object identifier) { 81 return bridges.get(identifier); 82 } 83 84 public void setCurrentBeans (Object [] o) { 85 beans = o; 86 } 87 88 public void clear() { 89 beans = null; 90 } 91 92 public Object [] getCurrentBeans() { 93 if (beans == null) { 94 return new Object [0]; 95 } else { 96 return beans; 97 } 98 } 99 } 100 | Popular Tags |