Helios-Inspector.deploy.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  1. smalltalk.addPackage('Helios-Inspector', {});
  2. smalltalk.addClass('HLInspector', smalltalk.HLWidget, ['model', 'variablesWidget', 'displayWidget', 'codeWidget', 'label'], 'Helios-Inspector');
  3. smalltalk.addMethod(
  4. "_codeWidget",
  5. smalltalk.method({
  6. selector: "codeWidget",
  7. fn: function () {
  8. var self = this;
  9. var $2, $3, $1;
  10. if (($receiver = self['@codeWidget']) == nil || $receiver == undefined) {
  11. $2 = smalltalk.send(smalltalk.HLCodeWidget || HLCodeWidget, "_new", []);
  12. smalltalk.send($2, "_model_", [smalltalk.send(self['@model'], "_code", [])]);
  13. smalltalk.send($2, "_receiver_", [smalltalk.send(self['@model'], "_inspectee", [])]);
  14. $3 = smalltalk.send($2, "_yourself", []);
  15. self['@codeWidget'] = $3;
  16. $1 = self['@codeWidget'];
  17. } else {
  18. $1 = self['@codeWidget'];
  19. }
  20. return $1;
  21. }
  22. }),
  23. smalltalk.HLInspector);
  24. smalltalk.addMethod(
  25. "_displayWidget",
  26. smalltalk.method({
  27. selector: "displayWidget",
  28. fn: function () {
  29. var self = this;
  30. var $2, $3, $1;
  31. if (($receiver = self['@displayWidget']) == nil ||
  32. $receiver == undefined) {
  33. $2 = smalltalk.send(smalltalk.HLInspectorDisplayWidget || HLInspectorDisplayWidget, "_new", []);
  34. smalltalk.send($2, "_model_", [smalltalk.send(self, "_model", [])]);
  35. $3 = smalltalk.send($2, "_yourself", []);
  36. self['@displayWidget'] = $3;
  37. $1 = self['@displayWidget'];
  38. } else {
  39. $1 = self['@displayWidget'];
  40. }
  41. return $1;
  42. }
  43. }),
  44. smalltalk.HLInspector);
  45. smalltalk.addMethod(
  46. "_inspect_",
  47. smalltalk.method({
  48. selector: "inspect:",
  49. fn: function (anObject) {
  50. var self = this;
  51. var $1;
  52. smalltalk.send(smalltalk.send(self, "_model", []), "_inspect_on_", [anObject, self]);
  53. smalltalk.send(self, "_refreshVariablesWidget", []);
  54. $1 = smalltalk.send(self, "_refreshDisplayWidget", []);
  55. return self;
  56. }
  57. }),
  58. smalltalk.HLInspector);
  59. smalltalk.addMethod(
  60. "_inspectee",
  61. smalltalk.method({
  62. selector: "inspectee",
  63. fn: function () {
  64. var self = this;
  65. var $1;
  66. $1 = smalltalk.send(smalltalk.send(self, "_model", []), "_inspectee", []);
  67. return $1;
  68. }
  69. }),
  70. smalltalk.HLInspector);
  71. smalltalk.addMethod(
  72. "_inspectee_",
  73. smalltalk.method({
  74. selector: "inspectee:",
  75. fn: function (anObject) {
  76. var self = this;
  77. smalltalk.send(smalltalk.send(self, "_model", []), "_inspectee_", [anObject]);
  78. return self;
  79. }
  80. }),
  81. smalltalk.HLInspector);
  82. smalltalk.addMethod(
  83. "_label",
  84. smalltalk.method({
  85. selector: "label",
  86. fn: function () {
  87. var self = this;
  88. var $1;
  89. if (($receiver = self['@label']) == nil || $receiver == undefined) {
  90. $1 = smalltalk.send(smalltalk.send(self['@model'], "_inspectee", []), "_printString", []);
  91. } else {
  92. $1 = self['@label'];
  93. }
  94. return $1;
  95. }
  96. }),
  97. smalltalk.HLInspector);
  98. smalltalk.addMethod(
  99. "_model",
  100. smalltalk.method({
  101. selector: "model",
  102. fn: function () {
  103. var self = this;
  104. var $1;
  105. if (($receiver = self['@model']) == nil || $receiver == undefined) {
  106. smalltalk.send(self, "_model_", [smalltalk.send(smalltalk.HLInspectorModel || HLInspectorModel, "_new", [])]);
  107. $1 = self['@model'];
  108. } else {
  109. $1 = self['@model'];
  110. }
  111. return $1;
  112. }
  113. }),
  114. smalltalk.HLInspector);
  115. smalltalk.addMethod(
  116. "_model_",
  117. smalltalk.method({
  118. selector: "model:",
  119. fn: function (aModel) {
  120. var self = this;
  121. var $1;
  122. self['@model'] = aModel;
  123. smalltalk.send(smalltalk.send(self, "_codeWidget", []), "_model_", [smalltalk.send(aModel, "_code", [])]);
  124. smalltalk.send(self, "_observeCodeWidget", []);
  125. smalltalk.send(self, "_observeVariablesWidget", []);
  126. $1 = smalltalk.send(self, "_observeModel", []);
  127. return self;
  128. }
  129. }),
  130. smalltalk.HLInspector);
  131. smalltalk.addMethod(
  132. "_observeCodeWidget",
  133. smalltalk.method({
  134. selector: "observeCodeWidget",
  135. fn: function () {
  136. var self = this;
  137. smalltalk.send(smalltalk.send(smalltalk.send(self, "_codeWidget", []), "_announcer", []), "_on_do_", [smalltalk.HLDoItExecuted || HLDoItExecuted, function () {return smalltalk.send(self, "_onDoneIt", []);}]);
  138. return self;
  139. }
  140. }),
  141. smalltalk.HLInspector);
  142. smalltalk.addMethod(
  143. "_observeModel",
  144. smalltalk.method({
  145. selector: "observeModel",
  146. fn: function () {
  147. var self = this;
  148. smalltalk.send(smalltalk.send(smalltalk.send(self, "_model", []), "_announcer", []), "_on_do_", [smalltalk.HLInstanceVariableSelected || HLInstanceVariableSelected, function (ann) {return smalltalk.send(self, "_onInstanceVariableSelected", []);}]);
  149. return self;
  150. }
  151. }),
  152. smalltalk.HLInspector);
  153. smalltalk.addMethod(
  154. "_observeVariablesWidget",
  155. smalltalk.method({
  156. selector: "observeVariablesWidget",
  157. fn: function () {
  158. var self = this;
  159. var $1, $2;
  160. $1 = smalltalk.send(smalltalk.send(self, "_variablesWidget", []), "_announcer", []);
  161. smalltalk.send($1, "_on_do_", [smalltalk.HLRefreshRequested || HLRefreshRequested, function (ann) {return smalltalk.send(self, "_onRefresh", []);}]);
  162. $2 = smalltalk.send($1, "_on_do_", [smalltalk.HLDiveRequested || HLDiveRequested, function () {return smalltalk.send(self, "_onDive", []);}]);
  163. return self;
  164. }
  165. }),
  166. smalltalk.HLInspector);
  167. smalltalk.addMethod(
  168. "_onDive",
  169. smalltalk.method({
  170. selector: "onDive",
  171. fn: function () {
  172. var self = this;
  173. smalltalk.send(self, "_inspect_", [smalltalk.send(smalltalk.send(self, "_model", []), "_selectedInstVarObject", [])]);
  174. return self;
  175. }
  176. }),
  177. smalltalk.HLInspector);
  178. smalltalk.addMethod(
  179. "_onDoneIt",
  180. smalltalk.method({
  181. selector: "onDoneIt",
  182. fn: function () {
  183. var self = this;
  184. smalltalk.send(self, "_refresh", []);
  185. return self;
  186. }
  187. }),
  188. smalltalk.HLInspector);
  189. smalltalk.addMethod(
  190. "_onInspectIt",
  191. smalltalk.method({
  192. selector: "onInspectIt",
  193. fn: function () {
  194. var self = this;
  195. return self;
  196. }
  197. }),
  198. smalltalk.HLInspector);
  199. smalltalk.addMethod(
  200. "_onInstanceVariableSelected",
  201. smalltalk.method({
  202. selector: "onInstanceVariableSelected",
  203. fn: function () {
  204. var self = this;
  205. smalltalk.send(smalltalk.send(self, "_codeWidget", []), "_receiver_", [smalltalk.send(smalltalk.send(self, "_model", []), "_selectedInstVarObject", [])]);
  206. smalltalk.send(self, "_refreshDisplayWidget", []);
  207. return self;
  208. }
  209. }),
  210. smalltalk.HLInspector);
  211. smalltalk.addMethod(
  212. "_onPrintIt",
  213. smalltalk.method({
  214. selector: "onPrintIt",
  215. fn: function () {
  216. var self = this;
  217. return self;
  218. }
  219. }),
  220. smalltalk.HLInspector);
  221. smalltalk.addMethod(
  222. "_onRefresh",
  223. smalltalk.method({
  224. selector: "onRefresh",
  225. fn: function () {
  226. var self = this;
  227. smalltalk.send(self, "_refresh", []);
  228. return self;
  229. }
  230. }),
  231. smalltalk.HLInspector);
  232. smalltalk.addMethod(
  233. "_open",
  234. smalltalk.method({
  235. selector: "open",
  236. fn: function () {
  237. var self = this;
  238. smalltalk.send(smalltalk.send(smalltalk.HLManager || HLManager, "_current", []), "_addTab_", [smalltalk.send(smalltalk.HLTab || HLTab, "_on_labelled_", [self, smalltalk.send(self, "_tabLabel", [])])]);
  239. return self;
  240. }
  241. }),
  242. smalltalk.HLInspector);
  243. smalltalk.addMethod(
  244. "_refresh",
  245. smalltalk.method({
  246. selector: "refresh",
  247. fn: function () {
  248. var self = this;
  249. smalltalk.send(self, "_inspect_", [smalltalk.send(self, "_inspectee", [])]);
  250. return self;
  251. }
  252. }),
  253. smalltalk.HLInspector);
  254. smalltalk.addMethod(
  255. "_refreshDisplayWidget",
  256. smalltalk.method({
  257. selector: "refreshDisplayWidget",
  258. fn: function () {
  259. var self = this;
  260. smalltalk.send(smalltalk.send(self, "_displayWidget", []), "_refresh", []);
  261. return self;
  262. }
  263. }),
  264. smalltalk.HLInspector);
  265. smalltalk.addMethod(
  266. "_refreshVariablesWidget",
  267. smalltalk.method({
  268. selector: "refreshVariablesWidget",
  269. fn: function () {
  270. var self = this;
  271. smalltalk.send(smalltalk.send(self, "_variablesWidget", []), "_refresh", []);
  272. return self;
  273. }
  274. }),
  275. smalltalk.HLInspector);
  276. smalltalk.addMethod(
  277. "_renderContentOn_",
  278. smalltalk.method({
  279. selector: "renderContentOn:",
  280. fn: function (html) {
  281. var self = this;
  282. smalltalk.send(html, "_with_", [smalltalk.send(smalltalk.HLContainer || HLContainer, "_with_", [smalltalk.send(smalltalk.HLHorizontalSplitter || HLHorizontalSplitter, "_with_with_", [smalltalk.send(smalltalk.HLVerticalSplitter || HLVerticalSplitter, "_with_with_", [smalltalk.send(self, "_variablesWidget", []), smalltalk.send(self, "_displayWidget", [])]), smalltalk.send(self, "_codeWidget", [])])])]);
  283. return self;
  284. }
  285. }),
  286. smalltalk.HLInspector);
  287. smalltalk.addMethod(
  288. "_setLabel_",
  289. smalltalk.method({
  290. selector: "setLabel:",
  291. fn: function (aString) {
  292. var self = this;
  293. self['@label'] = aString;
  294. return self;
  295. }
  296. }),
  297. smalltalk.HLInspector);
  298. smalltalk.addMethod(
  299. "_setVariables_",
  300. smalltalk.method({
  301. selector: "setVariables:",
  302. fn: function (aDictionary) {
  303. var self = this;
  304. smalltalk.send(smalltalk.send(self, "_model", []), "_variables_", [aDictionary]);
  305. return self;
  306. }
  307. }),
  308. smalltalk.HLInspector);
  309. smalltalk.addMethod(
  310. "_tabLabel",
  311. smalltalk.method({
  312. selector: "tabLabel",
  313. fn: function () {
  314. var self = this;
  315. var $1;
  316. $1 = smalltalk.send(self, "_label", []);
  317. return $1;
  318. }
  319. }),
  320. smalltalk.HLInspector);
  321. smalltalk.addMethod(
  322. "_variablesWidget",
  323. smalltalk.method({
  324. selector: "variablesWidget",
  325. fn: function () {
  326. var self = this;
  327. var $2, $3, $1;
  328. if (($receiver = self['@variablesWidget']) == nil ||
  329. $receiver == undefined) {
  330. $2 = smalltalk.send(smalltalk.HLInspectorVariablesWidget ||
  331. HLInspectorVariablesWidget, "_new", []);
  332. smalltalk.send($2, "_model_", [smalltalk.send(self, "_model", [])]);
  333. $3 = smalltalk.send($2, "_yourself", []);
  334. self['@variablesWidget'] = $3;
  335. $1 = self['@variablesWidget'];
  336. } else {
  337. $1 = self['@variablesWidget'];
  338. }
  339. return $1;
  340. }
  341. }),
  342. smalltalk.HLInspector);
  343. smalltalk.addMethod(
  344. "_canBeOpenAsTab",
  345. smalltalk.method({
  346. selector: "canBeOpenAsTab",
  347. fn: function () {
  348. var self = this;
  349. return false;
  350. }
  351. }),
  352. smalltalk.HLInspector.klass);
  353. smalltalk.addMethod(
  354. "_tabLabel",
  355. smalltalk.method({
  356. selector: "tabLabel",
  357. fn: function () {
  358. var self = this;
  359. return "Inspector";
  360. }
  361. }),
  362. smalltalk.HLInspector.klass);
  363. smalltalk.addMethod(
  364. "_tabPriority",
  365. smalltalk.method({
  366. selector: "tabPriority",
  367. fn: function () {
  368. var self = this;
  369. return 10;
  370. }
  371. }),
  372. smalltalk.HLInspector.klass);
  373. smalltalk.addClass('HLInspectorDisplayWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
  374. smalltalk.addMethod(
  375. "_model",
  376. smalltalk.method({
  377. selector: "model",
  378. fn: function () {
  379. var self = this;
  380. return self['@model'];
  381. }
  382. }),
  383. smalltalk.HLInspectorDisplayWidget);
  384. smalltalk.addMethod(
  385. "_model_",
  386. smalltalk.method({
  387. selector: "model:",
  388. fn: function (aModel) {
  389. var self = this;
  390. self['@model'] = aModel;
  391. return self;
  392. }
  393. }),
  394. smalltalk.HLInspectorDisplayWidget);
  395. smalltalk.addMethod(
  396. "_renderContentOn_",
  397. smalltalk.method({
  398. selector: "renderContentOn:",
  399. fn: function (html) {
  400. var self = this;
  401. smalltalk.send(smalltalk.send(html, "_div", []), "_with_", [smalltalk.send(self, "_selectionDisplayString", [])]);
  402. return self;
  403. }
  404. }),
  405. smalltalk.HLInspectorDisplayWidget);
  406. smalltalk.addMethod(
  407. "_selectionDisplayString",
  408. smalltalk.method({
  409. selector: "selectionDisplayString",
  410. fn: function () {
  411. var self = this;
  412. var $2, $1;
  413. var selection;
  414. selection = smalltalk.send(self['@model'], "_selection", []);
  415. $2 = smalltalk.send(smalltalk.send(smalltalk.send(self['@model'], "_variables", []), "_keys", []), "_includes_", [selection]);
  416. if (smalltalk.assert($2)) {
  417. $1 = smalltalk.send(smalltalk.send(self['@model'], "_instVarObjectAt_", [selection]), "_printString", []);
  418. } else {
  419. $1 = "";
  420. }
  421. return $1;
  422. }
  423. }),
  424. smalltalk.HLInspectorDisplayWidget);
  425. smalltalk.addClass('HLInspectorModel', smalltalk.Object, ['announcer', 'environment', 'inspectee', 'code', 'variables', 'selection'], 'Helios-Inspector');
  426. smalltalk.addMethod(
  427. "_announcer",
  428. smalltalk.method({
  429. selector: "announcer",
  430. fn: function () {
  431. var self = this;
  432. var $1;
  433. if (($receiver = self['@announcer']) == nil || $receiver == undefined) {
  434. self['@announcer'] = smalltalk.send(smalltalk.Announcer || Announcer, "_new", []);
  435. $1 = self['@announcer'];
  436. } else {
  437. $1 = self['@announcer'];
  438. }
  439. return $1;
  440. }
  441. }),
  442. smalltalk.HLInspectorModel);
  443. smalltalk.addMethod(
  444. "_code",
  445. smalltalk.method({
  446. selector: "code",
  447. fn: function () {
  448. var self = this;
  449. var $1;
  450. if (($receiver = self['@code']) == nil || $receiver == undefined) {
  451. self['@code'] = smalltalk.send(smalltalk.HLCodeModel || HLCodeModel, "_on_", [smalltalk.send(self, "_environment", [])]);
  452. $1 = self['@code'];
  453. } else {
  454. $1 = self['@code'];
  455. }
  456. return $1;
  457. }
  458. }),
  459. smalltalk.HLInspectorModel);
  460. smalltalk.addMethod(
  461. "_environment",
  462. smalltalk.method({
  463. selector: "environment",
  464. fn: function () {
  465. var self = this;
  466. var $1;
  467. if (($receiver = self['@environment']) == nil || $receiver == undefined) {
  468. $1 = smalltalk.send(smalltalk.send(smalltalk.HLManager || HLManager, "_current", []), "_environment", []);
  469. } else {
  470. $1 = self['@environment'];
  471. }
  472. return $1;
  473. }
  474. }),
  475. smalltalk.HLInspectorModel);
  476. smalltalk.addMethod(
  477. "_environment_",
  478. smalltalk.method({
  479. selector: "environment:",
  480. fn: function (anEnvironment) {
  481. var self = this;
  482. self['@environment'] = anEnvironment;
  483. return self;
  484. }
  485. }),
  486. smalltalk.HLInspectorModel);
  487. smalltalk.addMethod(
  488. "_inspect_on_",
  489. smalltalk.method({
  490. selector: "inspect:on:",
  491. fn: function (anObject, anInspector) {
  492. var self = this;
  493. self['@inspectee'] = anObject;
  494. self['@variables'] = [];
  495. smalltalk.send(self['@inspectee'], "_inspectOn_", [anInspector]);
  496. return self;
  497. }
  498. }),
  499. smalltalk.HLInspectorModel);
  500. smalltalk.addMethod(
  501. "_inspectee",
  502. smalltalk.method({
  503. selector: "inspectee",
  504. fn: function () {
  505. var self = this;
  506. return self['@inspectee'];
  507. }
  508. }),
  509. smalltalk.HLInspectorModel);
  510. smalltalk.addMethod(
  511. "_inspectee_",
  512. smalltalk.method({
  513. selector: "inspectee:",
  514. fn: function (anObject) {
  515. var self = this;
  516. self['@inspectee'] = anObject;
  517. return self;
  518. }
  519. }),
  520. smalltalk.HLInspectorModel);
  521. smalltalk.addMethod(
  522. "_instVarObjectAt_",
  523. smalltalk.method({
  524. selector: "instVarObjectAt:",
  525. fn: function (anInstVarName) {
  526. var self = this;
  527. var $1;
  528. $1 = smalltalk.send(smalltalk.send(self, "_variables", []), "_at_", [anInstVarName]);
  529. return $1;
  530. }
  531. }),
  532. smalltalk.HLInspectorModel);
  533. smalltalk.addMethod(
  534. "_onKeyDown_",
  535. smalltalk.method({
  536. selector: "onKeyDown:",
  537. fn: function (anEvent) {
  538. var self = this;
  539. if (anEvent.ctrlKey) {
  540. if (anEvent.keyCode === 80) {
  541. self._printIt();
  542. anEvent.preventDefault();
  543. return false;
  544. }
  545. if (anEvent.keyCode === 68) {
  546. self._doIt();
  547. anEvent.preventDefault();
  548. return false;
  549. }
  550. if (anEvent.keyCode === 73) {
  551. self._inspectIt();
  552. anEvent.preventDefault();
  553. return false;
  554. }
  555. }
  556. return self;
  557. }
  558. }),
  559. smalltalk.HLInspectorModel);
  560. smalltalk.addMethod(
  561. "_selectedInstVar_",
  562. smalltalk.method({
  563. selector: "selectedInstVar:",
  564. fn: function (anInstVarName) {
  565. var self = this;
  566. smalltalk.send(self, "_selection_", [anInstVarName]);
  567. return self;
  568. }
  569. }),
  570. smalltalk.HLInspectorModel);
  571. smalltalk.addMethod(
  572. "_selectedInstVarObject",
  573. smalltalk.method({
  574. selector: "selectedInstVarObject",
  575. fn: function () {
  576. var self = this;
  577. var $1;
  578. $1 = smalltalk.send(self, "_instVarObjectAt_", [smalltalk.send(self, "_selection", [])]);
  579. return $1;
  580. }
  581. }),
  582. smalltalk.HLInspectorModel);
  583. smalltalk.addMethod(
  584. "_selection",
  585. smalltalk.method({
  586. selector: "selection",
  587. fn: function () {
  588. var self = this;
  589. var $1;
  590. if (($receiver = self['@selection']) == nil || $receiver == undefined) {
  591. $1 = "";
  592. } else {
  593. $1 = self['@selection'];
  594. }
  595. return $1;
  596. }
  597. }),
  598. smalltalk.HLInspectorModel);
  599. smalltalk.addMethod(
  600. "_selection_",
  601. smalltalk.method({
  602. selector: "selection:",
  603. fn: function (anObject) {
  604. var self = this;
  605. self['@selection'] = anObject;
  606. smalltalk.send(smalltalk.send(self, "_announcer", []), "_announce_", [smalltalk.send(smalltalk.HLInstanceVariableSelected || HLInstanceVariableSelected, "_on_", [self['@selection']])]);
  607. return self;
  608. }
  609. }),
  610. smalltalk.HLInspectorModel);
  611. smalltalk.addMethod(
  612. "_subscribe_",
  613. smalltalk.method({
  614. selector: "subscribe:",
  615. fn: function (aWidget) {
  616. var self = this;
  617. smalltalk.send(aWidget, "_subscribeTo_", [smalltalk.send(self, "_announcer", [])]);
  618. return self;
  619. }
  620. }),
  621. smalltalk.HLInspectorModel);
  622. smalltalk.addMethod(
  623. "_variables",
  624. smalltalk.method({
  625. selector: "variables",
  626. fn: function () {
  627. var self = this;
  628. return self['@variables'];
  629. }
  630. }),
  631. smalltalk.HLInspectorModel);
  632. smalltalk.addMethod(
  633. "_variables_",
  634. smalltalk.method({
  635. selector: "variables:",
  636. fn: function (aCollection) {
  637. var self = this;
  638. self['@variables'] = aCollection;
  639. return self;
  640. }
  641. }),
  642. smalltalk.HLInspectorModel);
  643. smalltalk.addMethod(
  644. "_on_",
  645. smalltalk.method({
  646. selector: "on:",
  647. fn: function (anEnvironment) {
  648. var self = this;
  649. var $2, $3, $1;
  650. $2 = smalltalk.send(self, "_new", []);
  651. smalltalk.send($2, "_environment_", [anEnvironment]);
  652. $3 = smalltalk.send($2, "_yourself", []);
  653. $1 = $3;
  654. return $1;
  655. }
  656. }),
  657. smalltalk.HLInspectorModel.klass);
  658. smalltalk.addClass('HLInspectorVariablesWidget', smalltalk.HLNavigationListWidget, ['announcer', 'model', 'list', 'diveButton'], 'Helios-Inspector');
  659. smalltalk.addMethod(
  660. "_announcer",
  661. smalltalk.method({
  662. selector: "announcer",
  663. fn: function () {
  664. var self = this;
  665. var $1;
  666. if (($receiver = self['@announcer']) == nil || $receiver == undefined) {
  667. self['@announcer'] = smalltalk.send(smalltalk.Announcer || Announcer, "_new", []);
  668. $1 = self['@announcer'];
  669. } else {
  670. $1 = self['@announcer'];
  671. }
  672. return $1;
  673. }
  674. }),
  675. smalltalk.HLInspectorVariablesWidget);
  676. smalltalk.addMethod(
  677. "_defaultItems",
  678. smalltalk.method({
  679. selector: "defaultItems",
  680. fn: function () {
  681. var self = this;
  682. var $1;
  683. $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_model", []), "_variables", []), "_keys", []);
  684. return $1;
  685. }
  686. }),
  687. smalltalk.HLInspectorVariablesWidget);
  688. smalltalk.addMethod(
  689. "_model",
  690. smalltalk.method({
  691. selector: "model",
  692. fn: function () {
  693. var self = this;
  694. return self['@model'];
  695. }
  696. }),
  697. smalltalk.HLInspectorVariablesWidget);
  698. smalltalk.addMethod(
  699. "_model_",
  700. smalltalk.method({
  701. selector: "model:",
  702. fn: function (aModel) {
  703. var self = this;
  704. self['@model'] = aModel;
  705. return self;
  706. }
  707. }),
  708. smalltalk.HLInspectorVariablesWidget);
  709. smalltalk.addMethod(
  710. "_refresh",
  711. smalltalk.method({
  712. selector: "refresh",
  713. fn: function () {
  714. var self = this;
  715. smalltalk.send(self, "_resetItems", []);
  716. smalltalk.send(self, "_refresh", [], smalltalk.HLNavigationListWidget);
  717. return self;
  718. }
  719. }),
  720. smalltalk.HLInspectorVariablesWidget);
  721. smalltalk.addMethod(
  722. "_renderButtonsOn_",
  723. smalltalk.method({
  724. selector: "renderButtonsOn:",
  725. fn: function (html) {
  726. var self = this;
  727. var $1, $2, $3, $4;
  728. $1 = smalltalk.send(html, "_button", []);
  729. smalltalk.send($1, "_class_", ["btn"]);
  730. smalltalk.send($1, "_with_", ["Refresh"]);
  731. $2 = smalltalk.send($1, "_onClick_", [function () {return smalltalk.send(smalltalk.send(self, "_announcer", []), "_announce_", [smalltalk.send(smalltalk.HLRefreshRequested || HLRefreshRequested, "_new", [])]);}]);
  732. $3 = smalltalk.send(html, "_button", []);
  733. smalltalk.send($3, "_class_", ["btn"]);
  734. smalltalk.send($3, "_with_", ["Dive"]);
  735. $4 = smalltalk.send($3, "_onClick_", [function () {return smalltalk.send(smalltalk.send(self, "_announcer", []), "_announce_", [smalltalk.send(smalltalk.HLDiveRequested || HLDiveRequested, "_new", [])]);}]);
  736. self['@diveButton'] = $4;
  737. return self;
  738. }
  739. }),
  740. smalltalk.HLInspectorVariablesWidget);
  741. smalltalk.addMethod(
  742. "_resetItems",
  743. smalltalk.method({
  744. selector: "resetItems",
  745. fn: function () {
  746. var self = this;
  747. self['@items'] = nil;
  748. return self;
  749. }
  750. }),
  751. smalltalk.HLInspectorVariablesWidget);
  752. smalltalk.addMethod(
  753. "_selectItem_",
  754. smalltalk.method({
  755. selector: "selectItem:",
  756. fn: function (anObject) {
  757. var self = this;
  758. smalltalk.send(self, "_selectItem_", [anObject], smalltalk.HLNavigationListWidget);
  759. smalltalk.send(smalltalk.send(self, "_model", []), "_selectedInstVar_", [anObject]);
  760. return self;
  761. }
  762. }),
  763. smalltalk.HLInspectorVariablesWidget);
  764. smalltalk.addMethod(
  765. "_selection",
  766. smalltalk.method({
  767. selector: "selection",
  768. fn: function () {
  769. var self = this;
  770. var $1;
  771. $1 = smalltalk.send(self['@model'], "_selection", []);
  772. return $1;
  773. }
  774. }),
  775. smalltalk.HLInspectorVariablesWidget);
  776. smalltalk.addMethod(
  777. "_variables",
  778. smalltalk.method({
  779. selector: "variables",
  780. fn: function () {
  781. var self = this;
  782. var $1;
  783. $1 = smalltalk.send(self['@model'], "_variables", []);
  784. return $1;
  785. }
  786. }),
  787. smalltalk.HLInspectorVariablesWidget);