Kernel-Announcements.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. smalltalk.addPackage('Kernel-Announcements');
  2. smalltalk.addClass('AnnouncementSubscription', smalltalk.Object, ['valuable', 'announcementClass'], 'Kernel-Announcements');
  3. smalltalk.AnnouncementSubscription.comment="The subscription is 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="The code is based on the announcements as [described by Vassili Bykov](http://www.cincomsmalltalk.com/userblogs/vbykov/blogView?searchCategory=Announcements%20Framework).\x0aThe Announcer holds annoncement subscriptions (`AnnouncementSubscription`) in a private registry.\x0a\x0aUse `#on:do:` to register subscriptions."
  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 #current is the global announcer handling all Amber system-related announces"
  267. smalltalk.SystemAnnouncer.klass.iVarNames = ['current'];
  268. smalltalk.addMethod(
  269. smalltalk.method({
  270. selector: "current",
  271. category: 'accessing',
  272. fn: function (){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) {
  275. var $2,$1;
  276. $2=self["@current"];
  277. if(($receiver = $2) == nil || $receiver == undefined){
  278. self["@current"]=smalltalk.Announcer.klass.fn.prototype._new.apply(_st(self), []);
  279. $1=self["@current"];
  280. } else {
  281. $1=$2;
  282. };
  283. return $1;
  284. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.SystemAnnouncer.klass)})},
  285. args: [],
  286. source: "current\x0a\x09^ current ifNil: [ current := super new ]",
  287. messageSends: ["ifNil:", "new"],
  288. referencedClasses: []
  289. }),
  290. smalltalk.SystemAnnouncer.klass);
  291. smalltalk.addMethod(
  292. smalltalk.method({
  293. selector: "new",
  294. category: 'instance creation',
  295. fn: function (){
  296. var self=this;
  297. return smalltalk.withContext(function($ctx1) {
  298. _st(self)._shouldNotImplement();
  299. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.SystemAnnouncer.klass)})},
  300. args: [],
  301. source: "new\x0a\x09self shouldNotImplement",
  302. messageSends: ["shouldNotImplement"],
  303. referencedClasses: []
  304. }),
  305. smalltalk.SystemAnnouncer.klass);
  306. smalltalk.addClass('SystemAnnouncement', smalltalk.Object, ['theClass'], 'Kernel-Announcements');
  307. smalltalk.SystemAnnouncement.comment="I am the superclass of all system announcements"
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "theClass",
  311. category: 'accessing',
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) {
  315. var $1;
  316. $1=self["@theClass"];
  317. return $1;
  318. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.SystemAnnouncement)})},
  319. args: [],
  320. source: "theClass\x0a\x09^ theClass",
  321. messageSends: [],
  322. referencedClasses: []
  323. }),
  324. smalltalk.SystemAnnouncement);
  325. smalltalk.addMethod(
  326. smalltalk.method({
  327. selector: "theClass:",
  328. category: 'accessing',
  329. fn: function (aClass){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx1) {
  332. self["@theClass"]=aClass;
  333. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.SystemAnnouncement)})},
  334. args: ["aClass"],
  335. source: "theClass: aClass\x0a\x09theClass := aClass",
  336. messageSends: [],
  337. referencedClasses: []
  338. }),
  339. smalltalk.SystemAnnouncement);
  340. smalltalk.addClass('ClassAnnouncement', smalltalk.SystemAnnouncement, ['theClass'], 'Kernel-Announcements');
  341. smalltalk.addMethod(
  342. smalltalk.method({
  343. selector: "theClass",
  344. category: 'accessing',
  345. fn: function (){
  346. var self=this;
  347. return smalltalk.withContext(function($ctx1) {
  348. var $1;
  349. $1=self["@theClass"];
  350. return $1;
  351. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassAnnouncement)})},
  352. args: [],
  353. source: "theClass\x0a\x09^ theClass",
  354. messageSends: [],
  355. referencedClasses: []
  356. }),
  357. smalltalk.ClassAnnouncement);
  358. smalltalk.addMethod(
  359. smalltalk.method({
  360. selector: "theClass:",
  361. category: 'accessing',
  362. fn: function (aClass){
  363. var self=this;
  364. return smalltalk.withContext(function($ctx1) {
  365. self["@theClass"]=aClass;
  366. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassAnnouncement)})},
  367. args: ["aClass"],
  368. source: "theClass: aClass\x0a\x09theClass := aClass",
  369. messageSends: [],
  370. referencedClasses: []
  371. }),
  372. smalltalk.ClassAnnouncement);
  373. smalltalk.addClass('ClassAdded', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  374. smalltalk.ClassAdded.comment="I am emitted when a class is added to the system.\x0aSee ClassBuilder >> #addSubclassOf:... methods"
  375. smalltalk.addClass('ClassCommentChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  376. smalltalk.ClassCommentChanged.comment="I am emitted when the comment of a class changes. (Behavior >> #comment)"
  377. smalltalk.addClass('ClassDefinitionChanged', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  378. smalltalk.ClassDefinitionChanged.comment="I am emitted when the defintion of a class changes.\x0aSee ClassBuilder >> #class:instanceVariableNames:"
  379. smalltalk.addClass('ClassMigrated', smalltalk.ClassAnnouncement, ['oldClass'], 'Kernel-Announcements');
  380. smalltalk.addMethod(
  381. smalltalk.method({
  382. selector: "oldClass",
  383. category: 'accessing',
  384. fn: function (){
  385. var self=this;
  386. return smalltalk.withContext(function($ctx1) {
  387. var $1;
  388. $1=self["@oldClass"];
  389. return $1;
  390. }, function($ctx1) {$ctx1.fill(self,"oldClass",{},smalltalk.ClassMigrated)})},
  391. args: [],
  392. source: "oldClass\x0a\x09^ oldClass",
  393. messageSends: [],
  394. referencedClasses: []
  395. }),
  396. smalltalk.ClassMigrated);
  397. smalltalk.addMethod(
  398. smalltalk.method({
  399. selector: "oldClass:",
  400. category: 'accessing',
  401. fn: function (aClass){
  402. var self=this;
  403. return smalltalk.withContext(function($ctx1) {
  404. self["@oldClass"]=aClass;
  405. return self}, function($ctx1) {$ctx1.fill(self,"oldClass:",{aClass:aClass},smalltalk.ClassMigrated)})},
  406. args: ["aClass"],
  407. source: "oldClass: aClass\x0a\x09oldClass := aClass",
  408. messageSends: [],
  409. referencedClasses: []
  410. }),
  411. smalltalk.ClassMigrated);
  412. smalltalk.addClass('ClassMoved', smalltalk.ClassAnnouncement, ['oldPackage'], 'Kernel-Announcements');
  413. smalltalk.addMethod(
  414. smalltalk.method({
  415. selector: "oldPackage",
  416. category: 'accessing',
  417. fn: function (){
  418. var self=this;
  419. return smalltalk.withContext(function($ctx1) {
  420. var $1;
  421. $1=self["@oldPackage"];
  422. return $1;
  423. }, function($ctx1) {$ctx1.fill(self,"oldPackage",{},smalltalk.ClassMoved)})},
  424. args: [],
  425. source: "oldPackage\x0a\x09^ oldPackage",
  426. messageSends: [],
  427. referencedClasses: []
  428. }),
  429. smalltalk.ClassMoved);
  430. smalltalk.addMethod(
  431. smalltalk.method({
  432. selector: "oldPackage:",
  433. category: 'accessing',
  434. fn: function (aPackage){
  435. var self=this;
  436. return smalltalk.withContext(function($ctx1) {
  437. self["@oldPackage"]=aPackage;
  438. return self}, function($ctx1) {$ctx1.fill(self,"oldPackage:",{aPackage:aPackage},smalltalk.ClassMoved)})},
  439. args: ["aPackage"],
  440. source: "oldPackage: aPackage\x0a\x09oldPackage := aPackage",
  441. messageSends: [],
  442. referencedClasses: []
  443. }),
  444. smalltalk.ClassMoved);
  445. smalltalk.addClass('ClassRemoved', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  446. smalltalk.ClassRemoved.comment="I am emitted when a class is removed.\x0aSee Smalltalk >> #removeClass:"
  447. smalltalk.addClass('ClassRenamed', smalltalk.ClassAnnouncement, [], 'Kernel-Announcements');
  448. smalltalk.ClassRenamed.comment="I am emitted when a class is renamed.\x0aSee ClassBuilder >> #renameClass:to:"
  449. smalltalk.addClass('MethodAnnouncement', smalltalk.SystemAnnouncement, ['method'], 'Kernel-Announcements');
  450. smalltalk.addMethod(
  451. smalltalk.method({
  452. selector: "method",
  453. category: 'accessing',
  454. fn: function (){
  455. var self=this;
  456. return smalltalk.withContext(function($ctx1) {
  457. var $1;
  458. $1=self["@method"];
  459. return $1;
  460. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.MethodAnnouncement)})},
  461. args: [],
  462. source: "method\x0a\x09^ method",
  463. messageSends: [],
  464. referencedClasses: []
  465. }),
  466. smalltalk.MethodAnnouncement);
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "method:",
  470. category: 'accessing',
  471. fn: function (aCompiledMethod){
  472. var self=this;
  473. return smalltalk.withContext(function($ctx1) {
  474. self["@method"]=aCompiledMethod;
  475. return self}, function($ctx1) {$ctx1.fill(self,"method:",{aCompiledMethod:aCompiledMethod},smalltalk.MethodAnnouncement)})},
  476. args: ["aCompiledMethod"],
  477. source: "method: aCompiledMethod\x0a\x09method := aCompiledMethod",
  478. messageSends: [],
  479. referencedClasses: []
  480. }),
  481. smalltalk.MethodAnnouncement);
  482. smalltalk.addClass('MethodAdded', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  483. smalltalk.addClass('MethodModified', smalltalk.MethodAnnouncement, ['oldMethod'], 'Kernel-Announcements');
  484. smalltalk.addMethod(
  485. smalltalk.method({
  486. selector: "oldMethod",
  487. category: 'accessing',
  488. fn: function (){
  489. var self=this;
  490. return smalltalk.withContext(function($ctx1) {
  491. var $1;
  492. $1=self["@oldMethod"];
  493. return $1;
  494. }, function($ctx1) {$ctx1.fill(self,"oldMethod",{},smalltalk.MethodModified)})},
  495. args: [],
  496. source: "oldMethod\x0a\x09^ oldMethod",
  497. messageSends: [],
  498. referencedClasses: []
  499. }),
  500. smalltalk.MethodModified);
  501. smalltalk.addMethod(
  502. smalltalk.method({
  503. selector: "oldMethod:",
  504. category: 'accessing',
  505. fn: function (aMethod){
  506. var self=this;
  507. return smalltalk.withContext(function($ctx1) {
  508. self["@oldMethod"]=aMethod;
  509. return self}, function($ctx1) {$ctx1.fill(self,"oldMethod:",{aMethod:aMethod},smalltalk.MethodModified)})},
  510. args: ["aMethod"],
  511. source: "oldMethod: aMethod\x0a\x09oldMethod := aMethod",
  512. messageSends: [],
  513. referencedClasses: []
  514. }),
  515. smalltalk.MethodModified);
  516. smalltalk.addClass('MethodMoved', smalltalk.MethodAnnouncement, ['oldProtocol'], 'Kernel-Announcements');
  517. smalltalk.addMethod(
  518. smalltalk.method({
  519. selector: "oldProtocol",
  520. category: 'accessing',
  521. fn: function (){
  522. var self=this;
  523. return smalltalk.withContext(function($ctx1) {
  524. var $1;
  525. $1=self["@oldProtocol"];
  526. return $1;
  527. }, function($ctx1) {$ctx1.fill(self,"oldProtocol",{},smalltalk.MethodMoved)})},
  528. args: [],
  529. source: "oldProtocol\x0a\x09^ oldProtocol",
  530. messageSends: [],
  531. referencedClasses: []
  532. }),
  533. smalltalk.MethodMoved);
  534. smalltalk.addMethod(
  535. smalltalk.method({
  536. selector: "oldProtocol:",
  537. category: 'accessing',
  538. fn: function (aString){
  539. var self=this;
  540. return smalltalk.withContext(function($ctx1) {
  541. self["@oldProtocol"]=aString;
  542. return self}, function($ctx1) {$ctx1.fill(self,"oldProtocol:",{aString:aString},smalltalk.MethodMoved)})},
  543. args: ["aString"],
  544. source: "oldProtocol: aString\x0a\x09oldProtocol := aString",
  545. messageSends: [],
  546. referencedClasses: []
  547. }),
  548. smalltalk.MethodMoved);
  549. smalltalk.addClass('MethodRemoved', smalltalk.MethodAnnouncement, [], 'Kernel-Announcements');
  550. smalltalk.addClass('PackageAnnouncement', smalltalk.SystemAnnouncement, ['package'], 'Kernel-Announcements');
  551. smalltalk.addMethod(
  552. smalltalk.method({
  553. selector: "package",
  554. category: 'accessing',
  555. fn: function (){
  556. var self=this;
  557. return smalltalk.withContext(function($ctx1) {
  558. var $1;
  559. $1=self["@package"];
  560. return $1;
  561. }, function($ctx1) {$ctx1.fill(self,"package",{},smalltalk.PackageAnnouncement)})},
  562. args: [],
  563. source: "package\x0a\x09^ package",
  564. messageSends: [],
  565. referencedClasses: []
  566. }),
  567. smalltalk.PackageAnnouncement);
  568. smalltalk.addMethod(
  569. smalltalk.method({
  570. selector: "package:",
  571. category: 'accessing',
  572. fn: function (aPackage){
  573. var self=this;
  574. return smalltalk.withContext(function($ctx1) {
  575. self["@package"]=aPackage;
  576. return self}, function($ctx1) {$ctx1.fill(self,"package:",{aPackage:aPackage},smalltalk.PackageAnnouncement)})},
  577. args: ["aPackage"],
  578. source: "package: aPackage\x0a\x09package := aPackage",
  579. messageSends: [],
  580. referencedClasses: []
  581. }),
  582. smalltalk.PackageAnnouncement);
  583. smalltalk.addClass('PackageAdded', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  584. smalltalk.addClass('PackageRemoved', smalltalk.PackageAnnouncement, [], 'Kernel-Announcements');
  585. smalltalk.addClass('ProtocolAnnouncement', smalltalk.SystemAnnouncement, ['theClass', 'protocol'], 'Kernel-Announcements');
  586. smalltalk.addMethod(
  587. smalltalk.method({
  588. selector: "protocol",
  589. category: 'accessing',
  590. fn: function (){
  591. var self=this;
  592. return smalltalk.withContext(function($ctx1) {
  593. var $1;
  594. $1=self["@protocol"];
  595. return $1;
  596. }, function($ctx1) {$ctx1.fill(self,"protocol",{},smalltalk.ProtocolAnnouncement)})},
  597. args: [],
  598. source: "protocol\x0a\x09^ protocol",
  599. messageSends: [],
  600. referencedClasses: []
  601. }),
  602. smalltalk.ProtocolAnnouncement);
  603. smalltalk.addMethod(
  604. smalltalk.method({
  605. selector: "protocol:",
  606. category: 'accessing',
  607. fn: function (aString){
  608. var self=this;
  609. return smalltalk.withContext(function($ctx1) {
  610. self["@protocol"]=aString;
  611. return self}, function($ctx1) {$ctx1.fill(self,"protocol:",{aString:aString},smalltalk.ProtocolAnnouncement)})},
  612. args: ["aString"],
  613. source: "protocol: aString\x0a\x09protocol := aString",
  614. messageSends: [],
  615. referencedClasses: []
  616. }),
  617. smalltalk.ProtocolAnnouncement);
  618. smalltalk.addMethod(
  619. smalltalk.method({
  620. selector: "theClass",
  621. category: 'accessing',
  622. fn: function (){
  623. var self=this;
  624. return smalltalk.withContext(function($ctx1) {
  625. var $1;
  626. $1=self["@theClass"];
  627. return $1;
  628. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ProtocolAnnouncement)})},
  629. args: [],
  630. source: "theClass\x0a\x09^ theClass",
  631. messageSends: [],
  632. referencedClasses: []
  633. }),
  634. smalltalk.ProtocolAnnouncement);
  635. smalltalk.addMethod(
  636. smalltalk.method({
  637. selector: "theClass:",
  638. category: 'accessing',
  639. fn: function (aClass){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) {
  642. self["@theClass"]=aClass;
  643. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ProtocolAnnouncement)})},
  644. args: ["aClass"],
  645. source: "theClass: aClass\x0a\x09theClass := aClass",
  646. messageSends: [],
  647. referencedClasses: []
  648. }),
  649. smalltalk.ProtocolAnnouncement);
  650. smalltalk.addClass('ProtocolAdded', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');
  651. smalltalk.addClass('ProtocolRemoved', smalltalk.ProtocolAnnouncement, [], 'Kernel-Announcements');