1
0

Helios-Commands-Core.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950
  1. define("amber_core/Helios-Commands-Core", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Helios-Commands-Core');
  3. smalltalk.packages["Helios-Commands-Core"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLCommand', globals.Object, ['input'], 'Helios-Commands-Core');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "asActionBinding",
  8. protocol: 'converting',
  9. fn: function (){
  10. var self=this;
  11. function $HLBindingAction(){return globals.HLBindingAction||(typeof HLBindingAction=="undefined"?nil:HLBindingAction)}
  12. return smalltalk.withContext(function($ctx1) {
  13. var $2,$3,$1;
  14. $2=_st($HLBindingAction())._on_labelled_(self._keyCode(),self._label());
  15. _st($2)._command_(self);
  16. $3=_st($2)._yourself();
  17. $1=$3;
  18. return $1;
  19. }, function($ctx1) {$ctx1.fill(self,"asActionBinding",{},globals.HLCommand)})},
  20. args: [],
  21. source: "asActionBinding\x0a\x09^ (HLBindingAction on: self keyCode labelled: self label)\x0a \x09command: self;\x0a\x09\x09yourself",
  22. messageSends: ["command:", "on:labelled:", "keyCode", "label", "yourself"],
  23. referencedClasses: ["HLBindingAction"]
  24. }),
  25. globals.HLCommand);
  26. smalltalk.addMethod(
  27. smalltalk.method({
  28. selector: "asBinding",
  29. protocol: 'converting',
  30. fn: function (){
  31. var self=this;
  32. return smalltalk.withContext(function($ctx1) {
  33. var $2,$1;
  34. $2=self._isBindingGroup();
  35. if(smalltalk.assert($2)){
  36. $1=self._asGroupBinding();
  37. } else {
  38. $1=self._asActionBinding();
  39. };
  40. return $1;
  41. }, function($ctx1) {$ctx1.fill(self,"asBinding",{},globals.HLCommand)})},
  42. args: [],
  43. source: "asBinding\x0a\x09^ self isBindingGroup\x0a\x09\x09ifTrue: [ self asGroupBinding ]\x0a\x09\x09ifFalse: [ self asActionBinding ]",
  44. messageSends: ["ifTrue:ifFalse:", "isBindingGroup", "asGroupBinding", "asActionBinding"],
  45. referencedClasses: []
  46. }),
  47. globals.HLCommand);
  48. smalltalk.addMethod(
  49. smalltalk.method({
  50. selector: "asGroupBinding",
  51. protocol: 'converting',
  52. fn: function (){
  53. var self=this;
  54. function $HLBindingGroup(){return globals.HLBindingGroup||(typeof HLBindingGroup=="undefined"?nil:HLBindingGroup)}
  55. return smalltalk.withContext(function($ctx1) {
  56. var $1;
  57. $1=_st($HLBindingGroup())._on_labelled_(self._keyCode(),self._label());
  58. return $1;
  59. }, function($ctx1) {$ctx1.fill(self,"asGroupBinding",{},globals.HLCommand)})},
  60. args: [],
  61. source: "asGroupBinding\x0a\x09^ HLBindingGroup \x0a\x09\x09on: self keyCode\x0a\x09\x09labelled: self label",
  62. messageSends: ["on:labelled:", "keyCode", "label"],
  63. referencedClasses: ["HLBindingGroup"]
  64. }),
  65. globals.HLCommand);
  66. smalltalk.addMethod(
  67. smalltalk.method({
  68. selector: "commandError:",
  69. protocol: 'error handling',
  70. fn: function (aString){
  71. var self=this;
  72. return smalltalk.withContext(function($ctx1) {
  73. self._error_(aString);
  74. return self}, function($ctx1) {$ctx1.fill(self,"commandError:",{aString:aString},globals.HLCommand)})},
  75. args: ["aString"],
  76. source: "commandError: aString\x0a\x09self error: aString",
  77. messageSends: ["error:"],
  78. referencedClasses: []
  79. }),
  80. globals.HLCommand);
  81. smalltalk.addMethod(
  82. smalltalk.method({
  83. selector: "defaultInput",
  84. protocol: 'defaults',
  85. fn: function (){
  86. var self=this;
  87. return "";
  88. },
  89. args: [],
  90. source: "defaultInput\x0a\x09^ ''",
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. globals.HLCommand);
  95. smalltalk.addMethod(
  96. smalltalk.method({
  97. selector: "documentation",
  98. protocol: 'accessing',
  99. fn: function (){
  100. var self=this;
  101. return smalltalk.withContext(function($ctx1) {
  102. var $1;
  103. $1=_st(self._class())._documentation();
  104. return $1;
  105. }, function($ctx1) {$ctx1.fill(self,"documentation",{},globals.HLCommand)})},
  106. args: [],
  107. source: "documentation\x0a\x09^ self class documentation",
  108. messageSends: ["documentation", "class"],
  109. referencedClasses: []
  110. }),
  111. globals.HLCommand);
  112. smalltalk.addMethod(
  113. smalltalk.method({
  114. selector: "execute",
  115. protocol: 'executing',
  116. fn: function (){
  117. var self=this;
  118. return self},
  119. args: [],
  120. source: "execute",
  121. messageSends: [],
  122. referencedClasses: []
  123. }),
  124. globals.HLCommand);
  125. smalltalk.addMethod(
  126. smalltalk.method({
  127. selector: "input",
  128. protocol: 'accessing',
  129. fn: function (){
  130. var self=this;
  131. var $1;
  132. $1=self["@input"];
  133. return $1;
  134. },
  135. args: [],
  136. source: "input\x0a\x09^ input",
  137. messageSends: [],
  138. referencedClasses: []
  139. }),
  140. globals.HLCommand);
  141. smalltalk.addMethod(
  142. smalltalk.method({
  143. selector: "input:",
  144. protocol: 'accessing',
  145. fn: function (aString){
  146. var self=this;
  147. var $1;
  148. self["@input"]=aString;
  149. $1=self["@input"];
  150. return $1;
  151. },
  152. args: ["aString"],
  153. source: "input: aString\x0a\x09^ input := aString",
  154. messageSends: [],
  155. referencedClasses: []
  156. }),
  157. globals.HLCommand);
  158. smalltalk.addMethod(
  159. smalltalk.method({
  160. selector: "inputCompletion",
  161. protocol: 'accessing',
  162. fn: function (){
  163. var self=this;
  164. var $1;
  165. $1=[];
  166. return $1;
  167. },
  168. args: [],
  169. source: "inputCompletion\x0a\x09^ #()",
  170. messageSends: [],
  171. referencedClasses: []
  172. }),
  173. globals.HLCommand);
  174. smalltalk.addMethod(
  175. smalltalk.method({
  176. selector: "inputLabel",
  177. protocol: 'accessing',
  178. fn: function (){
  179. var self=this;
  180. return smalltalk.withContext(function($ctx1) {
  181. var $1;
  182. $1=self._label();
  183. return $1;
  184. }, function($ctx1) {$ctx1.fill(self,"inputLabel",{},globals.HLCommand)})},
  185. args: [],
  186. source: "inputLabel\x0a\x09^ self label",
  187. messageSends: ["label"],
  188. referencedClasses: []
  189. }),
  190. globals.HLCommand);
  191. smalltalk.addMethod(
  192. smalltalk.method({
  193. selector: "isAction",
  194. protocol: 'testing',
  195. fn: function (){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. var $1;
  199. $1=_st(self._isBindingGroup())._not();
  200. return $1;
  201. }, function($ctx1) {$ctx1.fill(self,"isAction",{},globals.HLCommand)})},
  202. args: [],
  203. source: "isAction\x0a\x09^ self isBindingGroup not",
  204. messageSends: ["not", "isBindingGroup"],
  205. referencedClasses: []
  206. }),
  207. globals.HLCommand);
  208. smalltalk.addMethod(
  209. smalltalk.method({
  210. selector: "isActive",
  211. protocol: 'testing',
  212. fn: function (){
  213. var self=this;
  214. return true;
  215. },
  216. args: [],
  217. source: "isActive\x0a\x09^ true",
  218. messageSends: [],
  219. referencedClasses: []
  220. }),
  221. globals.HLCommand);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "isBindingGroup",
  225. protocol: 'testing',
  226. fn: function (){
  227. var self=this;
  228. return smalltalk.withContext(function($ctx1) {
  229. var $1;
  230. $1=_st(_st(_st(self._class())._methodDictionary())._includesKey_("execute"))._not();
  231. return $1;
  232. }, function($ctx1) {$ctx1.fill(self,"isBindingGroup",{},globals.HLCommand)})},
  233. args: [],
  234. source: "isBindingGroup\x0a\x09^ (self class methodDictionary includesKey: 'execute') not",
  235. messageSends: ["not", "includesKey:", "methodDictionary", "class"],
  236. referencedClasses: []
  237. }),
  238. globals.HLCommand);
  239. smalltalk.addMethod(
  240. smalltalk.method({
  241. selector: "isInputRequired",
  242. protocol: 'testing',
  243. fn: function (){
  244. var self=this;
  245. return false;
  246. },
  247. args: [],
  248. source: "isInputRequired\x0a\x09^ false",
  249. messageSends: [],
  250. referencedClasses: []
  251. }),
  252. globals.HLCommand);
  253. smalltalk.addMethod(
  254. smalltalk.method({
  255. selector: "key",
  256. protocol: 'accessing',
  257. fn: function (){
  258. var self=this;
  259. return smalltalk.withContext(function($ctx1) {
  260. var $1;
  261. $1=_st(self._class())._key();
  262. return $1;
  263. }, function($ctx1) {$ctx1.fill(self,"key",{},globals.HLCommand)})},
  264. args: [],
  265. source: "key\x0a\x09^ self class key",
  266. messageSends: ["key", "class"],
  267. referencedClasses: []
  268. }),
  269. globals.HLCommand);
  270. smalltalk.addMethod(
  271. smalltalk.method({
  272. selector: "keyCode",
  273. protocol: 'accessing',
  274. fn: function (){
  275. var self=this;
  276. return smalltalk.withContext(function($ctx1) {
  277. var $1;
  278. $1=_st(_st(self._key())._asUppercase())._charCodeAt_((1));
  279. return $1;
  280. }, function($ctx1) {$ctx1.fill(self,"keyCode",{},globals.HLCommand)})},
  281. args: [],
  282. source: "keyCode\x0a\x09^ self key asUppercase charCodeAt: 1",
  283. messageSends: ["charCodeAt:", "asUppercase", "key"],
  284. referencedClasses: []
  285. }),
  286. globals.HLCommand);
  287. smalltalk.addMethod(
  288. smalltalk.method({
  289. selector: "label",
  290. protocol: 'accessing',
  291. fn: function (){
  292. var self=this;
  293. return smalltalk.withContext(function($ctx1) {
  294. var $1;
  295. $1=_st(self._class())._label();
  296. return $1;
  297. }, function($ctx1) {$ctx1.fill(self,"label",{},globals.HLCommand)})},
  298. args: [],
  299. source: "label\x0a\x09^ self class label",
  300. messageSends: ["label", "class"],
  301. referencedClasses: []
  302. }),
  303. globals.HLCommand);
  304. smalltalk.addMethod(
  305. smalltalk.method({
  306. selector: "menuLabel",
  307. protocol: 'accessing',
  308. fn: function (){
  309. var self=this;
  310. return smalltalk.withContext(function($ctx1) {
  311. var $1;
  312. $1=_st(self._class())._menuLabel();
  313. return $1;
  314. }, function($ctx1) {$ctx1.fill(self,"menuLabel",{},globals.HLCommand)})},
  315. args: [],
  316. source: "menuLabel\x0a\x09^ self class menuLabel",
  317. messageSends: ["menuLabel", "class"],
  318. referencedClasses: []
  319. }),
  320. globals.HLCommand);
  321. smalltalk.addMethod(
  322. smalltalk.method({
  323. selector: "registerOn:",
  324. protocol: 'registration',
  325. fn: function (aBinding){
  326. var self=this;
  327. return smalltalk.withContext(function($ctx1) {
  328. var $1;
  329. $1=_st(aBinding)._add_(self._asBinding());
  330. return $1;
  331. }, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},globals.HLCommand)})},
  332. args: ["aBinding"],
  333. source: "registerOn: aBinding\x0a\x09^ aBinding add: self asBinding",
  334. messageSends: ["add:", "asBinding"],
  335. referencedClasses: []
  336. }),
  337. globals.HLCommand);
  338. smalltalk.addMethod(
  339. smalltalk.method({
  340. selector: "concreteClasses",
  341. protocol: 'registration',
  342. fn: function (){
  343. var self=this;
  344. var classes;
  345. function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  346. return smalltalk.withContext(function($ctx1) {
  347. var $1,$2;
  348. classes=_st($OrderedCollection())._new();
  349. $1=self._isConcrete();
  350. if(smalltalk.assert($1)){
  351. _st(classes)._add_(self);
  352. };
  353. _st(self._subclasses())._do_((function(each){
  354. return smalltalk.withContext(function($ctx2) {
  355. return _st(classes)._addAll_(_st(each)._concreteClasses());
  356. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  357. $2=classes;
  358. return $2;
  359. }, function($ctx1) {$ctx1.fill(self,"concreteClasses",{classes:classes},globals.HLCommand.klass)})},
  360. args: [],
  361. source: "concreteClasses\x0a\x09| classes |\x0a\x09\x0a\x09classes := OrderedCollection new.\x0a\x09\x0a\x09self isConcrete\x0a\x09\x09ifTrue: [ classes add: self ].\x0a\x09\x09\x0a\x09self subclasses do: [ :each | \x0a\x09\x09classes addAll: each concreteClasses ].\x0a\x09\x09\x0a\x09^ classes",
  362. messageSends: ["new", "ifTrue:", "isConcrete", "add:", "do:", "subclasses", "addAll:", "concreteClasses"],
  363. referencedClasses: ["OrderedCollection"]
  364. }),
  365. globals.HLCommand.klass);
  366. smalltalk.addMethod(
  367. smalltalk.method({
  368. selector: "documentation",
  369. protocol: 'accessing',
  370. fn: function (){
  371. var self=this;
  372. return "";
  373. },
  374. args: [],
  375. source: "documentation\x0a\x09^ ''",
  376. messageSends: [],
  377. referencedClasses: []
  378. }),
  379. globals.HLCommand.klass);
  380. smalltalk.addMethod(
  381. smalltalk.method({
  382. selector: "isConcrete",
  383. protocol: 'testing',
  384. fn: function (){
  385. var self=this;
  386. return smalltalk.withContext(function($ctx1) {
  387. var $1;
  388. $1=_st(self._key())._notNil();
  389. return $1;
  390. }, function($ctx1) {$ctx1.fill(self,"isConcrete",{},globals.HLCommand.klass)})},
  391. args: [],
  392. source: "isConcrete\x0a\x09^ self key notNil",
  393. messageSends: ["notNil", "key"],
  394. referencedClasses: []
  395. }),
  396. globals.HLCommand.klass);
  397. smalltalk.addMethod(
  398. smalltalk.method({
  399. selector: "isValidFor:",
  400. protocol: 'testing',
  401. fn: function (aModel){
  402. var self=this;
  403. return true;
  404. },
  405. args: ["aModel"],
  406. source: "isValidFor: aModel\x0a\x09^ true",
  407. messageSends: [],
  408. referencedClasses: []
  409. }),
  410. globals.HLCommand.klass);
  411. smalltalk.addMethod(
  412. smalltalk.method({
  413. selector: "key",
  414. protocol: 'accessing',
  415. fn: function (){
  416. var self=this;
  417. return nil;
  418. },
  419. args: [],
  420. source: "key\x0a\x09\x22Answer a single character string or nil if no key\x22\x0a\x09\x0a\x09^ nil",
  421. messageSends: [],
  422. referencedClasses: []
  423. }),
  424. globals.HLCommand.klass);
  425. smalltalk.addMethod(
  426. smalltalk.method({
  427. selector: "label",
  428. protocol: 'accessing',
  429. fn: function (){
  430. var self=this;
  431. return "";
  432. },
  433. args: [],
  434. source: "label\x0a\x09^ ''",
  435. messageSends: [],
  436. referencedClasses: []
  437. }),
  438. globals.HLCommand.klass);
  439. smalltalk.addMethod(
  440. smalltalk.method({
  441. selector: "menuLabel",
  442. protocol: 'accessing',
  443. fn: function (){
  444. var self=this;
  445. return smalltalk.withContext(function($ctx1) {
  446. var $1;
  447. $1=self._label();
  448. return $1;
  449. }, function($ctx1) {$ctx1.fill(self,"menuLabel",{},globals.HLCommand.klass)})},
  450. args: [],
  451. source: "menuLabel\x0a\x09^ self label",
  452. messageSends: ["label"],
  453. referencedClasses: []
  454. }),
  455. globals.HLCommand.klass);
  456. smalltalk.addMethod(
  457. smalltalk.method({
  458. selector: "registerConcreteClassesOn:",
  459. protocol: 'accessing',
  460. fn: function (aBinding){
  461. var self=this;
  462. var newBinding;
  463. return smalltalk.withContext(function($ctx1) {
  464. var $1;
  465. $1=self._isConcrete();
  466. if(smalltalk.assert($1)){
  467. newBinding=self._registerOn_(aBinding);
  468. newBinding;
  469. } else {
  470. newBinding=aBinding;
  471. newBinding;
  472. };
  473. _st(self._subclasses())._do_((function(each){
  474. return smalltalk.withContext(function($ctx2) {
  475. return _st(each)._registerConcreteClassesOn_(newBinding);
  476. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  477. return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:",{aBinding:aBinding,newBinding:newBinding},globals.HLCommand.klass)})},
  478. args: ["aBinding"],
  479. source: "registerConcreteClassesOn: aBinding\x0a\x09| newBinding |\x0a\x09\x0a\x09self isConcrete\x0a\x09\x09ifTrue: [ newBinding := self registerOn: aBinding ]\x0a\x09\x09ifFalse: [ newBinding := aBinding ].\x0a\x09\x09\x0a\x09self subclasses do: [ :each | each registerConcreteClassesOn: newBinding ]",
  480. messageSends: ["ifTrue:ifFalse:", "isConcrete", "registerOn:", "do:", "subclasses", "registerConcreteClassesOn:"],
  481. referencedClasses: []
  482. }),
  483. globals.HLCommand.klass);
  484. smalltalk.addMethod(
  485. smalltalk.method({
  486. selector: "registerOn:",
  487. protocol: 'registration',
  488. fn: function (aBinding){
  489. var self=this;
  490. return smalltalk.withContext(function($ctx1) {
  491. var $1;
  492. $1=_st(self._new())._registerOn_(aBinding);
  493. return $1;
  494. }, function($ctx1) {$ctx1.fill(self,"registerOn:",{aBinding:aBinding},globals.HLCommand.klass)})},
  495. args: ["aBinding"],
  496. source: "registerOn: aBinding\x0a\x09^ self new registerOn: aBinding",
  497. messageSends: ["registerOn:", "new"],
  498. referencedClasses: []
  499. }),
  500. globals.HLCommand.klass);
  501. smalltalk.addClass('HLCloseTabCommand', globals.HLCommand, [], 'Helios-Commands-Core');
  502. smalltalk.addMethod(
  503. smalltalk.method({
  504. selector: "execute",
  505. protocol: 'executing',
  506. fn: function (){
  507. var self=this;
  508. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  509. return smalltalk.withContext(function($ctx1) {
  510. _st(_st($HLManager())._current())._removeActiveTab();
  511. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLCloseTabCommand)})},
  512. args: [],
  513. source: "execute\x0a\x09HLManager current removeActiveTab",
  514. messageSends: ["removeActiveTab", "current"],
  515. referencedClasses: ["HLManager"]
  516. }),
  517. globals.HLCloseTabCommand);
  518. smalltalk.addMethod(
  519. smalltalk.method({
  520. selector: "key",
  521. protocol: 'accessing',
  522. fn: function (){
  523. var self=this;
  524. return "w";
  525. },
  526. args: [],
  527. source: "key\x0a\x09^ 'w'",
  528. messageSends: [],
  529. referencedClasses: []
  530. }),
  531. globals.HLCloseTabCommand.klass);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "label",
  535. protocol: 'accessing',
  536. fn: function (){
  537. var self=this;
  538. return "Close tab";
  539. },
  540. args: [],
  541. source: "label\x0a\x09^ 'Close tab'",
  542. messageSends: [],
  543. referencedClasses: []
  544. }),
  545. globals.HLCloseTabCommand.klass);
  546. smalltalk.addClass('HLModelCommand', globals.HLCommand, ['model'], 'Helios-Commands-Core');
  547. smalltalk.addMethod(
  548. smalltalk.method({
  549. selector: "model",
  550. protocol: 'accessing',
  551. fn: function (){
  552. var self=this;
  553. var $1;
  554. $1=self["@model"];
  555. return $1;
  556. },
  557. args: [],
  558. source: "model\x0a\x09^ model",
  559. messageSends: [],
  560. referencedClasses: []
  561. }),
  562. globals.HLModelCommand);
  563. smalltalk.addMethod(
  564. smalltalk.method({
  565. selector: "model:",
  566. protocol: 'accessing',
  567. fn: function (aModel){
  568. var self=this;
  569. self["@model"]=aModel;
  570. return self},
  571. args: ["aModel"],
  572. source: "model: aModel\x0a\x09model := aModel",
  573. messageSends: [],
  574. referencedClasses: []
  575. }),
  576. globals.HLModelCommand);
  577. smalltalk.addMethod(
  578. smalltalk.method({
  579. selector: "for:",
  580. protocol: 'instance creation',
  581. fn: function (aModel){
  582. var self=this;
  583. return smalltalk.withContext(function($ctx1) {
  584. var $1;
  585. $1=self._new();
  586. return $1;
  587. }, function($ctx1) {$ctx1.fill(self,"for:",{aModel:aModel},globals.HLModelCommand.klass)})},
  588. args: ["aModel"],
  589. source: "for: aModel\x0a\x09^ self new",
  590. messageSends: ["new"],
  591. referencedClasses: []
  592. }),
  593. globals.HLModelCommand.klass);
  594. smalltalk.addMethod(
  595. smalltalk.method({
  596. selector: "registerConcreteClassesOn:for:",
  597. protocol: 'registration',
  598. fn: function (aBinding,aModel){
  599. var self=this;
  600. var newBinding;
  601. return smalltalk.withContext(function($ctx1) {
  602. var $1;
  603. $1=_st(self._isConcrete())._and_((function(){
  604. return smalltalk.withContext(function($ctx2) {
  605. return self._isValidFor_(aModel);
  606. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  607. if(smalltalk.assert($1)){
  608. newBinding=self._registerOn_for_(aBinding,aModel);
  609. newBinding;
  610. } else {
  611. newBinding=aBinding;
  612. newBinding;
  613. };
  614. _st(self._subclasses())._do_((function(each){
  615. return smalltalk.withContext(function($ctx2) {
  616. return _st(each)._registerConcreteClassesOn_for_(newBinding,aModel);
  617. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  618. return self}, function($ctx1) {$ctx1.fill(self,"registerConcreteClassesOn:for:",{aBinding:aBinding,aModel:aModel,newBinding:newBinding},globals.HLModelCommand.klass)})},
  619. args: ["aBinding", "aModel"],
  620. source: "registerConcreteClassesOn: aBinding for: aModel\x0a\x09| newBinding |\x0a\x09\x0a\x09(self isConcrete and: [ self isValidFor: aModel ])\x0a\x09\x09ifTrue: [ newBinding := self registerOn: aBinding for: aModel ]\x0a\x09\x09ifFalse: [ newBinding := aBinding ].\x0a\x09\x09\x0a\x09self subclasses do: [ :each |\x0a\x09\x09each registerConcreteClassesOn: newBinding for: aModel ]",
  621. messageSends: ["ifTrue:ifFalse:", "and:", "isConcrete", "isValidFor:", "registerOn:for:", "do:", "subclasses", "registerConcreteClassesOn:for:"],
  622. referencedClasses: []
  623. }),
  624. globals.HLModelCommand.klass);
  625. smalltalk.addMethod(
  626. smalltalk.method({
  627. selector: "registerOn:for:",
  628. protocol: 'registration',
  629. fn: function (aBinding,aModel){
  630. var self=this;
  631. return smalltalk.withContext(function($ctx1) {
  632. var $1;
  633. $1=_st(self._for_(aModel))._registerOn_(aBinding);
  634. return $1;
  635. }, function($ctx1) {$ctx1.fill(self,"registerOn:for:",{aBinding:aBinding,aModel:aModel},globals.HLModelCommand.klass)})},
  636. args: ["aBinding", "aModel"],
  637. source: "registerOn: aBinding for: aModel\x0a\x09^ (self for: aModel) registerOn: aBinding",
  638. messageSends: ["registerOn:", "for:"],
  639. referencedClasses: []
  640. }),
  641. globals.HLModelCommand.klass);
  642. smalltalk.addClass('HLOpenCommand', globals.HLCommand, [], 'Helios-Commands-Core');
  643. smalltalk.addMethod(
  644. smalltalk.method({
  645. selector: "key",
  646. protocol: 'accessing',
  647. fn: function (){
  648. var self=this;
  649. return "o";
  650. },
  651. args: [],
  652. source: "key\x0a\x09^ 'o'",
  653. messageSends: [],
  654. referencedClasses: []
  655. }),
  656. globals.HLOpenCommand.klass);
  657. smalltalk.addMethod(
  658. smalltalk.method({
  659. selector: "label",
  660. protocol: 'accessing',
  661. fn: function (){
  662. var self=this;
  663. return "Open";
  664. },
  665. args: [],
  666. source: "label\x0a\x09^ 'Open'",
  667. messageSends: [],
  668. referencedClasses: []
  669. }),
  670. globals.HLOpenCommand.klass);
  671. smalltalk.addClass('HLOpenBrowserCommand', globals.HLOpenCommand, [], 'Helios-Commands-Core');
  672. smalltalk.addMethod(
  673. smalltalk.method({
  674. selector: "execute",
  675. protocol: 'executing',
  676. fn: function (){
  677. var self=this;
  678. function $HLBrowser(){return globals.HLBrowser||(typeof HLBrowser=="undefined"?nil:HLBrowser)}
  679. return smalltalk.withContext(function($ctx1) {
  680. var $1;
  681. $1=_st($HLBrowser())._openAsTab();
  682. return $1;
  683. }, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLOpenBrowserCommand)})},
  684. args: [],
  685. source: "execute\x0a\x09^ HLBrowser openAsTab",
  686. messageSends: ["openAsTab"],
  687. referencedClasses: ["HLBrowser"]
  688. }),
  689. globals.HLOpenBrowserCommand);
  690. smalltalk.addMethod(
  691. smalltalk.method({
  692. selector: "key",
  693. protocol: 'accessing',
  694. fn: function (){
  695. var self=this;
  696. return "b";
  697. },
  698. args: [],
  699. source: "key\x0a\x09^ 'b'",
  700. messageSends: [],
  701. referencedClasses: []
  702. }),
  703. globals.HLOpenBrowserCommand.klass);
  704. smalltalk.addMethod(
  705. smalltalk.method({
  706. selector: "label",
  707. protocol: 'accessing',
  708. fn: function (){
  709. var self=this;
  710. return "Browser";
  711. },
  712. args: [],
  713. source: "label\x0a\x09^ 'Browser'",
  714. messageSends: [],
  715. referencedClasses: []
  716. }),
  717. globals.HLOpenBrowserCommand.klass);
  718. smalltalk.addClass('HLOpenWorkspaceCommand', globals.HLOpenCommand, [], 'Helios-Commands-Core');
  719. smalltalk.addMethod(
  720. smalltalk.method({
  721. selector: "execute",
  722. protocol: 'executing',
  723. fn: function (){
  724. var self=this;
  725. function $HLWorkspace(){return globals.HLWorkspace||(typeof HLWorkspace=="undefined"?nil:HLWorkspace)}
  726. return smalltalk.withContext(function($ctx1) {
  727. var $1;
  728. $1=_st($HLWorkspace())._openAsTab();
  729. return $1;
  730. }, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLOpenWorkspaceCommand)})},
  731. args: [],
  732. source: "execute\x0a\x09^ HLWorkspace openAsTab",
  733. messageSends: ["openAsTab"],
  734. referencedClasses: ["HLWorkspace"]
  735. }),
  736. globals.HLOpenWorkspaceCommand);
  737. smalltalk.addMethod(
  738. smalltalk.method({
  739. selector: "key",
  740. protocol: 'accessing',
  741. fn: function (){
  742. var self=this;
  743. return "w";
  744. },
  745. args: [],
  746. source: "key\x0a\x09^ 'w'",
  747. messageSends: [],
  748. referencedClasses: []
  749. }),
  750. globals.HLOpenWorkspaceCommand.klass);
  751. smalltalk.addMethod(
  752. smalltalk.method({
  753. selector: "label",
  754. protocol: 'accessing',
  755. fn: function (){
  756. var self=this;
  757. return "Workspace";
  758. },
  759. args: [],
  760. source: "label\x0a\x09^ 'Workspace'",
  761. messageSends: [],
  762. referencedClasses: []
  763. }),
  764. globals.HLOpenWorkspaceCommand.klass);
  765. smalltalk.addClass('HLSwitchTabCommand', globals.HLCommand, [], 'Helios-Commands-Core');
  766. smalltalk.addMethod(
  767. smalltalk.method({
  768. selector: "execute",
  769. protocol: 'executing',
  770. fn: function (){
  771. var self=this;
  772. var activeTab;
  773. function $HLTabSelectionWidget(){return globals.HLTabSelectionWidget||(typeof HLTabSelectionWidget=="undefined"?nil:HLTabSelectionWidget)}
  774. return smalltalk.withContext(function($ctx1) {
  775. var $2,$3,$1;
  776. activeTab=self._selectedTab();
  777. $ctx1.sendIdx["selectedTab"]=1;
  778. $2=_st($HLTabSelectionWidget())._new();
  779. _st($2)._tabs_(self._tabs());
  780. _st($2)._selectedTab_(self._selectedTab());
  781. _st($2)._selectCallback_((function(tab){
  782. return smalltalk.withContext(function($ctx2) {
  783. return _st(tab)._activate();
  784. $ctx2.sendIdx["activate"]=1;
  785. }, function($ctx2) {$ctx2.fillBlock({tab:tab},$ctx1,1)})}));
  786. _st($2)._confirmCallback_((function(tab){
  787. return smalltalk.withContext(function($ctx2) {
  788. return _st(tab)._focus();
  789. }, function($ctx2) {$ctx2.fillBlock({tab:tab},$ctx1,2)})}));
  790. _st($2)._cancelCallback_((function(){
  791. return smalltalk.withContext(function($ctx2) {
  792. return _st(activeTab)._activate();
  793. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  794. $3=_st($2)._show();
  795. $1=$3;
  796. return $1;
  797. }, function($ctx1) {$ctx1.fill(self,"execute",{activeTab:activeTab},globals.HLSwitchTabCommand)})},
  798. args: [],
  799. source: "execute\x0a\x09| activeTab |\x0a\x09\x0a\x09activeTab := self selectedTab.\x0a\x09\x0a\x09^ HLTabSelectionWidget new\x0a\x09\x09tabs: self tabs;\x0a\x09\x09selectedTab: self selectedTab;\x0a\x09\x09selectCallback: [ :tab | tab activate ];\x0a\x09\x09confirmCallback: [ :tab | tab focus ];\x0a\x09\x09cancelCallback: [ activeTab activate ];\x0a\x09\x09show",
  800. messageSends: ["selectedTab", "tabs:", "new", "tabs", "selectedTab:", "selectCallback:", "activate", "confirmCallback:", "focus", "cancelCallback:", "show"],
  801. referencedClasses: ["HLTabSelectionWidget"]
  802. }),
  803. globals.HLSwitchTabCommand);
  804. smalltalk.addMethod(
  805. smalltalk.method({
  806. selector: "selectedTab",
  807. protocol: 'accessing',
  808. fn: function (){
  809. var self=this;
  810. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  811. return smalltalk.withContext(function($ctx1) {
  812. var $1;
  813. $1=_st(_st($HLManager())._current())._activeTab();
  814. return $1;
  815. }, function($ctx1) {$ctx1.fill(self,"selectedTab",{},globals.HLSwitchTabCommand)})},
  816. args: [],
  817. source: "selectedTab\x0a\x09^ HLManager current activeTab",
  818. messageSends: ["activeTab", "current"],
  819. referencedClasses: ["HLManager"]
  820. }),
  821. globals.HLSwitchTabCommand);
  822. smalltalk.addMethod(
  823. smalltalk.method({
  824. selector: "tabs",
  825. protocol: 'accessing',
  826. fn: function (){
  827. var self=this;
  828. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  829. return smalltalk.withContext(function($ctx1) {
  830. var $1;
  831. $1=_st(_st($HLManager())._current())._tabs();
  832. return $1;
  833. }, function($ctx1) {$ctx1.fill(self,"tabs",{},globals.HLSwitchTabCommand)})},
  834. args: [],
  835. source: "tabs\x0a\x09^ HLManager current tabs",
  836. messageSends: ["tabs", "current"],
  837. referencedClasses: ["HLManager"]
  838. }),
  839. globals.HLSwitchTabCommand);
  840. smalltalk.addMethod(
  841. smalltalk.method({
  842. selector: "key",
  843. protocol: 'accessing',
  844. fn: function (){
  845. var self=this;
  846. return "s";
  847. },
  848. args: [],
  849. source: "key\x0a\x09^ 's'",
  850. messageSends: [],
  851. referencedClasses: []
  852. }),
  853. globals.HLSwitchTabCommand.klass);
  854. smalltalk.addMethod(
  855. smalltalk.method({
  856. selector: "label",
  857. protocol: 'accessing',
  858. fn: function (){
  859. var self=this;
  860. return "Switch";
  861. },
  862. args: [],
  863. source: "label\x0a\x09^ 'Switch'",
  864. messageSends: [],
  865. referencedClasses: []
  866. }),
  867. globals.HLSwitchTabCommand.klass);
  868. smalltalk.addClass('HLViewCommand', globals.HLCommand, [], 'Helios-Commands-Core');
  869. smalltalk.addMethod(
  870. smalltalk.method({
  871. selector: "label",
  872. protocol: 'accessing',
  873. fn: function (){
  874. var self=this;
  875. return "View";
  876. },
  877. args: [],
  878. source: "label\x0a\x09^ 'View'",
  879. messageSends: [],
  880. referencedClasses: []
  881. }),
  882. globals.HLViewCommand.klass);
  883. });