2
0

Kernel-Announcements.js 27 KB

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