d9b2291f9689c4aae0985741667472ff143bcec5.svn-base 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.Action = function(A) {
  7. this.initialConfig = A;
  8. this.items = []
  9. };
  10. Ext.Action.prototype = {
  11. isAction : true,
  12. setText : function(A) {
  13. this.initialConfig.text = A;
  14. this.callEach("setText", [A])
  15. },
  16. getText : function() {
  17. return this.initialConfig.text
  18. },
  19. setIconClass : function(A) {
  20. this.initialConfig.iconCls = A;
  21. this.callEach("setIconClass", [A])
  22. },
  23. getIconClass : function() {
  24. return this.initialConfig.iconCls
  25. },
  26. setDisabled : function(A) {
  27. this.initialConfig.disabled = A;
  28. this.callEach("setDisabled", [A])
  29. },
  30. enable : function() {
  31. this.setDisabled(false)
  32. },
  33. disable : function() {
  34. this.setDisabled(true)
  35. },
  36. isDisabled : function() {
  37. return this.initialConfig.disabled
  38. },
  39. setHidden : function(A) {
  40. this.initialConfig.hidden = A;
  41. this.callEach("setVisible", [!A])
  42. },
  43. show : function() {
  44. this.setHidden(false)
  45. },
  46. hide : function() {
  47. this.setHidden(true)
  48. },
  49. isHidden : function() {
  50. return this.initialConfig.hidden
  51. },
  52. setHandler : function(B, A) {
  53. this.initialConfig.handler = B;
  54. this.initialConfig.scope = A;
  55. this.callEach("setHandler", [B, A])
  56. },
  57. each : function(B, A) {
  58. Ext.each(this.items, B, A)
  59. },
  60. callEach : function(E, B) {
  61. var D = this.items;
  62. for (var C = 0, A = D.length; C < A; C++) {
  63. D[C][E].apply(D[C], B)
  64. }
  65. },
  66. addComponent : function(A) {
  67. this.items.push(A);
  68. A.on("destroy", this.removeComponent, this)
  69. },
  70. removeComponent : function(A) {
  71. this.items.remove(A)
  72. }
  73. };