1
0

Helios-Commands-Core.js 28 KB

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