2
0

Kernel-Announcements.js 26 KB

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