Helios-Widgets.deploy.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188
  1. smalltalk.addPackage('Helios-Widgets', {});
  2. smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios-Widgets');
  3. smalltalk.addMethod(
  4. "_activate",
  5. smalltalk.method({
  6. selector: "activate",
  7. fn: function () {
  8. var self = this;
  9. smalltalk.send(smalltalk.send(self, "_manager", []), "_activate_", [self]);
  10. return self;
  11. }
  12. }),
  13. smalltalk.HLTab);
  14. smalltalk.addMethod(
  15. "_add",
  16. smalltalk.method({
  17. selector: "add",
  18. fn: function () {
  19. var self = this;
  20. smalltalk.send(smalltalk.send(self, "_manager", []), "_addTab_", [self]);
  21. return self;
  22. }
  23. }),
  24. smalltalk.HLTab);
  25. smalltalk.addMethod(
  26. "_isActive",
  27. smalltalk.method({
  28. selector: "isActive",
  29. fn: function () {
  30. var self = this;
  31. var $1;
  32. $1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_manager", []), "_activeTab", []), "__eq", [self]);
  33. return $1;
  34. }
  35. }),
  36. smalltalk.HLTab);
  37. smalltalk.addMethod(
  38. "_label",
  39. smalltalk.method({
  40. selector: "label",
  41. fn: function () {
  42. var self = this;
  43. var $1;
  44. if (($receiver = self['@label']) == nil || $receiver == undefined) {
  45. $1 = "";
  46. } else {
  47. $1 = self['@label'];
  48. }
  49. return $1;
  50. }
  51. }),
  52. smalltalk.HLTab);
  53. smalltalk.addMethod(
  54. "_label_",
  55. smalltalk.method({
  56. selector: "label:",
  57. fn: function (aString) {
  58. var self = this;
  59. self['@label'] = aString;
  60. return self;
  61. }
  62. }),
  63. smalltalk.HLTab);
  64. smalltalk.addMethod(
  65. "_manager",
  66. smalltalk.method({
  67. selector: "manager",
  68. fn: function () {
  69. var self = this;
  70. var $1;
  71. $1 = smalltalk.send(smalltalk.HLTabManager || HLTabManager, "_current", []);
  72. return $1;
  73. }
  74. }),
  75. smalltalk.HLTab);
  76. smalltalk.addMethod(
  77. "_widget",
  78. smalltalk.method({
  79. selector: "widget",
  80. fn: function () {
  81. var self = this;
  82. return self['@widget'];
  83. }
  84. }),
  85. smalltalk.HLTab);
  86. smalltalk.addMethod(
  87. "_widget_",
  88. smalltalk.method({
  89. selector: "widget:",
  90. fn: function (aWidget) {
  91. var self = this;
  92. self['@widget'] = aWidget;
  93. return self;
  94. }
  95. }),
  96. smalltalk.HLTab);
  97. smalltalk.addMethod(
  98. "_on_labelled_",
  99. smalltalk.method({
  100. selector: "on:labelled:",
  101. fn: function (aWidget, aString) {
  102. var self = this;
  103. var $2, $3, $1;
  104. $2 = smalltalk.send(self, "_new", []);
  105. smalltalk.send($2, "_widget_", [aWidget]);
  106. smalltalk.send($2, "_label_", [aString]);
  107. $3 = smalltalk.send($2, "_yourself", []);
  108. $1 = $3;
  109. return $1;
  110. }
  111. }),
  112. smalltalk.HLTab.klass);
  113. smalltalk.addClass('HLWidget', smalltalk.Widget, ['rootDiv'], 'Helios-Widgets');
  114. smalltalk.addMethod(
  115. "_announce_",
  116. smalltalk.method({
  117. selector: "announce:",
  118. fn: function (anObject) {
  119. var self = this;
  120. smalltalk.send(smalltalk.send(self, "_announcer", []), "_announce_", [anObject]);
  121. return self;
  122. }
  123. }),
  124. smalltalk.HLWidget);
  125. smalltalk.addMethod(
  126. "_announcer",
  127. smalltalk.method({
  128. selector: "announcer",
  129. fn: function () {
  130. var self = this;
  131. var $1;
  132. $1 = smalltalk.send(smalltalk.send(self, "_manager", []), "_announcer", []);
  133. return $1;
  134. }
  135. }),
  136. smalltalk.HLWidget);
  137. smalltalk.addMethod(
  138. "_initialize",
  139. smalltalk.method({
  140. selector: "initialize",
  141. fn: function () {
  142. var self = this;
  143. smalltalk.send(self, "_initialize", [], smalltalk.Widget);
  144. smalltalk.send(self, "_subscribe", []);
  145. return self;
  146. }
  147. }),
  148. smalltalk.HLWidget);
  149. smalltalk.addMethod(
  150. "_manager",
  151. smalltalk.method({
  152. selector: "manager",
  153. fn: function () {
  154. var self = this;
  155. var $1;
  156. $1 = smalltalk.send(smalltalk.HLTabManager || HLTabManager, "_current", []);
  157. return $1;
  158. }
  159. }),
  160. smalltalk.HLWidget);
  161. smalltalk.addMethod(
  162. "_on_do_",
  163. smalltalk.method({
  164. selector: "on:do:",
  165. fn: function (anAnnouncement, aBlock) {
  166. var self = this;
  167. smalltalk.send(smalltalk.send(self, "_announcer", []), "_on_do_", [anAnnouncement, aBlock]);
  168. return self;
  169. }
  170. }),
  171. smalltalk.HLWidget);
  172. smalltalk.addMethod(
  173. "_refresh",
  174. smalltalk.method({
  175. selector: "refresh",
  176. fn: function () {
  177. var self = this;
  178. if (($receiver = self['@rootDiv']) == nil || $receiver == undefined) {
  179. return self;
  180. } else {
  181. self['@rootDiv'];
  182. }
  183. smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_empty", []);
  184. smalltalk.send(function (html) {return smalltalk.send(self, "_renderContentOn_", [html]);}, "_appendToJQuery_", [smalltalk.send(self['@rootDiv'], "_asJQuery", [])]);
  185. return self;
  186. }
  187. }),
  188. smalltalk.HLWidget);
  189. smalltalk.addMethod(
  190. "_renderContentOn_",
  191. smalltalk.method({
  192. selector: "renderContentOn:",
  193. fn: function (html) {
  194. var self = this;
  195. return self;
  196. }
  197. }),
  198. smalltalk.HLWidget);
  199. smalltalk.addMethod(
  200. "_renderOn_",
  201. smalltalk.method({
  202. selector: "renderOn:",
  203. fn: function (html) {
  204. var self = this;
  205. self['@rootDiv'] = smalltalk.send(smalltalk.send(html, "_div", []), "_with_", [function () {return smalltalk.send(self, "_renderContentOn_", [html]);}]);
  206. return self;
  207. }
  208. }),
  209. smalltalk.HLWidget);
  210. smalltalk.addMethod(
  211. "_subscribe",
  212. smalltalk.method({
  213. selector: "subscribe",
  214. fn: function () {
  215. var self = this;
  216. return self;
  217. }
  218. }),
  219. smalltalk.HLWidget);
  220. smalltalk.addMethod(
  221. "_canBeOpenAsTab",
  222. smalltalk.method({
  223. selector: "canBeOpenAsTab",
  224. fn: function () {
  225. var self = this;
  226. return false;
  227. }
  228. }),
  229. smalltalk.HLWidget.klass);
  230. smalltalk.addMethod(
  231. "_openAsTab",
  232. smalltalk.method({
  233. selector: "openAsTab",
  234. fn: function () {
  235. var self = this;
  236. smalltalk.send(smalltalk.send(smalltalk.HLTabManager || HLTabManager, "_current", []), "_addTab_", [smalltalk.send(smalltalk.HLTab || HLTab, "_on_labelled_", [smalltalk.send(self, "_new", []), smalltalk.send(self, "_tabLabel", [])])]);
  237. return self;
  238. }
  239. }),
  240. smalltalk.HLWidget.klass);
  241. smalltalk.addMethod(
  242. "_tabLabel",
  243. smalltalk.method({
  244. selector: "tabLabel",
  245. fn: function () {
  246. var self = this;
  247. return "Tab";
  248. }
  249. }),
  250. smalltalk.HLWidget.klass);
  251. smalltalk.addMethod(
  252. "_tabPriority",
  253. smalltalk.method({
  254. selector: "tabPriority",
  255. fn: function () {
  256. var self = this;
  257. return 500;
  258. }
  259. }),
  260. smalltalk.HLWidget.klass);
  261. smalltalk.addClass('HLBrowser', smalltalk.HLWidget, ['environment', 'selectedPackage', 'selectedClass', 'packagesListWidget', 'classesListWidget'], 'Helios-Widgets');
  262. smalltalk.addMethod(
  263. "_classesListWidget",
  264. smalltalk.method({
  265. selector: "classesListWidget",
  266. fn: function () {
  267. var self = this;
  268. var $1;
  269. if (($receiver = self['@classesListWidget']) == nil ||
  270. $receiver == undefined) {
  271. self['@classesListWidget'] = smalltalk.send(smalltalk.HLClassesListWidget || HLClassesListWidget, "_on_", [self]);
  272. $1 = self['@classesListWidget'];
  273. } else {
  274. $1 = self['@classesListWidget'];
  275. }
  276. return $1;
  277. }
  278. }),
  279. smalltalk.HLBrowser);
  280. smalltalk.addMethod(
  281. "_environment",
  282. smalltalk.method({
  283. selector: "environment",
  284. fn: function () {
  285. var self = this;
  286. var $1;
  287. if (($receiver = self['@environment']) == nil || $receiver == undefined) {
  288. self['@environment'] = smalltalk.send(smalltalk.Smalltalk || Smalltalk, "_current", []);
  289. $1 = self['@environment'];
  290. } else {
  291. $1 = self['@environment'];
  292. }
  293. return $1;
  294. }
  295. }),
  296. smalltalk.HLBrowser);
  297. smalltalk.addMethod(
  298. "_environment_",
  299. smalltalk.method({
  300. selector: "environment:",
  301. fn: function (anEnvironment) {
  302. var self = this;
  303. self['@environment'] = anEnvironment;
  304. return self;
  305. }
  306. }),
  307. smalltalk.HLBrowser);
  308. smalltalk.addMethod(
  309. "_packagesListWidget",
  310. smalltalk.method({
  311. selector: "packagesListWidget",
  312. fn: function () {
  313. var self = this;
  314. var $1;
  315. if (($receiver = self['@packagesListWidget']) == nil ||
  316. $receiver == undefined) {
  317. self['@packagesListWidget'] = smalltalk.send(smalltalk.HLPackagesListWidget || HLPackagesListWidget, "_on_", [self]);
  318. $1 = self['@packagesListWidget'];
  319. } else {
  320. $1 = self['@packagesListWidget'];
  321. }
  322. return $1;
  323. }
  324. }),
  325. smalltalk.HLBrowser);
  326. smalltalk.addMethod(
  327. "_renderContentOn_",
  328. smalltalk.method({
  329. selector: "renderContentOn:",
  330. fn: function (html){
  331. var self=this;
  332. 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((smalltalk.HLVerticalSplitter || HLVerticalSplitter),"_with_with_",[smalltalk.send(self,"_packagesListWidget",[]),smalltalk.send(self,"_classesListWidget",[])]),smalltalk.send((smalltalk.HLVerticalSplitter || HLVerticalSplitter),"_with_with_",["Protocols","Methods"])]),"Source Code"])])]);
  333. return self}
  334. }),
  335. smalltalk.HLBrowser);
  336. smalltalk.addMethod(
  337. "_renderTopPanesOn_",
  338. smalltalk.method({
  339. selector: "renderTopPanesOn:",
  340. fn: function (html) {
  341. var self = this;
  342. var $1, $2, $3, $4, $5, $6, $7, $8;
  343. $1 = smalltalk.send(html, "_div", []);
  344. smalltalk.send($1, "_class_", ["pane"]);
  345. $2 = smalltalk.send($1, "_with_", [smalltalk.send(self, "_packagesListWidget", [])]);
  346. $3 = smalltalk.send(html, "_div", []);
  347. smalltalk.send($3, "_class_", ["pane"]);
  348. $4 = smalltalk.send($3, "_with_", [smalltalk.send(self, "_classesListWidget", [])]);
  349. $5 = smalltalk.send(html, "_div", []);
  350. smalltalk.send($5, "_class_", ["pane"]);
  351. $6 = smalltalk.send($5, "_with_", ["hello"]);
  352. $7 = smalltalk.send(html, "_div", []);
  353. smalltalk.send($7, "_class_", ["pane"]);
  354. $8 = smalltalk.send($7, "_with_", ["world"]);
  355. return self;
  356. }
  357. }),
  358. smalltalk.HLBrowser);
  359. smalltalk.addMethod(
  360. "_selectPackage_",
  361. smalltalk.method({
  362. selector: "selectPackage:",
  363. fn: function (aPackage) {
  364. var self = this;
  365. self['@selectedPackage'] = aPackage;
  366. self['@selectedClass'] = nil;
  367. smalltalk.send(smalltalk.send(self, "_classesListWidget", []), "_package_", [aPackage]);
  368. return self;
  369. }
  370. }),
  371. smalltalk.HLBrowser);
  372. smalltalk.addMethod(
  373. "_selectedPackage",
  374. smalltalk.method({
  375. selector: "selectedPackage",
  376. fn: function () {
  377. var self = this;
  378. return self['@selectedPackage'];
  379. }
  380. }),
  381. smalltalk.HLBrowser);
  382. smalltalk.HLBrowser.klass.iVarNames = ['nextId'];
  383. smalltalk.addMethod(
  384. "_canBeOpenAsTab",
  385. smalltalk.method({
  386. selector: "canBeOpenAsTab",
  387. fn: function () {
  388. var self = this;
  389. return true;
  390. }
  391. }),
  392. smalltalk.HLBrowser.klass);
  393. smalltalk.addMethod(
  394. "_nextId",
  395. smalltalk.method({
  396. selector: "nextId",
  397. fn: function () {
  398. var self = this;
  399. var $1;
  400. if (($receiver = self['@nextId']) == nil || $receiver == undefined) {
  401. self['@nextId'] = 0;
  402. self['@nextId'];
  403. } else {
  404. self['@nextId'];
  405. }
  406. $1 = smalltalk.send("browser_", "__comma", [smalltalk.send(smalltalk.send(self['@nextId'], "__plus", [1]), "_asString", [])]);
  407. return $1;
  408. }
  409. }),
  410. smalltalk.HLBrowser.klass);
  411. smalltalk.addMethod(
  412. "_tabLabel",
  413. smalltalk.method({
  414. selector: "tabLabel",
  415. fn: function () {
  416. var self = this;
  417. return "Browser";
  418. }
  419. }),
  420. smalltalk.HLBrowser.klass);
  421. smalltalk.addMethod(
  422. "_tabPriority",
  423. smalltalk.method({
  424. selector: "tabPriority",
  425. fn: function () {
  426. var self = this;
  427. return 0;
  428. }
  429. }),
  430. smalltalk.HLBrowser.klass);
  431. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Widgets');
  432. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Widgets');
  433. smalltalk.addMethod(
  434. "_blur",
  435. smalltalk.method({
  436. selector: "blur",
  437. fn: function () {
  438. var self = this;
  439. smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_removeClass_", [smalltalk.send(self, "_focusClass", [])]);
  440. return self;
  441. }
  442. }),
  443. smalltalk.HLFocusableWidget);
  444. smalltalk.addMethod(
  445. "_focus",
  446. smalltalk.method({
  447. selector: "focus",
  448. fn: function () {
  449. var self = this;
  450. smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_addClass_", [smalltalk.send(self, "_focusClass", [])]);
  451. return self;
  452. }
  453. }),
  454. smalltalk.HLFocusableWidget);
  455. smalltalk.addMethod(
  456. "_focusClass",
  457. smalltalk.method({
  458. selector: "focusClass",
  459. fn: function () {
  460. var self = this;
  461. return "focused";
  462. }
  463. }),
  464. smalltalk.HLFocusableWidget);
  465. smalltalk.addMethod(
  466. "_hasFocus",
  467. smalltalk.method({
  468. selector: "hasFocus",
  469. fn: function () {
  470. var self = this;
  471. var $1;
  472. $1 = smalltalk.send(smalltalk.send(self['@rootDiv'], "_notNil", []), "_and_", [function () {return smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_hasClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
  473. return $1;
  474. }
  475. }),
  476. smalltalk.HLFocusableWidget);
  477. smalltalk.addMethod(
  478. "_renderContentOn_",
  479. smalltalk.method({
  480. selector: "renderContentOn:",
  481. fn: function (html) {
  482. var self = this;
  483. return self;
  484. }
  485. }),
  486. smalltalk.HLFocusableWidget);
  487. smalltalk.addMethod(
  488. "_renderHiddenInputOn_",
  489. smalltalk.method({
  490. selector: "renderHiddenInputOn:",
  491. fn: function (html) {
  492. var self = this;
  493. var $1, $2;
  494. $1 = smalltalk.send(html, "_input", []);
  495. smalltalk.send($1, "_style_", ["position: absolute; left: -100000px;"]);
  496. smalltalk.send($1, "_onBlur_", [function () {return smalltalk.send(self, "_blur", []);}]);
  497. $2 = smalltalk.send($1, "_onFocus_", [function () {return smalltalk.send(self, "_focus", []);}]);
  498. self['@hiddenInput'] = $2;
  499. return self;
  500. }
  501. }),
  502. smalltalk.HLFocusableWidget);
  503. smalltalk.addMethod(
  504. "_renderOn_",
  505. smalltalk.method({
  506. selector: "renderOn:",
  507. fn: function (html) {
  508. var self = this;
  509. var $1, $2;
  510. smalltalk.send(self, "_renderHiddenInputOn_", [html]);
  511. $1 = smalltalk.send(html, "_div", []);
  512. smalltalk.send($1, "_class_", ["hl_widget"]);
  513. smalltalk.send($1, "_onClick_", [function () {return smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_focus", []);}]);
  514. $2 = smalltalk.send($1, "_with_", [function () {return smalltalk.send(self, "_renderContentOn_", [html]);}]);
  515. self['@rootDiv'] = $2;
  516. return self;
  517. }
  518. }),
  519. smalltalk.HLFocusableWidget);
  520. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Widgets');
  521. smalltalk.addMethod(
  522. "_activateListItem_",
  523. smalltalk.method({
  524. selector: "activateListItem:",
  525. fn: function (aListItem) {
  526. var self = this;
  527. smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aListItem, "_asJQuery", []), "_parent", []), "_children", []), "_removeClass_", ["active"]);
  528. smalltalk.send(smalltalk.send(aListItem, "_asJQuery", []), "_addClass_", ["active"]);
  529. return self;
  530. }
  531. }),
  532. smalltalk.HLListWidget);
  533. smalltalk.addMethod(
  534. "_cssClassForItem_",
  535. smalltalk.method({
  536. selector: "cssClassForItem:",
  537. fn: function (anObject) {
  538. var self = this;
  539. var $2, $1;
  540. $2 = smalltalk.send(smalltalk.send(self, "_selectedItem", []), "__eq", [anObject]);
  541. if (smalltalk.assert($2)) {
  542. $1 = "active";
  543. } else {
  544. $1 = "inactive";
  545. }
  546. return $1;
  547. }
  548. }),
  549. smalltalk.HLListWidget);
  550. smalltalk.addMethod(
  551. "_items",
  552. smalltalk.method({
  553. selector: "items",
  554. fn: function () {
  555. var self = this;
  556. var $1;
  557. $1 = smalltalk.send(self, "_subclassResponsibility", []);
  558. return $1;
  559. }
  560. }),
  561. smalltalk.HLListWidget);
  562. smalltalk.addMethod(
  563. "_renderContentOn_",
  564. smalltalk.method({
  565. selector: "renderContentOn:",
  566. fn: function (html) {
  567. var self = this;
  568. var $1, $2;
  569. $1 = smalltalk.send(html, "_ul", []);
  570. smalltalk.send($1, "_class_", ["nav nav-pills nav-stacked"]);
  571. $2 = smalltalk.send($1, "_with_", [function () {return smalltalk.send(smalltalk.send(self, "_items", []), "_do_", [function (each) {return smalltalk.send(self, "_renderItem_on_", [each, html]);}]);}]);
  572. return self;
  573. }
  574. }),
  575. smalltalk.HLListWidget);
  576. smalltalk.addMethod(
  577. "_renderItem_on_",
  578. smalltalk.method({
  579. selector: "renderItem:on:",
  580. fn: function (anObject, html) {
  581. var self = this;
  582. var $2, $3, $1;
  583. var li;
  584. li = smalltalk.send(html, "_li", []);
  585. smalltalk.send(li, "_class_", [smalltalk.send(self, "_cssClassForItem_", [anObject])]);
  586. $1 = smalltalk.send(li, "_with_", [function () {$2 = smalltalk.send(html, "_a", []);smalltalk.send($2, "_with_", [function () {smalltalk.send(smalltalk.send(html, "_tag_", ["i"]), "_class_", [smalltalk.send(anObject, "_heliosListIcon", [])]);return smalltalk.send(self, "_renderItemLabel_on_", [anObject, html]);}]);$3 = smalltalk.send($2, "_onClick_", [function () {smalltalk.send(self, "_activateListItem_", [li]);return smalltalk.send(self, "_selectItem_", [anObject]);}]);return $3;}]);
  587. return self;
  588. }
  589. }),
  590. smalltalk.HLListWidget);
  591. smalltalk.addMethod(
  592. "_renderItemLabel_on_",
  593. smalltalk.method({
  594. selector: "renderItemLabel:on:",
  595. fn: function (anObject, html) {
  596. var self = this;
  597. smalltalk.send(html, "_with_", [smalltalk.send(anObject, "_asString", [])]);
  598. return self;
  599. }
  600. }),
  601. smalltalk.HLListWidget);
  602. smalltalk.addMethod(
  603. "_selectItem_",
  604. smalltalk.method({
  605. selector: "selectItem:",
  606. fn: function (anObject) {
  607. var self = this;
  608. smalltalk.send(self, "_selectedItem_", [anObject]);
  609. return self;
  610. }
  611. }),
  612. smalltalk.HLListWidget);
  613. smalltalk.addMethod(
  614. "_selectedItem",
  615. smalltalk.method({
  616. selector: "selectedItem",
  617. fn: function () {
  618. var self = this;
  619. var $1;
  620. if (($receiver = self['@selectedItem']) == nil ||
  621. $receiver == undefined) {
  622. $1 = smalltalk.send(smalltalk.send(self, "_items", []), "_ifNotEmpty_", [function () {return smalltalk.send(smalltalk.send(self, "_items", []), "_first", []);}]);
  623. } else {
  624. $1 = self['@selectedItem'];
  625. }
  626. return $1;
  627. }
  628. }),
  629. smalltalk.HLListWidget);
  630. smalltalk.addMethod(
  631. "_selectedItem_",
  632. smalltalk.method({
  633. selector: "selectedItem:",
  634. fn: function (anObject) {
  635. var self = this;
  636. self['@selectedItem'] = anObject;
  637. return self;
  638. }
  639. }),
  640. smalltalk.HLListWidget);
  641. smalltalk.addClass('HLBrowserListWidget', smalltalk.HLListWidget, ['browser'], 'Helios-Widgets');
  642. smalltalk.addMethod(
  643. "_browser",
  644. smalltalk.method({
  645. selector: "browser",
  646. fn: function () {
  647. var self = this;
  648. return self['@browser'];
  649. }
  650. }),
  651. smalltalk.HLBrowserListWidget);
  652. smalltalk.addMethod(
  653. "_browser_",
  654. smalltalk.method({
  655. selector: "browser:",
  656. fn: function (aBrowser) {
  657. var self = this;
  658. self['@browser'] = aBrowser;
  659. return self;
  660. }
  661. }),
  662. smalltalk.HLBrowserListWidget);
  663. smalltalk.addMethod(
  664. "_on_",
  665. smalltalk.method({
  666. selector: "on:",
  667. fn: function (aBrowser) {
  668. var self = this;
  669. var $2, $3, $1;
  670. $2 = smalltalk.send(self, "_new", []);
  671. smalltalk.send($2, "_browser_", [aBrowser]);
  672. $3 = smalltalk.send($2, "_yourself", []);
  673. $1 = $3;
  674. return $1;
  675. }
  676. }),
  677. smalltalk.HLBrowserListWidget.klass);
  678. smalltalk.addClass('HLClassesListWidget', smalltalk.HLBrowserListWidget, ['package'], 'Helios-Widgets');
  679. smalltalk.addMethod(
  680. "_items",
  681. smalltalk.method({
  682. selector: "items",
  683. fn: function () {
  684. var self = this;
  685. var $2, $1;
  686. $2 = smalltalk.send(self, "_package", []);
  687. if (($receiver = $2) == nil || $receiver == undefined) {
  688. $1 = [];
  689. } else {
  690. $1 = smalltalk.send(smalltalk.send(self, "_package", []), "_classes", []);
  691. }
  692. return $1;
  693. }
  694. }),
  695. smalltalk.HLClassesListWidget);
  696. smalltalk.addMethod(
  697. "_package",
  698. smalltalk.method({
  699. selector: "package",
  700. fn: function () {
  701. var self = this;
  702. return self['@package'];
  703. }
  704. }),
  705. smalltalk.HLClassesListWidget);
  706. smalltalk.addMethod(
  707. "_package_",
  708. smalltalk.method({
  709. selector: "package:",
  710. fn: function (aPackage) {
  711. var self = this;
  712. self['@package'] = aPackage;
  713. smalltalk.send(self, "_refresh", []);
  714. return self;
  715. }
  716. }),
  717. smalltalk.HLClassesListWidget);
  718. smalltalk.addClass('HLPackagesListWidget', smalltalk.HLBrowserListWidget, [], 'Helios-Widgets');
  719. smalltalk.addMethod(
  720. "_browser",
  721. smalltalk.method({
  722. selector: "browser",
  723. fn: function () {
  724. var self = this;
  725. return self['@browser'];
  726. }
  727. }),
  728. smalltalk.HLPackagesListWidget);
  729. smalltalk.addMethod(
  730. "_browser_",
  731. smalltalk.method({
  732. selector: "browser:",
  733. fn: function (aBrowser) {
  734. var self = this;
  735. self['@browser'] = aBrowser;
  736. return self;
  737. }
  738. }),
  739. smalltalk.HLPackagesListWidget);
  740. smalltalk.addMethod(
  741. "_environment",
  742. smalltalk.method({
  743. selector: "environment",
  744. fn: function () {
  745. var self = this;
  746. var $1;
  747. $1 = smalltalk.send(smalltalk.send(self, "_browser", []), "_environment", []);
  748. return $1;
  749. }
  750. }),
  751. smalltalk.HLPackagesListWidget);
  752. smalltalk.addMethod(
  753. "_items",
  754. smalltalk.method({
  755. selector: "items",
  756. fn: function () {
  757. var self = this;
  758. var $1;
  759. $1 = smalltalk.send(smalltalk.send(self, "_environment", []), "_packages", []);
  760. return $1;
  761. }
  762. }),
  763. smalltalk.HLPackagesListWidget);
  764. smalltalk.addMethod(
  765. "_selectItem_",
  766. smalltalk.method({
  767. selector: "selectItem:",
  768. fn: function (aPackage) {
  769. var self = this;
  770. smalltalk.send(self, "_selectItem_", [aPackage], smalltalk.HLBrowserListWidget);
  771. smalltalk.send(smalltalk.send(self, "_browser", []), "_selectPackage_", [aPackage]);
  772. return self;
  773. }
  774. }),
  775. smalltalk.HLPackagesListWidget);
  776. smalltalk.addClass('HLInspector', smalltalk.HLWidget, [], 'Helios-Widgets');
  777. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Widgets');
  778. smalltalk.addMethod(
  779. "_canBeOpenAsTab",
  780. smalltalk.method({
  781. selector: "canBeOpenAsTab",
  782. fn: function () {
  783. var self = this;
  784. return true;
  785. }
  786. }),
  787. smalltalk.HLSUnit.klass);
  788. smalltalk.addMethod(
  789. "_tabLabel",
  790. smalltalk.method({
  791. selector: "tabLabel",
  792. fn: function () {
  793. var self = this;
  794. return "SUnit";
  795. }
  796. }),
  797. smalltalk.HLSUnit.klass);
  798. smalltalk.addMethod(
  799. "_tabPriority",
  800. smalltalk.method({
  801. selector: "tabPriority",
  802. fn: function () {
  803. var self = this;
  804. return 1000;
  805. }
  806. }),
  807. smalltalk.HLSUnit.klass);
  808. smalltalk.addClass('HLTabManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'announcer'], 'Helios-Widgets');
  809. smalltalk.addMethod(
  810. "_activate_",
  811. smalltalk.method({
  812. selector: "activate:",
  813. fn: function (aTab) {
  814. var self = this;
  815. var $1;
  816. self['@activeTab'] = aTab;
  817. smalltalk.send(self, "_refresh", []);
  818. $1 = smalltalk.send(self, "_show_", [aTab]);
  819. return self;
  820. }
  821. }),
  822. smalltalk.HLTabManager);
  823. smalltalk.addMethod(
  824. "_activeTab",
  825. smalltalk.method({
  826. selector: "activeTab",
  827. fn: function () {
  828. var self = this;
  829. return self['@activeTab'];
  830. }
  831. }),
  832. smalltalk.HLTabManager);
  833. smalltalk.addMethod(
  834. "_addTab_",
  835. smalltalk.method({
  836. selector: "addTab:",
  837. fn: function (aTab) {
  838. var self = this;
  839. smalltalk.send(smalltalk.send(self, "_tabs", []), "_add_", [aTab]);
  840. smalltalk.send(self, "_activate_", [aTab]);
  841. return self;
  842. }
  843. }),
  844. smalltalk.HLTabManager);
  845. smalltalk.addMethod(
  846. "_announcer",
  847. smalltalk.method({
  848. selector: "announcer",
  849. fn: function () {
  850. var self = this;
  851. var $1;
  852. if (($receiver = self['@announcer']) == nil || $receiver == undefined) {
  853. self['@announcer'] = smalltalk.send(smalltalk.Announcer || Announcer, "_new", []);
  854. $1 = self['@announcer'];
  855. } else {
  856. $1 = self['@announcer'];
  857. }
  858. return $1;
  859. }
  860. }),
  861. smalltalk.HLTabManager);
  862. smalltalk.addMethod(
  863. "_refresh",
  864. smalltalk.method({
  865. selector: "refresh",
  866. fn: function () {
  867. var self = this;
  868. smalltalk.send(smalltalk.send(window, "_jQuery_", [".navbar"]), "_remove", []);
  869. smalltalk.send(smalltalk.send(window, "_jQuery_", ["#container"]), "_remove", []);
  870. smalltalk.send(self, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
  871. return self;
  872. }
  873. }),
  874. smalltalk.HLTabManager);
  875. smalltalk.addMethod(
  876. "_removeTab_",
  877. smalltalk.method({
  878. selector: "removeTab:",
  879. fn: function (aTab) {
  880. var self = this;
  881. var $1;
  882. $1 = smalltalk.send(smalltalk.send(self, "_tabs", []), "_includes_", [aTab]);
  883. if (!smalltalk.assert($1)) {
  884. return self;
  885. }
  886. smalltalk.send(smalltalk.send(self, "_tabs", []), "_remove_", [aTab]);
  887. smalltalk.send(self, "_refresh", []);
  888. return self;
  889. }
  890. }),
  891. smalltalk.HLTabManager);
  892. smalltalk.addMethod(
  893. "_renderAddOn_",
  894. smalltalk.method({
  895. selector: "renderAddOn:",
  896. fn: function (html) {
  897. var self = this;
  898. var $1, $3, $4, $5, $7, $8, $6, $2;
  899. $1 = smalltalk.send(html, "_li", []);
  900. smalltalk.send($1, "_class_", ["dropdown"]);
  901. $2 = smalltalk.send($1, "_with_", [function () {$3 = smalltalk.send(html, "_a", []);smalltalk.send($3, "_class_", ["dropdown-toggle"]);smalltalk.send($3, "_at_put_", ["data-toggle", "dropdown"]);$4 = smalltalk.send($3, "_with_", [function () {smalltalk.send(html, "_with_", ["Open..."]);return smalltalk.send(smalltalk.send(html, "_tag_", ["b"]), "_class_", ["caret"]);}]);$4;$5 = smalltalk.send(html, "_ul", []);smalltalk.send($5, "_class_", ["dropdown-menu"]);$6 = smalltalk.send($5, "_with_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.HLWidget || HLWidget, "_withAllSubclasses", []), "_select_", [function (each) {return smalltalk.send(each, "_canBeOpenAsTab", []);}]), "_sorted_", [function (a, b) {return smalltalk.send(smalltalk.send(a, "_tabPriority", []), "__lt", [smalltalk.send(b, "_tabPriority", [])]);}]), "_do_", [function (each) {return smalltalk.send(smalltalk.send(html, "_li", []), "_with_", [function () {$7 = smalltalk.send(html, "_a", []);smalltalk.send($7, "_with_", [smalltalk.send(each, "_tabLabel", [])]);$8 = smalltalk.send($7, "_onClick_", [function () {return smalltalk.send(each, "_openAsTab", []);}]);return $8;}]);}]);}]);return $6;}]);
  902. return self;
  903. }
  904. }),
  905. smalltalk.HLTabManager);
  906. smalltalk.addMethod(
  907. "_renderContentOn_",
  908. smalltalk.method({
  909. selector: "renderContentOn:",
  910. fn: function (html) {
  911. var self = this;
  912. var $1, $3, $4, $2;
  913. $1 = smalltalk.send(html, "_div", []);
  914. smalltalk.send($1, "_class_", ["navbar navbar-fixed-top"]);
  915. $2 = smalltalk.send($1, "_with_", [function () {$3 = smalltalk.send(html, "_div", []);smalltalk.send($3, "_class_", ["navbar-inner"]);$4 = smalltalk.send($3, "_with_", [function () {return smalltalk.send(self, "_renderTabsOn_", [html]);}]);return $4;}]);
  916. smalltalk.send(smalltalk.send(html, "_div", []), "_id_", ["container"]);
  917. return self;
  918. }
  919. }),
  920. smalltalk.HLTabManager);
  921. smalltalk.addMethod(
  922. "_renderTabsOn_",
  923. smalltalk.method({
  924. selector: "renderTabsOn:",
  925. fn: function (html) {
  926. var self = this;
  927. var $1, $3, $5, $4, $7, $8, $6, $2;
  928. $1 = smalltalk.send(html, "_ul", []);
  929. smalltalk.send($1, "_class_", ["nav"]);
  930. $2 = smalltalk.send($1, "_with_", [function () {smalltalk.send(smalltalk.send(self, "_tabs", []), "_do_", [function (each) {$3 = smalltalk.send(html, "_li", []);$5 = smalltalk.send(each, "_isActive", []);if (smalltalk.assert($5)) {$4 = "active";} else {$4 = "inactive";}smalltalk.send($3, "_class_", [$4]);$6 = smalltalk.send($3, "_with_", [function () {$7 = smalltalk.send(html, "_a", []);smalltalk.send($7, "_with_", [function () {smalltalk.send(smalltalk.send(smalltalk.send(html, "_tag_", ["i"]), "_class_", ["icon-remove-circle"]), "_onClick_", [function () {return smalltalk.send(self, "_removeTab_", [each]);}]);return smalltalk.send(html, "_with_", [smalltalk.send(each, "_label", [])]);}]);$8 = smalltalk.send($7, "_onClick_", [function () {return smalltalk.send(each, "_activate", []);}]);return $8;}]);return $6;}]);return smalltalk.send(self, "_renderAddOn_", [html]);}]);
  931. return self;
  932. }
  933. }),
  934. smalltalk.HLTabManager);
  935. smalltalk.addMethod(
  936. "_show_",
  937. smalltalk.method({
  938. selector: "show:",
  939. fn: function (aTab) {
  940. var self = this;
  941. smalltalk.send(smalltalk.send(window, "_jQuery_", ["#container"]), "_empty", []);
  942. smalltalk.send(smalltalk.send(aTab, "_widget", []), "_appendToJQuery_", [smalltalk.send("#container", "_asJQuery", [])]);
  943. return self;
  944. }
  945. }),
  946. smalltalk.HLTabManager);
  947. smalltalk.addMethod(
  948. "_tabs",
  949. smalltalk.method({
  950. selector: "tabs",
  951. fn: function () {
  952. var self = this;
  953. var $1;
  954. if (($receiver = self['@tabs']) == nil || $receiver == undefined) {
  955. self['@tabs'] = smalltalk.send(smalltalk.OrderedCollection || OrderedCollection, "_new", []);
  956. $1 = self['@tabs'];
  957. } else {
  958. $1 = self['@tabs'];
  959. }
  960. return $1;
  961. }
  962. }),
  963. smalltalk.HLTabManager);
  964. smalltalk.HLTabManager.klass.iVarNames = ['current'];
  965. smalltalk.addMethod(
  966. "_current",
  967. smalltalk.method({
  968. selector: "current",
  969. fn: function () {
  970. var self = this;
  971. var $1;
  972. if (($receiver = self['@current']) == nil || $receiver == undefined) {
  973. self['@current'] = smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
  974. $1 = self['@current'];
  975. } else {
  976. $1 = self['@current'];
  977. }
  978. return $1;
  979. }
  980. }),
  981. smalltalk.HLTabManager.klass);
  982. smalltalk.addMethod(
  983. "_initialize",
  984. smalltalk.method({
  985. selector: "initialize",
  986. fn: function () {
  987. var self = this;
  988. smalltalk.send(smalltalk.send(self, "_current", []), "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
  989. return self;
  990. }
  991. }),
  992. smalltalk.HLTabManager.klass);
  993. smalltalk.addMethod(
  994. "_new",
  995. smalltalk.method({
  996. selector: "new",
  997. fn: function () {
  998. var self = this;
  999. smalltalk.send(self, "_shouldNotImplement", []);
  1000. return self;
  1001. }
  1002. }),
  1003. smalltalk.HLTabManager.klass);
  1004. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Widgets');
  1005. smalltalk.addMethod(
  1006. "_canBeOpenAsTab",
  1007. smalltalk.method({
  1008. selector: "canBeOpenAsTab",
  1009. fn: function () {
  1010. var self = this;
  1011. return true;
  1012. }
  1013. }),
  1014. smalltalk.HLTranscript.klass);
  1015. smalltalk.addMethod(
  1016. "_tabLabel",
  1017. smalltalk.method({
  1018. selector: "tabLabel",
  1019. fn: function () {
  1020. var self = this;
  1021. return "Transcript";
  1022. }
  1023. }),
  1024. smalltalk.HLTranscript.klass);
  1025. smalltalk.addMethod(
  1026. "_tabPriority",
  1027. smalltalk.method({
  1028. selector: "tabPriority",
  1029. fn: function () {
  1030. var self = this;
  1031. return 600;
  1032. }
  1033. }),
  1034. smalltalk.HLTranscript.klass);
  1035. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, [], 'Helios-Widgets');
  1036. smalltalk.addMethod(
  1037. "_canBeOpenAsTab",
  1038. smalltalk.method({
  1039. selector: "canBeOpenAsTab",
  1040. fn: function () {
  1041. var self = this;
  1042. return true;
  1043. }
  1044. }),
  1045. smalltalk.HLWorkspace.klass);
  1046. smalltalk.addMethod(
  1047. "_tabLabel",
  1048. smalltalk.method({
  1049. selector: "tabLabel",
  1050. fn: function () {
  1051. var self = this;
  1052. return "Workspace";
  1053. }
  1054. }),
  1055. smalltalk.HLWorkspace.klass);
  1056. smalltalk.addMethod(
  1057. "_tabPriority",
  1058. smalltalk.method({
  1059. selector: "tabPriority",
  1060. fn: function () {
  1061. var self = this;
  1062. return 10;
  1063. }
  1064. }),
  1065. smalltalk.HLWorkspace.klass);
  1066. smalltalk.addMethod(
  1067. "_heliosListIcon",
  1068. smalltalk.method({
  1069. selector: "heliosListIcon",
  1070. fn: function () {
  1071. var self = this;
  1072. return "";
  1073. }
  1074. }),
  1075. smalltalk.Object);