Kernel-Announcements.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. smalltalk.addPackage('Kernel-Announcements');
  2. smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
  3. smalltalk.AnnouncementSubscription.comment="I am a single entry in a subscription registry of an `Announcer`.\x0aSeveral subscriptions by the same object is possible."
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "announcementClass",
  7. category: 'accessing',
  8. fn: function (){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) {
  11. var $1;
  12. $1=self["@announcementClass"];
  13. return $1;
  14. }, function($ctx1) {$ctx1.fill(self,"announcementClass",{},smalltalk.AnnouncementSubscription)})},
  15. args: [],
  16. source: "announcementClass\x0a\x09^ announcementClass",
  17. messageSends: [],
  18. referencedClasses: []
  19. }),
  20. smalltalk.AnnouncementSubscription);
  21. smalltalk.addMethod(
  22. smalltalk.method({
  23. selector: "announcementClass:",
  24. category: 'accessing',
  25. fn: function (aClass){
  26. var self=this;
  27. return smalltalk.withContext(function($ctx1) {
  28. self["@announcementClass"]=aClass;
  29. return self}, function($ctx1) {$ctx1.fill(self,"announcementClass:",{aClass:aClass},smalltalk.AnnouncementSubscription)})},
  30. args: ["aClass"],
  31. source: "announcementClass: aClass\x0a\x09announcementClass := aClass",
  32. messageSends: [],
  33. referencedClasses: []
  34. }),
  35. smalltalk.AnnouncementSubscription);
  36. smalltalk.addMethod(
  37. smalltalk.method({
  38. selector: "block",
  39. category: 'accessing',
  40. fn: function (){
  41. var self=this;
  42. return smalltalk.withContext(function($ctx1) {
  43. var $1;
  44. _st(self)._deprecatedAPI();
  45. $1=_st(self)._valuable();
  46. return $1;
  47. }, function($ctx1) {$ctx1.fill(self,"block",{},smalltalk.AnnouncementSubscription)})},
  48. args: [],
  49. source: "block\x0a\x09\x22Use #valuable instead\x22\x0a\x09\x0a\x09self deprecatedAPI.\x0a\x09^ self valuable",
  50. messageSends: ["deprecatedAPI", "valuable"],
  51. referencedClasses: []
  52. }),
  53. smalltalk.AnnouncementSubscription);
  54. smalltalk.addMethod(
  55. smalltalk.method({
  56. selector: "block:",
  57. category: 'accessing',
  58. fn: function (aValuable){
  59. var self=this;
  60. return smalltalk.withContext(function($ctx1) {
  61. _st(self)._deprecatedAPI();
  62. _st(self)._valuable_(aValuable);
  63. return self}, function($ctx1) {$ctx1.fill(self,"block:",{aValuable:aValuable},smalltalk.AnnouncementSubscription)})},
  64. args: ["aValuable"],
  65. source: "block: aValuable\x0a\x09\x22Use #valuable instead\x22\x0a\x09\x0a\x09self deprecatedAPI.\x0a\x09self valuable: aValuable",
  66. messageSends: ["deprecatedAPI", "valuable:"],
  67. referencedClasses: []
  68. }),
  69. smalltalk.AnnouncementSubscription);
  70. smalltalk.addMethod(
  71. smalltalk.method({
  72. selector: "deliver:",
  73. category: 'announcing',
  74. fn: function (anAnnouncement){
  75. var self=this;
  76. return smalltalk.withContext(function($ctx1) {
  77. var $1;
  78. $1=_st(self)._handlesAnnouncement_(anAnnouncement);
  79. if(smalltalk.assert($1)){
  80. _st(_st(self)._valuable())._value_(anAnnouncement);
  81. };
  82. return self}, function($ctx1) {$ctx1.fill(self,"deliver:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},
  83. args: ["anAnnouncement"],
  84. source: "deliver: anAnnouncement\x0a\x09(self handlesAnnouncement: anAnnouncement)\x0a\x09\x09ifTrue: [self valuable value: anAnnouncement]",
  85. messageSends: ["ifTrue:", "value:", "valuable", "handlesAnnouncement:"],
  86. referencedClasses: []
  87. }),
  88. smalltalk.AnnouncementSubscription);
  89. smalltalk.addMethod(
  90. smalltalk.method({
  91. selector: "handlesAnnouncement:",
  92. category: 'announcing',
  93. fn: function (anAnnouncement){
  94. var self=this;
  95. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  96. return smalltalk.withContext(function($ctx1) {
  97. var $2,$1;
  98. $2=_st(_st($Smalltalk())._current())._at_(_st(_st(self)._announcementClass())._name());
  99. if(($receiver = $2) == nil || $receiver == undefined){
  100. return false;
  101. } else {
  102. var class_;
  103. class_=$receiver;
  104. $1=_st(class_)._includesBehavior_(_st(_st($Smalltalk())._current())._at_(_st(_st(_st(anAnnouncement)._class())._theNonMetaClass())._name()));
  105. };
  106. return $1;
  107. }, function($ctx1) {$ctx1.fill(self,"handlesAnnouncement:",{anAnnouncement:anAnnouncement},smalltalk.AnnouncementSubscription)})},
  108. args: ["anAnnouncement"],
  109. source: "handlesAnnouncement: anAnnouncement\x0a\x09\x22anAnnouncement might be announced from within another Amber environment\x22\x0a\x09\x0a\x09^ (Smalltalk current at: self announcementClass name)\x0a\x09\x09ifNil: [ ^ false ]\x0a\x09\x09ifNotNil: [ :class |\x0a\x09\x09class includesBehavior: (Smalltalk current at: anAnnouncement class theNonMetaClass name) ]",
  110. messageSends: ["ifNil:ifNotNil:", "includesBehavior:", "at:", "name", "theNonMetaClass", "class", "current", "announcementClass"],
  111. referencedClasses: ["Smalltalk"]
  112. }),
  113. smalltalk.AnnouncementSubscription);
  114. smalltalk.addMethod(
  115. smalltalk.method({
  116. selector: "receiver",
  117. category: 'accessing',
  118. fn: function (){
  119. var self=this;
  120. return smalltalk.withContext(function($ctx1) {
  121. var $1;
  122. $1=_st(_st(self)._valuable())._receiver();
  123. return $1;
  124. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.AnnouncementSubscription)})},
  125. args: [],
  126. source: "receiver\x0a\x09^ self valuable receiver",
  127. messageSends: ["receiver", "valuable"],
  128. referencedClasses: []
  129. }),
  130. smalltalk.AnnouncementSubscription);
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "valuable",
  134. category: 'accessing',
  135. fn: function (){
  136. var self=this;
  137. return smalltalk.withContext(function($ctx1) {
  138. var $1;
  139. $1=self["@valuable"];
  140. return $1;
  141. }, function($ctx1) {$ctx1.fill(self,"valuable",{},smalltalk.AnnouncementSubscription)})},
  142. args: [],
  143. source: "valuable\x0a\x09^ valuable",
  144. messageSends: [],
  145. referencedClasses: []
  146. }),
  147. smalltalk.AnnouncementSubscription);
  148. smalltalk.addMethod(
  149. smalltalk.method({
  150. selector: "valuable:",
  151. category: 'accessing',
  152. fn: function (aValuable){
  153. var self=this;
  154. return smalltalk.withContext(function($ctx1) {
  155. self["@valuable"]=aValuable;
  156. return self}, function($ctx1) {$ctx1.fill(self,"valuable:",{aValuable:aValuable},smalltalk.AnnouncementSubscription)})},
  157. args: ["aValuable"],
  158. source: "valuable: aValuable\x0a\x09valuable := aValuable",
  159. messageSends: [],
  160. referencedClasses: []
  161. }),
  162. smalltalk.AnnouncementSubscription);
  163. smalltalk.addClass('Announcer', smalltalk.Object, ['registry', 'subscriptions'], 'Kernel-Announcements');
  164. smalltalk.Announcer.comment="I hold annoncement subscriptions (instances of `AnnouncementSubscription`) in a private registry.\x0aI announce (trigger) announces, which are then dispatched to all subscriptions.\x0a\x0aThe code is based on the announcements as [described by Vassili Bykov](http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework).\x0a\x0a## API\x0a\x0aUse `#announce:` to trigger an announcement.\x0a\x0aUse `#on:do:` or `#on:send:to:` to register subscriptions.\x0a\x0aWhen using `#on:send:to:`, unregistration can be done with `#unregister:`.\x0a\x0a## Usage example:\x0a\x0a SystemAnnouncer current\x0a on: ClassAdded\x0a do: [ :ann | window alert: ann theClass name, ' added' ].\x0a"
  165. smalltalk.addMethod(
  166. smalltalk.method({
  167. selector: "announce:",
  168. category: 'announcing',
  169. fn: function (anAnnouncement){
  170. var self=this;
  171. return smalltalk.withContext(function($ctx1) {
  172. _st(self["@subscriptions"])._do_((function(each){
  173. return smalltalk.withContext(function($ctx2) {
  174. return _st(each)._deliver_(anAnnouncement);
  175. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  176. return self}, function($ctx1) {$ctx1.fill(self,"announce:",{anAnnouncement:anAnnouncement},smalltalk.Announcer)})},
  177. args: ["anAnnouncement"],
  178. source: "announce: anAnnouncement\x0a\x09subscriptions do: [ :each |\x0a\x09\x09each deliver: anAnnouncement ]",
  179. messageSends: ["do:", "deliver:"],
  180. referencedClasses: []
  181. }),
  182. smalltalk.Announcer);
  183. smalltalk.addMethod(
  184. smalltalk.method({
  185. selector: "initialize",
  186. category: 'initialization',
  187. fn: function (){
  188. var self=this;
  189. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  190. return smalltalk.withContext(function($ctx1) {
  191. smalltalk.Object.fn.prototype._initialize.apply(_st(self), []);
  192. self["@subscriptions"]=_st($OrderedCollection())._new();
  193. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Announcer)})},
  194. args: [],
  195. source: "initialize\x0a\x09super initialize.\x0a\x09subscriptions := OrderedCollection new",
  196. messageSends: ["initialize", "new"],
  197. referencedClasses: ["OrderedCollection"]
  198. }),
  199. smalltalk.Announcer);
  200. smalltalk.addMethod(
  201. smalltalk.method({
  202. selector: "on:do:",
  203. category: 'subscribing',
  204. fn: function (aClass,aBlock){
  205. var self=this;
  206. function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
  207. return smalltalk.withContext(function($ctx1) {
  208. var $1,$2;
  209. $1=_st($AnnouncementSubscription())._new();
  210. _st($1)._valuable_(aBlock);
  211. _st($1)._announcementClass_(aClass);
  212. $2=_st($1)._yourself();
  213. _st(self["@subscriptions"])._add_($2);
  214. return self}, function($ctx1) {$ctx1.fill(self,"on:do:",{aClass:aClass,aBlock:aBlock},smalltalk.Announcer)})},
  215. args: ["aClass", "aBlock"],
  216. source: "on: aClass do: aBlock\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09valuable: aBlock;\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
  217. messageSends: ["add:", "valuable:", "new", "announcementClass:", "yourself"],
  218. referencedClasses: ["AnnouncementSubscription"]
  219. }),
  220. smalltalk.Announcer);
  221. smalltalk.addMethod(
  222. smalltalk.method({
  223. selector: "on:send:to:",
  224. category: 'subscribing',
  225. fn: function (aClass,aSelector,anObject){
  226. var self=this;
  227. function $MessageSend(){return smalltalk.MessageSend||(typeof MessageSend=="undefined"?nil:MessageSend)}
  228. function $AnnouncementSubscription(){return smalltalk.AnnouncementSubscription||(typeof AnnouncementSubscription=="undefined"?nil:AnnouncementSubscription)}
  229. return smalltalk.withContext(function($ctx1) {
  230. var $1,$2,$3,$4;
  231. $1=_st($AnnouncementSubscription())._new();
  232. $2=_st($MessageSend())._new();
  233. _st($2)._receiver_(anObject);
  234. _st($2)._selector_(aSelector);
  235. $3=_st($2)._yourself();
  236. _st($1)._valuable_($3);
  237. _st($1)._announcementClass_(aClass);
  238. $4=_st($1)._yourself();
  239. _st(self["@subscriptions"])._add_($4);
  240. return self}, function($ctx1) {$ctx1.fill(self,"on:send:to:",{aClass:aClass,aSelector:aSelector,anObject:anObject},smalltalk.Announcer)})},
  241. args: ["aClass", "aSelector", "anObject"],
  242. source: "on: aClass send: aSelector to: anObject\x0a\x09subscriptions add: (AnnouncementSubscription new\x0a\x09\x09valuable: (MessageSend new\x0a\x09\x09\x09receiver: anObject;\x0a\x09\x09\x09selector: aSelector;\x0a\x09\x09\x09yourself);\x0a\x09\x09announcementClass: aClass;\x0a\x09\x09yourself)",
  243. messageSends: ["add:", "valuable:", "receiver:", "new", "selector:", "yourself", "announcementClass:"],
  244. referencedClasses: ["MessageSend", "AnnouncementSubscription"]
  245. }),
  246. smalltalk.Announcer);
  247. smalltalk.addMethod(
  248. smalltalk.method({
  249. selector: "unsubscribe:",
  250. category: 'subscribing',
  251. fn: function (anObject){
  252. var self=this;
  253. return smalltalk.withContext(function($ctx1) {
  254. self["@subscriptions"]=_st(self["@subscriptions"])._reject_((function(each){
  255. return smalltalk.withContext(function($ctx2) {
  256. return _st(_st(each)._receiver()).__eq(anObject);
  257. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  258. return self}, function($ctx1) {$ctx1.fill(self,"unsubscribe:",{anObject:anObject},smalltalk.Announcer)})},
  259. args: ["anObject"],
  260. source: "unsubscribe: anObject\x0a\x09subscriptions := subscriptions reject: [ :each |\x0a\x09\x09each receiver = anObject ]",
  261. messageSends: ["reject:", "=", "receiver"],
  262. referencedClasses: []
  263. }),
  264. smalltalk.Announcer);
  265. smalltalk.addClass('SystemAnnouncer', smalltalk.Announcer, [], 'Kernel-Announcements');
  266. smalltalk.SystemAnnouncer.comment="My unique instance is the global announcer handling all Amber system-related announces.\x0a\x0a## API\x0a\x0aAccess to the unique instance is done via `#current`"
  267. smalltalk.SystemAnnouncer.klass.iVarNames = ['current'];
  268. smalltalk.addMethod(
  269. smalltalk.method({
  270. selector: "current",
  271. category: 'accessing',
  272. fn: function (){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) {
  275. var $2,$1;
  276. $2=self["@current"];
  277. if(($receiver = $2) == nil || $receiver == undefined){
  278. self["@current"]=smalltalk.Announcer.klass.fn.prototype._new.apply(_st(self), []);
  279. $1=self["@current"];
  280. } else {
  281. $1=$2;
  282. };
  283. return $1;
  284. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.SystemAnnouncer.klass)})},
  285. args: [],
  286. source: "current\x0a\x09^ current ifNil: [ current := super new ]",
  287. messageSends: ["ifNil:", "new"],
  288. referencedClasses: []
  289. }),
  290. smalltalk.SystemAnnouncer.klass);
  291. smalltalk.addMethod(
  292. smalltalk.method({
  293. selector: "new",
  294. category: 'instance creation',
  295. fn: function (){
  296. var self=this;
  297. return smalltalk.withContext(function($ctx1) {
  298. _st(self)._shouldNotImplement();
  299. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.SystemAnnouncer.klass)})},
  300. args: [],
  301. source: "new\x0a\x09self shouldNotImplement",
  302. messageSends: ["shouldNotImplement"],
  303. referencedClasses: []
  304. }),
  305. smalltalk.SystemAnnouncer.klass);
  306. smalltalk.addClass('SystemAnnouncement', smalltalk.Object, ['theClass'], 'Kernel-Announcements');
  307. smalltalk.SystemAnnouncement.comment="I am the superclass of all system announcements"
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "theClass",
  311. category: 'accessing',
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) {
  315. var $1;
  316. $1=self["@theClass"];
  317. return $1;
  318. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.SystemAnnouncement)})},
  319. args: [],
  320. source: "theClass\x0a\x09^ theClass",
  321. messageSends: [],
  322. referencedClasses: []
  323. }),
  324. smalltalk.SystemAnnouncement);
  325. smalltalk.addMethod(
  326. smalltalk.method({
  327. selector: "theClass:",
  328. category: 'accessing',
  329. fn: function (aClass){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx1) {
  332. self["@theClass"]=aClass;
  333. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.SystemAnnouncement)})},
  334. args: ["aClass"],
  335. source: "theClass: aClass\x0a\x09theClass := aClass",
  336. messageSends: [],
  337. referencedClasses: []
  338. }),
  339. smalltalk.SystemAnnouncement);
  340. smalltalk.addClass('ClassAnnouncement', smalltalk.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
  341. smalltalk.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements."
  342. smalltalk.addMethod(
  343. smalltalk.method({
  344. selector: "theClass",
  345. category: 'accessing',
  346. fn: function (){
  347. var self=this;
  348. return smalltalk.withContext(function($ctx1) {
  349. var $1;
  350. $1=self["@theClass"];
  351. return $1;
  352. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassAnnouncement)})},
  353. args: [],
  354. source: "theClass\x0a\x09^ theClass",
  355. messageSends: [],
  356. referencedClasses: []
  357. }),
  358. smalltalk.ClassAnnouncement);
  359. smalltalk.addMethod(
  360. smalltalk.method({
  361. selector: "theClass:",
  362. category: 'accessing',
  363. fn: function (aClass){
  364. var self=this;
  365. return smalltalk.withContext(function($ctx1) {
  366. self["@theClass"]=aClass;
  367. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassAnnouncement)})},
  368. args: ["aClass"],
  369. source: "theClass: aClass\x0a\x09theClass := aClass",
  370. messageSends: [],
  371. referencedClasses: []
  372. }),
  373. smalltalk.ClassAnnouncement);
  374. smalltalk.addClass('ClassAdded', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  375. smalltalk.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods"
  376. smalltalk.addClass('ClassCommentChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  377. smalltalk.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)"
  378. smalltalk.addClass('ClassDefinitionChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  379. smalltalk.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:"
  380. smalltalk.addClass('ClassMigrated', smalltalk.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
  381. smalltalk.ClassMigrated.comment="I am emitted when a class is migrated."
  382. smalltalk.addMethod(
  383. smalltalk.method({
  384. selector: "oldClass",
  385. category: 'accessing',
  386. fn: function (){
  387. var self=this;
  388. return smalltalk.withContext(function($ctx1) {
  389. var $1;
  390. $1=self["@oldClass"];
  391. return $1;
  392. }, function($ctx1) {$ctx1.fill(self,"oldClass",{},smalltalk.ClassMigrated)})},
  393. args: [],
  394. source: "oldClass\x0a\x09^ oldClass",
  395. messageSends: [],
  396. referencedClasses: []
  397. }),
  398. smalltalk.ClassMigrated);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "oldClass:",
  402. category: 'accessing',
  403. fn: function (aClass){
  404. var self=this;
  405. return smalltalk.withContext(function($ctx1) {
  406. self["@oldClass"]=aClass;
  407. return self}, function($ctx1) {$ctx1.fill(self,"oldClass:",{aClass:aClass},smalltalk.ClassMigrated)})},
  408. args: ["aClass"],
  409. source: "oldClass: aClass\x0a\x09oldClass := aClass",
  410. messageSends: [],
  411. referencedClasses: []
  412. }),
  413. smalltalk.ClassMigrated);
  414. smalltalk.addClass('ClassMoved', smalltalk.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
  415. smalltalk.ClassMoved.comment="I am emitted when a class is moved from one package to another."
  416. smalltalk.addMethod(
  417. smalltalk.method({
  418. selector: "oldPackage",
  419. category: 'accessing',
  420. fn: function (){
  421. var self=this;
  422. return smalltalk.withContext(function($ctx1) {
  423. var $1;
  424. $1=self["@oldPackage"];
  425. return $1;
  426. }, function($ctx1) {$ctx1.fill(self,"oldPackage",{},smalltalk.ClassMoved)})},
  427. args: [],
  428. source: "oldPackage\x0a\x09^ oldPackage",
  429. messageSends: [],
  430. referencedClasses: []
  431. }),
  432. smalltalk.ClassMoved);
  433. smalltalk.addMethod(
  434. smalltalk.method({
  435. selector: "oldPackage:",
  436. category: 'accessing',
  437. fn: function (aPackage){
  438. var self=this;
  439. return smalltalk.withContext(function($ctx1) {
  440. self["@oldPackage"]=aPackage;
  441. return self}, function($ctx1) {$ctx1.fill(self,"oldPackage:",{aPackage:aPackage},smalltalk.ClassMoved)})},
  442. args: ["aPackage"],
  443. source: "oldPackage: aPackage\x0a\x09oldPackage := aPackage",
  444. messageSends: [],
  445. referencedClasses: []
  446. }),
  447. smalltalk.ClassMoved);
  448. smalltalk.addClass('ClassRemoved', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  449. smalltalk.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:"
  450. smalltalk.addClass('ClassRenamed', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  451. smalltalk.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:"
  452. smalltalk.addClass('MethodAnnouncement', smalltalk.SystemAnnouncement, ['method'], 'Kernel-Announcements');
  453. smalltalk.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements."
  454. smalltalk.addMethod(
  455. smalltalk.method({
  456. selector: "method",
  457. category: 'accessing',
  458. fn: function (){
  459. var self=this;
  460. return smalltalk.withContext(function($ctx1) {
  461. var $1;
  462. $1=self["@method"];
  463. return $1;
  464. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodAnnouncement)})},
  465. args: [],
  466. source: "method\x0a\x09^ method",
  467. messageSends: [],
  468. referencedClasses: []
  469. }),
  470. smalltalk.MethodAnnouncement);
  471. smalltalk.addMethod(
  472. smalltalk.method({
  473. selector: "method:",
  474. category: 'accessing',
  475. fn: function (aCompiledMethod){
  476. var self=this;
  477. return smalltalk.withContext(function($ctx1) {
  478. self["@method"]=aCompiledMethod;
  479. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.MethodAnnouncement)})},
  480. args: ["aCompiledMethod"],
  481. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  482. messageSends: [],
  483. referencedClasses: []
  484. }),
  485. smalltalk.MethodAnnouncement);
  486. smalltalk.addClass('MethodAdded', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  487. smalltalk.addClass('MethodModified', smalltalk.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
  488. smalltalk.addMethod(
  489. smalltalk.method({
  490. selector: "oldMethod",
  491. category: 'accessing',
  492. fn: function (){
  493. var self=this;
  494. return smalltalk.withContext(function($ctx1) {
  495. var $1;
  496. $1=self["@oldMethod"];
  497. return $1;
  498. }, function($ctx1) {$ctx1.fill(self,"oldMethod",{},smalltalk.MethodModified)})},
  499. args: [],
  500. source: "oldMethod\x0a\x09^ oldMethod",
  501. messageSends: [],
  502. referencedClasses: []
  503. }),
  504. smalltalk.MethodModified);
  505. smalltalk.addMethod(
  506. smalltalk.method({
  507. selector: "oldMethod:",
  508. category: 'accessing',
  509. fn: function (aMethod){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) {
  512. self["@oldMethod"]=aMethod;
  513. return self}, function($ctx1) {$ctx1.fill(self,"oldMethod:",{aMethod:aMethod},smalltalk.MethodModified)})},
  514. args: ["aMethod"],
  515. source: "oldMethod: aMethod\x0a\x09oldMethod := aMethod",
  516. messageSends: [],
  517. referencedClasses: []
  518. }),
  519. smalltalk.MethodModified);
  520. smalltalk.addClass('MethodMoved', smalltalk.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
  521. smalltalk.addMethod(
  522. smalltalk.method({
  523. selector: "oldProtocol",
  524. category: 'accessing',
  525. fn: function (){
  526. var self=this;
  527. return smalltalk.withContext(function($ctx1) {
  528. var $1;
  529. $1=self["@oldProtocol"];
  530. return $1;
  531. }, function($ctx1) {$ctx1.fill(self,"oldProtocol",{},smalltalk.MethodMoved)})},
  532. args: [],
  533. source: "oldProtocol\x0a\x09^ oldProtocol",
  534. messageSends: [],
  535. referencedClasses: []
  536. }),
  537. smalltalk.MethodMoved);
  538. smalltalk.addMethod(
  539. smalltalk.method({
  540. selector: "oldProtocol:",
  541. category: 'accessing',
  542. fn: function (aString){
  543. var self=this;
  544. return smalltalk.withContext(function($ctx1) {
  545. self["@oldProtocol"]=aString;
  546. return self}, function($ctx1) {$ctx1.fill(self,"oldProtocol:",{aString:aString},smalltalk.MethodMoved)})},
  547. args: ["aString"],
  548. source: "oldProtocol: aString\x0a\x09oldProtocol := aString",
  549. messageSends: [],
  550. referencedClasses: []
  551. }),
  552. smalltalk.MethodMoved);
  553. smalltalk.addClass('MethodRemoved', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  554. smalltalk.addClass('PackageAnnouncement', smalltalk.SystemAnnouncement, ['package'], 'Kernel-Announcements');
  555. smalltalk.addMethod(
  556. smalltalk.method({
  557. selector: "package",
  558. category: 'accessing',
  559. fn: function (){
  560. var self=this;
  561. return smalltalk.withContext(function($ctx1) {
  562. var $1;
  563. $1=self["@package"];
  564. return $1;
  565. }, function($ctx1) {$ctx1.fill(self,"package",{},smalltalk.PackageAnnouncement)})},
  566. args: [],
  567. source: "package\x0a\x09^ package",
  568. messageSends: [],
  569. referencedClasses: []
  570. }),
  571. smalltalk.PackageAnnouncement);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "package:",
  575. category: 'accessing',
  576. fn: function (aPackage){
  577. var self=this;
  578. return smalltalk.withContext(function($ctx1) {
  579. self["@package"]=aPackage;
  580. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage},smalltalk.PackageAnnouncement)})},
  581. args: ["aPackage"],
  582. source: "package: aPackage\x0a\x09package := aPackage",
  583. messageSends: [],
  584. referencedClasses: []
  585. }),
  586. smalltalk.PackageAnnouncement);
  587. smalltalk.addClass('PackageAdded', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  588. smalltalk.addClass('PackageRemoved', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  589. smalltalk.addClass('ProtocolAnnouncement', smalltalk.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
  590. smalltalk.addMethod(
  591. smalltalk.method({
  592. selector: "protocol",
  593. category: 'accessing',
  594. fn: function (){
  595. var self=this;
  596. return smalltalk.withContext(function($ctx1) {
  597. var $1;
  598. $1=self["@protocol"];
  599. return $1;
  600. }, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.ProtocolAnnouncement)})},
  601. args: [],
  602. source: "protocol\x0a\x09^ protocol",
  603. messageSends: [],
  604. referencedClasses: []
  605. }),
  606. smalltalk.ProtocolAnnouncement);
  607. smalltalk.addMethod(
  608. smalltalk.method({
  609. selector: "protocol:",
  610. category: 'accessing',
  611. fn: function (aString){
  612. var self=this;
  613. return smalltalk.withContext(function($ctx1) {
  614. self["@protocol"]=aString;
  615. return self}, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString},smalltalk.ProtocolAnnouncement)})},
  616. args: ["aString"],
  617. source: "protocol: aString\x0a\x09protocol := aString",
  618. messageSends: [],
  619. referencedClasses: []
  620. }),
  621. smalltalk.ProtocolAnnouncement);
  622. smalltalk.addMethod(
  623. smalltalk.method({
  624. selector: "theClass",
  625. category: 'accessing',
  626. fn: function (){
  627. var self=this;
  628. return smalltalk.withContext(function($ctx1) {
  629. var $1;
  630. $1=self["@theClass"];
  631. return $1;
  632. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ProtocolAnnouncement)})},
  633. args: [],
  634. source: "theClass\x0a\x09^ theClass",
  635. messageSends: [],
  636. referencedClasses: []
  637. }),
  638. smalltalk.ProtocolAnnouncement);
  639. smalltalk.addMethod(
  640. smalltalk.method({
  641. selector: "theClass:",
  642. category: 'accessing',
  643. fn: function (aClass){
  644. var self=this;
  645. return smalltalk.withContext(function($ctx1) {
  646. self["@theClass"]=aClass;
  647. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ProtocolAnnouncement)})},
  648. args: ["aClass"],
  649. source: "theClass: aClass\x0a\x09theClass := aClass",
  650. messageSends: [],
  651. referencedClasses: []
  652. }),
  653. smalltalk.ProtocolAnnouncement);
  654. smalltalk.addClass('ProtocolAdded', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
  655. smalltalk.addClass('ProtocolRemoved', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');