Kernel-Announcements.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  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.addMethod(
  341. smalltalk.method({
  342. selector: "heliosClass",
  343. category: 'helios',
  344. fn: function (){
  345. var self=this;
  346. return smalltalk.withContext(function($ctx1) {
  347. return "announcement";
  348. }, function($ctx1) {$ctx1.fill(self,"heliosClass",{},smalltalk.SystemAnnouncement.klass)})},
  349. args: [],
  350. source: "heliosClass\x0a\x09^ 'announcement'",
  351. messageSends: [],
  352. referencedClasses: []
  353. }),
  354. smalltalk.SystemAnnouncement.klass);
  355. smalltalk.addClass('ClassAnnouncement', smalltalk.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
  356. smalltalk.ClassAnnouncement.comment="I am the abstract superclass of class-related announcements."
  357. smalltalk.addMethod(
  358. smalltalk.method({
  359. selector: "theClass",
  360. category: 'accessing',
  361. fn: function (){
  362. var self=this;
  363. return smalltalk.withContext(function($ctx1) {
  364. var $1;
  365. $1=self["@theClass"];
  366. return $1;
  367. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassAnnouncement)})},
  368. args: [],
  369. source: "theClass\x0a\x09^ theClass",
  370. messageSends: [],
  371. referencedClasses: []
  372. }),
  373. smalltalk.ClassAnnouncement);
  374. smalltalk.addMethod(
  375. smalltalk.method({
  376. selector: "theClass:",
  377. category: 'accessing',
  378. fn: function (aClass){
  379. var self=this;
  380. return smalltalk.withContext(function($ctx1) {
  381. self["@theClass"]=aClass;
  382. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassAnnouncement)})},
  383. args: ["aClass"],
  384. source: "theClass: aClass\x0a\x09theClass := aClass",
  385. messageSends: [],
  386. referencedClasses: []
  387. }),
  388. smalltalk.ClassAnnouncement);
  389. smalltalk.addClass('ClassAdded', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  390. smalltalk.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods"
  391. smalltalk.addClass('ClassCommentChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  392. smalltalk.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)"
  393. smalltalk.addClass('ClassDefinitionChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  394. smalltalk.ClassDefinitionChanged.comment="I am emitted when the definition of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:"
  395. smalltalk.addClass('ClassMigrated', smalltalk.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
  396. smalltalk.ClassMigrated.comment="I am emitted when a class is migrated."
  397. smalltalk.addMethod(
  398. smalltalk.method({
  399. selector: "oldClass",
  400. category: 'accessing',
  401. fn: function (){
  402. var self=this;
  403. return smalltalk.withContext(function($ctx1) {
  404. var $1;
  405. $1=self["@oldClass"];
  406. return $1;
  407. }, function($ctx1) {$ctx1.fill(self,"oldClass",{},smalltalk.ClassMigrated)})},
  408. args: [],
  409. source: "oldClass\x0a\x09^ oldClass",
  410. messageSends: [],
  411. referencedClasses: []
  412. }),
  413. smalltalk.ClassMigrated);
  414. smalltalk.addMethod(
  415. smalltalk.method({
  416. selector: "oldClass:",
  417. category: 'accessing',
  418. fn: function (aClass){
  419. var self=this;
  420. return smalltalk.withContext(function($ctx1) {
  421. self["@oldClass"]=aClass;
  422. return self}, function($ctx1) {$ctx1.fill(self,"oldClass:",{aClass:aClass},smalltalk.ClassMigrated)})},
  423. args: ["aClass"],
  424. source: "oldClass: aClass\x0a\x09oldClass := aClass",
  425. messageSends: [],
  426. referencedClasses: []
  427. }),
  428. smalltalk.ClassMigrated);
  429. smalltalk.addClass('ClassMoved', smalltalk.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
  430. smalltalk.ClassMoved.comment="I am emitted when a class is moved from one package to another."
  431. smalltalk.addMethod(
  432. smalltalk.method({
  433. selector: "oldPackage",
  434. category: 'accessing',
  435. fn: function (){
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) {
  438. var $1;
  439. $1=self["@oldPackage"];
  440. return $1;
  441. }, function($ctx1) {$ctx1.fill(self,"oldPackage",{},smalltalk.ClassMoved)})},
  442. args: [],
  443. source: "oldPackage\x0a\x09^ oldPackage",
  444. messageSends: [],
  445. referencedClasses: []
  446. }),
  447. smalltalk.ClassMoved);
  448. smalltalk.addMethod(
  449. smalltalk.method({
  450. selector: "oldPackage:",
  451. category: 'accessing',
  452. fn: function (aPackage){
  453. var self=this;
  454. return smalltalk.withContext(function($ctx1) {
  455. self["@oldPackage"]=aPackage;
  456. return self}, function($ctx1) {$ctx1.fill(self,"oldPackage:",{aPackage:aPackage},smalltalk.ClassMoved)})},
  457. args: ["aPackage"],
  458. source: "oldPackage: aPackage\x0a\x09oldPackage := aPackage",
  459. messageSends: [],
  460. referencedClasses: []
  461. }),
  462. smalltalk.ClassMoved);
  463. smalltalk.addClass('ClassRemoved', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  464. smalltalk.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:"
  465. smalltalk.addClass('ClassRenamed', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  466. smalltalk.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:"
  467. smalltalk.addClass('MethodAnnouncement', smalltalk.SystemAnnouncement, ['method'], 'Kernel-Announcements');
  468. smalltalk.MethodAnnouncement.comment="I am the abstract superclass of method-related announcements."
  469. smalltalk.addMethod(
  470. smalltalk.method({
  471. selector: "method",
  472. category: 'accessing',
  473. fn: function (){
  474. var self=this;
  475. return smalltalk.withContext(function($ctx1) {
  476. var $1;
  477. $1=self["@method"];
  478. return $1;
  479. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodAnnouncement)})},
  480. args: [],
  481. source: "method\x0a\x09^ method",
  482. messageSends: [],
  483. referencedClasses: []
  484. }),
  485. smalltalk.MethodAnnouncement);
  486. smalltalk.addMethod(
  487. smalltalk.method({
  488. selector: "method:",
  489. category: 'accessing',
  490. fn: function (aCompiledMethod){
  491. var self=this;
  492. return smalltalk.withContext(function($ctx1) {
  493. self["@method"]=aCompiledMethod;
  494. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.MethodAnnouncement)})},
  495. args: ["aCompiledMethod"],
  496. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  497. messageSends: [],
  498. referencedClasses: []
  499. }),
  500. smalltalk.MethodAnnouncement);
  501. smalltalk.addClass('MethodAdded', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  502. smalltalk.MethodAdded.comment="I am emitted when a `CompiledMethod` is added to a class."
  503. smalltalk.addClass('MethodModified', smalltalk.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
  504. 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."
  505. smalltalk.addMethod(
  506. smalltalk.method({
  507. selector: "oldMethod",
  508. category: 'accessing',
  509. fn: function (){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) {
  512. var $1;
  513. $1=self["@oldMethod"];
  514. return $1;
  515. }, function($ctx1) {$ctx1.fill(self,"oldMethod",{},smalltalk.MethodModified)})},
  516. args: [],
  517. source: "oldMethod\x0a\x09^ oldMethod",
  518. messageSends: [],
  519. referencedClasses: []
  520. }),
  521. smalltalk.MethodModified);
  522. smalltalk.addMethod(
  523. smalltalk.method({
  524. selector: "oldMethod:",
  525. category: 'accessing',
  526. fn: function (aMethod){
  527. var self=this;
  528. return smalltalk.withContext(function($ctx1) {
  529. self["@oldMethod"]=aMethod;
  530. return self}, function($ctx1) {$ctx1.fill(self,"oldMethod:",{aMethod:aMethod},smalltalk.MethodModified)})},
  531. args: ["aMethod"],
  532. source: "oldMethod: aMethod\x0a\x09oldMethod := aMethod",
  533. messageSends: [],
  534. referencedClasses: []
  535. }),
  536. smalltalk.MethodModified);
  537. smalltalk.addClass('MethodMoved', smalltalk.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
  538. 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."
  539. smalltalk.addMethod(
  540. smalltalk.method({
  541. selector: "oldProtocol",
  542. category: 'accessing',
  543. fn: function (){
  544. var self=this;
  545. return smalltalk.withContext(function($ctx1) {
  546. var $1;
  547. $1=self["@oldProtocol"];
  548. return $1;
  549. }, function($ctx1) {$ctx1.fill(self,"oldProtocol",{},smalltalk.MethodMoved)})},
  550. args: [],
  551. source: "oldProtocol\x0a\x09^ oldProtocol",
  552. messageSends: [],
  553. referencedClasses: []
  554. }),
  555. smalltalk.MethodMoved);
  556. smalltalk.addMethod(
  557. smalltalk.method({
  558. selector: "oldProtocol:",
  559. category: 'accessing',
  560. fn: function (aString){
  561. var self=this;
  562. return smalltalk.withContext(function($ctx1) {
  563. self["@oldProtocol"]=aString;
  564. return self}, function($ctx1) {$ctx1.fill(self,"oldProtocol:",{aString:aString},smalltalk.MethodMoved)})},
  565. args: ["aString"],
  566. source: "oldProtocol: aString\x0a\x09oldProtocol := aString",
  567. messageSends: [],
  568. referencedClasses: []
  569. }),
  570. smalltalk.MethodMoved);
  571. smalltalk.addClass('MethodRemoved', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  572. smalltalk.MethodRemoved.comment="I am emitted when a `CompiledMethod` is removed from a class."
  573. smalltalk.addClass('PackageAnnouncement', smalltalk.SystemAnnouncement, ['package'], 'Kernel-Announcements');
  574. smalltalk.PackageAnnouncement.comment="I am the abstract superclass of package-related announcements."
  575. smalltalk.addMethod(
  576. smalltalk.method({
  577. selector: "package",
  578. category: 'accessing',
  579. fn: function (){
  580. var self=this;
  581. return smalltalk.withContext(function($ctx1) {
  582. var $1;
  583. $1=self["@package"];
  584. return $1;
  585. }, function($ctx1) {$ctx1.fill(self,"package",{},smalltalk.PackageAnnouncement)})},
  586. args: [],
  587. source: "package\x0a\x09^ package",
  588. messageSends: [],
  589. referencedClasses: []
  590. }),
  591. smalltalk.PackageAnnouncement);
  592. smalltalk.addMethod(
  593. smalltalk.method({
  594. selector: "package:",
  595. category: 'accessing',
  596. fn: function (aPackage){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) {
  599. self["@package"]=aPackage;
  600. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage},smalltalk.PackageAnnouncement)})},
  601. args: ["aPackage"],
  602. source: "package: aPackage\x0a\x09package := aPackage",
  603. messageSends: [],
  604. referencedClasses: []
  605. }),
  606. smalltalk.PackageAnnouncement);
  607. smalltalk.addClass('PackageAdded', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  608. smalltalk.PackageAdded.comment="I am emitted when a `Package` is added to the system."
  609. smalltalk.addClass('PackageRemoved', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  610. smalltalk.PackageRemoved.comment="I am emitted when a `Package` is removed from the system."
  611. smalltalk.addClass('ProtocolAnnouncement', smalltalk.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
  612. smalltalk.ProtocolAnnouncement.comment="I am the abstract superclass of protocol-related announcements."
  613. smalltalk.addMethod(
  614. smalltalk.method({
  615. selector: "protocol",
  616. category: 'accessing',
  617. fn: function (){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) {
  620. var $1;
  621. $1=self["@protocol"];
  622. return $1;
  623. }, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.ProtocolAnnouncement)})},
  624. args: [],
  625. source: "protocol\x0a\x09^ protocol",
  626. messageSends: [],
  627. referencedClasses: []
  628. }),
  629. smalltalk.ProtocolAnnouncement);
  630. smalltalk.addMethod(
  631. smalltalk.method({
  632. selector: "protocol:",
  633. category: 'accessing',
  634. fn: function (aString){
  635. var self=this;
  636. return smalltalk.withContext(function($ctx1) {
  637. self["@protocol"]=aString;
  638. return self}, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString},smalltalk.ProtocolAnnouncement)})},
  639. args: ["aString"],
  640. source: "protocol: aString\x0a\x09protocol := aString",
  641. messageSends: [],
  642. referencedClasses: []
  643. }),
  644. smalltalk.ProtocolAnnouncement);
  645. smalltalk.addMethod(
  646. smalltalk.method({
  647. selector: "theClass",
  648. category: 'accessing',
  649. fn: function (){
  650. var self=this;
  651. return smalltalk.withContext(function($ctx1) {
  652. var $1;
  653. $1=self["@theClass"];
  654. return $1;
  655. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ProtocolAnnouncement)})},
  656. args: [],
  657. source: "theClass\x0a\x09^ theClass",
  658. messageSends: [],
  659. referencedClasses: []
  660. }),
  661. smalltalk.ProtocolAnnouncement);
  662. smalltalk.addMethod(
  663. smalltalk.method({
  664. selector: "theClass:",
  665. category: 'accessing',
  666. fn: function (aClass){
  667. var self=this;
  668. return smalltalk.withContext(function($ctx1) {
  669. self["@theClass"]=aClass;
  670. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ProtocolAnnouncement)})},
  671. args: ["aClass"],
  672. source: "theClass: aClass\x0a\x09theClass := aClass",
  673. messageSends: [],
  674. referencedClasses: []
  675. }),
  676. smalltalk.ProtocolAnnouncement);
  677. smalltalk.addClass('ProtocolAdded', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
  678. smalltalk.ProtocolAdded.comment="I am emitted when a protocol is added to a class."
  679. smalltalk.addClass('ProtocolRemoved', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
  680. smalltalk.ProtocolRemoved.comment="I am emitted when a protocol is removed from a class."