466ad75fefb60fbb9afe9438bb5ddd31628916aa.svn-base 708 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Ext JS Library 2.0 Copyright(c) 2006-2007, Ext JS, LLC. licensing@extjs.com
  3. *
  4. * http://extjs.com/license
  5. */
  6. Ext.ComponentMgr = function() {
  7. var B = new Ext.util.MixedCollection();
  8. var A = {};
  9. return {
  10. register : function(C) {
  11. B.add(C)
  12. },
  13. unregister : function(C) {
  14. B.remove(C)
  15. },
  16. get : function(C) {
  17. return B.get(C)
  18. },
  19. onAvailable : function(E, D, C) {
  20. B.on("add", function(F, G) {
  21. if (G.id == E) {
  22. D.call(C || G, G);
  23. B.un("add", D, C)
  24. }
  25. })
  26. },
  27. all : B,
  28. registerType : function(D, C) {
  29. A[D] = C;
  30. C.xtype = D
  31. },
  32. create : function(C, D) {
  33. return new A[C.xtype || D](C)
  34. }
  35. }
  36. }();
  37. Ext.reg = Ext.ComponentMgr.registerType;