2
0

Helios-Workspace.deploy.js 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562
  1. smalltalk.addPackage('Helios-Workspace');
  2. smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "announcer",
  6. fn: function (){
  7. var self=this;
  8. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  9. return smalltalk.withContext(function($ctx1) {
  10. var $2,$1;
  11. $2=self["@announcer"];
  12. if(($receiver = $2) == nil || $receiver == undefined){
  13. self["@announcer"]=_st($Announcer())._new();
  14. $1=self["@announcer"];
  15. } else {
  16. $1=$2;
  17. };
  18. return $1;
  19. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeModel)})},
  20. messageSends: ["ifNil:", "new"]}),
  21. smalltalk.HLCodeModel);
  22. smalltalk.addMethod(
  23. smalltalk.method({
  24. selector: "defaultReceiver",
  25. fn: function (){
  26. var self=this;
  27. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  28. return smalltalk.withContext(function($ctx1) {
  29. var $1;
  30. $1=_st($DoIt())._new();
  31. return $1;
  32. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},smalltalk.HLCodeModel)})},
  33. messageSends: ["new"]}),
  34. smalltalk.HLCodeModel);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "doIt:",
  38. fn: function (aString){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) {
  41. var $1;
  42. $1=_st(_st(self)._environment())._eval_on_(aString,_st(self)._receiver());
  43. return $1;
  44. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},smalltalk.HLCodeModel)})},
  45. messageSends: ["eval:on:", "receiver", "environment"]}),
  46. smalltalk.HLCodeModel);
  47. smalltalk.addMethod(
  48. smalltalk.method({
  49. selector: "environment",
  50. fn: function (){
  51. var self=this;
  52. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  53. return smalltalk.withContext(function($ctx1) {
  54. var $2,$1;
  55. $2=self["@environment"];
  56. if(($receiver = $2) == nil || $receiver == undefined){
  57. $1=_st(_st($HLManager())._current())._environment();
  58. } else {
  59. $1=$2;
  60. };
  61. return $1;
  62. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLCodeModel)})},
  63. messageSends: ["ifNil:", "environment", "current"]}),
  64. smalltalk.HLCodeModel);
  65. smalltalk.addMethod(
  66. smalltalk.method({
  67. selector: "environment:",
  68. fn: function (anEnvironment){
  69. var self=this;
  70. return smalltalk.withContext(function($ctx1) {
  71. self["@environment"]=anEnvironment;
  72. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel)})},
  73. messageSends: []}),
  74. smalltalk.HLCodeModel);
  75. smalltalk.addMethod(
  76. smalltalk.method({
  77. selector: "receiver",
  78. fn: function (){
  79. var self=this;
  80. return smalltalk.withContext(function($ctx1) {
  81. var $2,$1;
  82. $2=self["@receiver"];
  83. if(($receiver = $2) == nil || $receiver == undefined){
  84. self["@receiver"]=_st(self)._defaultReceiver();
  85. $1=self["@receiver"];
  86. } else {
  87. $1=$2;
  88. };
  89. return $1;
  90. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeModel)})},
  91. messageSends: ["ifNil:", "defaultReceiver"]}),
  92. smalltalk.HLCodeModel);
  93. smalltalk.addMethod(
  94. smalltalk.method({
  95. selector: "receiver:",
  96. fn: function (anObject){
  97. var self=this;
  98. return smalltalk.withContext(function($ctx1) {
  99. self["@receiver"]=anObject;
  100. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeModel)})},
  101. messageSends: []}),
  102. smalltalk.HLCodeModel);
  103. smalltalk.addMethod(
  104. smalltalk.method({
  105. selector: "on:",
  106. fn: function (anEnvironment){
  107. var self=this;
  108. return smalltalk.withContext(function($ctx1) {
  109. var $2,$3,$1;
  110. $2=_st(self)._new();
  111. _st($2)._environment_(anEnvironment);
  112. $3=_st($2)._yourself();
  113. $1=$3;
  114. return $1;
  115. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel.klass)})},
  116. messageSends: ["environment:", "new", "yourself"]}),
  117. smalltalk.HLCodeModel.klass);
  118. smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor', 'state'], 'Helios-Workspace');
  119. smalltalk.addMethod(
  120. smalltalk.method({
  121. selector: "announcer",
  122. fn: function (){
  123. var self=this;
  124. return smalltalk.withContext(function($ctx1) {
  125. var $1;
  126. $1=_st(_st(self)._model())._announcer();
  127. return $1;
  128. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeWidget)})},
  129. messageSends: ["announcer", "model"]}),
  130. smalltalk.HLCodeWidget);
  131. smalltalk.addMethod(
  132. smalltalk.method({
  133. selector: "canHaveFocus",
  134. fn: function (){
  135. var self=this;
  136. return smalltalk.withContext(function($ctx1) {
  137. return true;
  138. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLCodeWidget)})},
  139. messageSends: []}),
  140. smalltalk.HLCodeWidget);
  141. smalltalk.addMethod(
  142. smalltalk.method({
  143. selector: "clear",
  144. fn: function (){
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) {
  147. _st(self)._contents_("");
  148. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLCodeWidget)})},
  149. messageSends: ["contents:"]}),
  150. smalltalk.HLCodeWidget);
  151. smalltalk.addMethod(
  152. smalltalk.method({
  153. selector: "configureEditor",
  154. fn: function (){
  155. var self=this;
  156. return smalltalk.withContext(function($ctx1) {
  157. _st(_st(self)._editor())._at_put_("amberCodeWidget",self);
  158. _st(_st(self)._editor())._on_do_("change",(function(){
  159. return smalltalk.withContext(function($ctx2) {
  160. return _st(self)._onChange();
  161. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  162. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLCodeWidget)})},
  163. messageSends: ["at:put:", "editor", "on:do:", "onChange"]}),
  164. smalltalk.HLCodeWidget);
  165. smalltalk.addMethod(
  166. smalltalk.method({
  167. selector: "contents",
  168. fn: function (){
  169. var self=this;
  170. return smalltalk.withContext(function($ctx1) {
  171. var $1;
  172. $1=_st(self["@editor"])._getValue();
  173. return $1;
  174. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.HLCodeWidget)})},
  175. messageSends: ["getValue"]}),
  176. smalltalk.HLCodeWidget);
  177. smalltalk.addMethod(
  178. smalltalk.method({
  179. selector: "contents:",
  180. fn: function (aString){
  181. var self=this;
  182. return smalltalk.withContext(function($ctx1) {
  183. var $1;
  184. _st(self["@editor"])._setValue_(aString);
  185. $1=self["@state"];
  186. if(($receiver = $1) == nil || $receiver == undefined){
  187. $1;
  188. } else {
  189. _st(self)._updateState();
  190. };
  191. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLCodeWidget)})},
  192. messageSends: ["setValue:", "ifNotNil:", "updateState"]}),
  193. smalltalk.HLCodeWidget);
  194. smalltalk.addMethod(
  195. smalltalk.method({
  196. selector: "currentLine",
  197. fn: function (){
  198. var self=this;
  199. return smalltalk.withContext(function($ctx1) {
  200. var $1;
  201. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  202. return $1;
  203. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.HLCodeWidget)})},
  204. messageSends: ["getLine:", "line", "getCursor"]}),
  205. smalltalk.HLCodeWidget);
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "currentLineOrSelection",
  209. fn: function (){
  210. var self=this;
  211. return smalltalk.withContext(function($ctx1) {
  212. var $2,$1;
  213. $2=_st(self["@editor"])._somethingSelected();
  214. if(smalltalk.assert($2)){
  215. $1=_st(self)._selection();
  216. } else {
  217. $1=_st(self)._currentLine();
  218. };
  219. return $1;
  220. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.HLCodeWidget)})},
  221. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"]}),
  222. smalltalk.HLCodeWidget);
  223. smalltalk.addMethod(
  224. smalltalk.method({
  225. selector: "doIt",
  226. fn: function (){
  227. var self=this;
  228. var result;
  229. function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  230. function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  231. return smalltalk.withContext(function($ctx1) {
  232. var $1;
  233. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLDoItRequested())._on_(self["@model"]));
  234. result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
  235. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  236. $1=result;
  237. return $1;
  238. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
  239. messageSends: ["announce:", "on:", "announcer", "model", "doIt:", "currentLineOrSelection"]}),
  240. smalltalk.HLCodeWidget);
  241. smalltalk.addMethod(
  242. smalltalk.method({
  243. selector: "editor",
  244. fn: function (){
  245. var self=this;
  246. return smalltalk.withContext(function($ctx1) {
  247. var $1;
  248. $1=self["@editor"];
  249. return $1;
  250. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.HLCodeWidget)})},
  251. messageSends: []}),
  252. smalltalk.HLCodeWidget);
  253. smalltalk.addMethod(
  254. smalltalk.method({
  255. selector: "editorOptions",
  256. fn: function (){
  257. var self=this;
  258. return smalltalk.withContext(function($ctx1) {
  259. var $1;
  260. $1=smalltalk.HashedCollection._fromPairs_([_st("theme").__minus_gt("amber"),_st("lineNumbers").__minus_gt(true),_st("enterMode").__minus_gt("flat"),_st("indentWithTabs").__minus_gt(true),_st("indentUnit").__minus_gt((4)),_st("matchBrackets").__minus_gt(true),_st("electricChars").__minus_gt(false),_st("keyMap").__minus_gt("Amber"),_st("extraKeys").__minus_gt(smalltalk.HashedCollection._fromPairs_([_st("Shift-Space").__minus_gt("autocomplete")]))]);
  261. return $1;
  262. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},smalltalk.HLCodeWidget)})},
  263. messageSends: ["->"]}),
  264. smalltalk.HLCodeWidget);
  265. smalltalk.addMethod(
  266. smalltalk.method({
  267. selector: "focus",
  268. fn: function (){
  269. var self=this;
  270. return smalltalk.withContext(function($ctx1) {
  271. _st(self["@editor"])._focus();
  272. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLCodeWidget)})},
  273. messageSends: ["focus"]}),
  274. smalltalk.HLCodeWidget);
  275. smalltalk.addMethod(
  276. smalltalk.method({
  277. selector: "hasFocus",
  278. fn: function (){
  279. var self=this;
  280. return smalltalk.withContext(function($ctx1) {
  281. var $1;
  282. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  283. return $1;
  284. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLCodeWidget)})},
  285. messageSends: ["is:", "asJQuery"]}),
  286. smalltalk.HLCodeWidget);
  287. smalltalk.addMethod(
  288. smalltalk.method({
  289. selector: "hasModification",
  290. fn: function (){
  291. var self=this;
  292. return smalltalk.withContext(function($ctx1) {
  293. return false;
  294. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLCodeWidget)})},
  295. messageSends: []}),
  296. smalltalk.HLCodeWidget);
  297. smalltalk.addMethod(
  298. smalltalk.method({
  299. selector: "inspectIt",
  300. fn: function (){
  301. var self=this;
  302. var newInspector;
  303. function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
  304. return smalltalk.withContext(function($ctx1) {
  305. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
  306. _st(_st(self)._doIt())._inspect();
  307. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
  308. messageSends: ["announce:", "on:", "announcer", "model", "inspect", "doIt"]}),
  309. smalltalk.HLCodeWidget);
  310. smalltalk.addMethod(
  311. smalltalk.method({
  312. selector: "messageHintFor:token:",
  313. fn: function (anEditor,aToken){
  314. var self=this;
  315. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  316. return smalltalk.withContext(function($ctx1) {
  317. var $1;
  318. $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
  319. return smalltalk.withContext(function($ctx2) {
  320. return _st(each)._includesSubString_(_st(aToken)._string());
  321. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  322. return smalltalk.withContext(function($ctx2) {
  323. return _st(each).__eq(_st(aToken)._string());
  324. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  325. return $1;
  326. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
  327. messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"]}),
  328. smalltalk.HLCodeWidget);
  329. smalltalk.addMethod(
  330. smalltalk.method({
  331. selector: "model",
  332. fn: function (){
  333. var self=this;
  334. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  335. return smalltalk.withContext(function($ctx1) {
  336. var $2,$1;
  337. $2=self["@model"];
  338. if(($receiver = $2) == nil || $receiver == undefined){
  339. self["@model"]=_st($HLCodeModel())._new();
  340. $1=self["@model"];
  341. } else {
  342. $1=$2;
  343. };
  344. return $1;
  345. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
  346. messageSends: ["ifNil:", "new"]}),
  347. smalltalk.HLCodeWidget);
  348. smalltalk.addMethod(
  349. smalltalk.method({
  350. selector: "model:",
  351. fn: function (aModel){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) {
  354. self["@model"]=aModel;
  355. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
  356. messageSends: []}),
  357. smalltalk.HLCodeWidget);
  358. smalltalk.addMethod(
  359. smalltalk.method({
  360. selector: "onChange",
  361. fn: function (){
  362. var self=this;
  363. return smalltalk.withContext(function($ctx1) {
  364. _st(self)._updateState();
  365. return self}, function($ctx1) {$ctx1.fill(self,"onChange",{},smalltalk.HLCodeWidget)})},
  366. messageSends: ["updateState"]}),
  367. smalltalk.HLCodeWidget);
  368. smalltalk.addMethod(
  369. smalltalk.method({
  370. selector: "onDoIt",
  371. fn: function (){
  372. var self=this;
  373. return smalltalk.withContext(function($ctx1) {
  374. _st(self)._doIt();
  375. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
  376. messageSends: ["doIt"]}),
  377. smalltalk.HLCodeWidget);
  378. smalltalk.addMethod(
  379. smalltalk.method({
  380. selector: "onInspectIt",
  381. fn: function (){
  382. var self=this;
  383. return smalltalk.withContext(function($ctx1) {
  384. _st(self)._inspectIt();
  385. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
  386. messageSends: ["inspectIt"]}),
  387. smalltalk.HLCodeWidget);
  388. smalltalk.addMethod(
  389. smalltalk.method({
  390. selector: "onPrintIt",
  391. fn: function (){
  392. var self=this;
  393. return smalltalk.withContext(function($ctx1) {
  394. _st(self)._printIt();
  395. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
  396. messageSends: ["printIt"]}),
  397. smalltalk.HLCodeWidget);
  398. smalltalk.addMethod(
  399. smalltalk.method({
  400. selector: "onSaveIt",
  401. fn: function (){
  402. var self=this;
  403. return smalltalk.withContext(function($ctx1) {
  404. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
  405. messageSends: []}),
  406. smalltalk.HLCodeWidget);
  407. smalltalk.addMethod(
  408. smalltalk.method({
  409. selector: "print:",
  410. fn: function (aString){
  411. var self=this;
  412. var start,stop,currentLine;
  413. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  414. return smalltalk.withContext(function($ctx1) {
  415. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  416. start=_st($HashedCollection())._new();
  417. _st(start)._at_put_("line",currentLine);
  418. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  419. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  420. return smalltalk.withContext(function($ctx2) {
  421. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  422. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
  423. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  424. stop=_st($HashedCollection())._new();
  425. _st(stop)._at_put_("line",currentLine);
  426. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  427. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  428. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  429. _st(self["@editor"])._setSelection_end_(stop,start);
  430. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
  431. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"]}),
  432. smalltalk.HLCodeWidget);
  433. smalltalk.addMethod(
  434. smalltalk.method({
  435. selector: "printIt",
  436. fn: function (){
  437. var self=this;
  438. var result;
  439. function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  440. return smalltalk.withContext(function($ctx1) {
  441. result=_st(self)._doIt();
  442. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  443. _st(self)._print_(_st(result)._printString());
  444. _st(self)._focus();
  445. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
  446. messageSends: ["doIt", "announce:", "on:", "announcer", "model", "print:", "printString", "focus"]}),
  447. smalltalk.HLCodeWidget);
  448. smalltalk.addMethod(
  449. smalltalk.method({
  450. selector: "receiver",
  451. fn: function (){
  452. var self=this;
  453. return smalltalk.withContext(function($ctx1) {
  454. var $1;
  455. $1=_st(_st(self)._model())._receiver();
  456. return $1;
  457. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
  458. messageSends: ["receiver", "model"]}),
  459. smalltalk.HLCodeWidget);
  460. smalltalk.addMethod(
  461. smalltalk.method({
  462. selector: "receiver:",
  463. fn: function (anObject){
  464. var self=this;
  465. return smalltalk.withContext(function($ctx1) {
  466. _st(_st(self)._model())._receiver_(anObject);
  467. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  468. messageSends: ["receiver:", "model"]}),
  469. smalltalk.HLCodeWidget);
  470. smalltalk.addMethod(
  471. smalltalk.method({
  472. selector: "renderButtonsOn:",
  473. fn: function (html){
  474. var self=this;
  475. return smalltalk.withContext(function($ctx1) {
  476. var $1,$2,$3,$4,$5,$6;
  477. $1=_st(html)._button();
  478. _st($1)._class_("button");
  479. _st($1)._with_("DoIt");
  480. $2=_st($1)._onClick_((function(){
  481. return smalltalk.withContext(function($ctx2) {
  482. return _st(self)._doIt();
  483. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  484. $3=_st(html)._button();
  485. _st($3)._class_("button");
  486. _st($3)._with_("PintIt");
  487. $4=_st($3)._onClick_((function(){
  488. return smalltalk.withContext(function($ctx2) {
  489. return _st(self)._printIt();
  490. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  491. $5=_st(html)._button();
  492. _st($5)._class_("button");
  493. _st($5)._with_("InspectIt");
  494. $6=_st($5)._onClick_((function(){
  495. return smalltalk.withContext(function($ctx2) {
  496. return _st(self)._inspectIt();
  497. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  498. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLCodeWidget)})},
  499. messageSends: ["class:", "button", "with:", "onClick:", "doIt", "printIt", "inspectIt"]}),
  500. smalltalk.HLCodeWidget);
  501. smalltalk.addMethod(
  502. smalltalk.method({
  503. selector: "renderContentOn:",
  504. fn: function (html){
  505. var self=this;
  506. return smalltalk.withContext(function($ctx1) {
  507. var $1,$2,$3,$4;
  508. self["@code"]=_st(html)._textarea();
  509. self["@state"]=_st(_st(html)._div())._class_("state");
  510. $1=_st(html)._div();
  511. _st($1)._class_("buttons_bar");
  512. $2=_st($1)._with_((function(){
  513. return smalltalk.withContext(function($ctx2) {
  514. return _st(self)._renderButtonsOn_(html);
  515. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  516. $3=self;
  517. _st($3)._setEditorOn_(_st(self["@code"])._element());
  518. _st($3)._configureEditor();
  519. $4=_st($3)._updateState();
  520. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  521. messageSends: ["textarea", "class:", "div", "with:", "renderButtonsOn:", "setEditorOn:", "element", "configureEditor", "updateState"]}),
  522. smalltalk.HLCodeWidget);
  523. smalltalk.addMethod(
  524. smalltalk.method({
  525. selector: "saveIt",
  526. fn: function (){
  527. var self=this;
  528. return smalltalk.withContext(function($ctx1) {
  529. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  530. messageSends: []}),
  531. smalltalk.HLCodeWidget);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "selection",
  535. fn: function (){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx1) {
  538. var $1;
  539. $1=_st(self["@editor"])._getSelection();
  540. return $1;
  541. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  542. messageSends: ["getSelection"]}),
  543. smalltalk.HLCodeWidget);
  544. smalltalk.addMethod(
  545. smalltalk.method({
  546. selector: "selectionEnd",
  547. fn: function (){
  548. var self=this;
  549. return smalltalk.withContext(function($ctx1) {
  550. var $1;
  551. $1=_st(_st(self["@code"])._element())._selectionEnd();
  552. return $1;
  553. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  554. messageSends: ["selectionEnd", "element"]}),
  555. smalltalk.HLCodeWidget);
  556. smalltalk.addMethod(
  557. smalltalk.method({
  558. selector: "selectionEnd:",
  559. fn: function (anInteger){
  560. var self=this;
  561. return smalltalk.withContext(function($ctx1) {
  562. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  563. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  564. messageSends: ["selectionEnd:", "element"]}),
  565. smalltalk.HLCodeWidget);
  566. smalltalk.addMethod(
  567. smalltalk.method({
  568. selector: "selectionStart",
  569. fn: function (){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) {
  572. var $1;
  573. $1=_st(_st(self["@code"])._element())._selectionStart();
  574. return $1;
  575. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  576. messageSends: ["selectionStart", "element"]}),
  577. smalltalk.HLCodeWidget);
  578. smalltalk.addMethod(
  579. smalltalk.method({
  580. selector: "selectionStart:",
  581. fn: function (anInteger){
  582. var self=this;
  583. return smalltalk.withContext(function($ctx1) {
  584. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  585. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  586. messageSends: ["selectionStart:", "element"]}),
  587. smalltalk.HLCodeWidget);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "setEditorOn:",
  591. fn: function (aTextarea){
  592. var self=this;
  593. return smalltalk.withContext(function($ctx1) {
  594. self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions());
  595. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  596. messageSends: []}),
  597. smalltalk.HLCodeWidget);
  598. smalltalk.addMethod(
  599. smalltalk.method({
  600. selector: "updateState",
  601. fn: function (){
  602. var self=this;
  603. return smalltalk.withContext(function($ctx1) {
  604. var $1;
  605. $1=_st(self)._hasModification();
  606. if(smalltalk.assert($1)){
  607. _st(_st(self["@state"])._asJQuery())._addClass_("modified");
  608. } else {
  609. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  610. };
  611. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},smalltalk.HLCodeWidget)})},
  612. messageSends: ["ifTrue:ifFalse:", "addClass:", "asJQuery", "removeClass:", "hasModification"]}),
  613. smalltalk.HLCodeWidget);
  614. smalltalk.addMethod(
  615. smalltalk.method({
  616. selector: "variableHintFor:token:",
  617. fn: function (anEditor,aToken){
  618. var self=this;
  619. var variables,classNames,pseudoVariables;
  620. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  621. return smalltalk.withContext(function($ctx1) {
  622. var $1;
  623. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  624. return smalltalk.withContext(function($ctx2) {
  625. return _st(_st(window)._jQuery_(each))._html();
  626. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  627. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  628. return smalltalk.withContext(function($ctx2) {
  629. return _st(each)._name();
  630. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  631. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  632. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  633. return smalltalk.withContext(function($ctx2) {
  634. return _st(each)._includesSubString_(_st(aToken)._string());
  635. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  636. return smalltalk.withContext(function($ctx2) {
  637. return _st(each).__eq(_st(aToken)._string());
  638. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  639. return $1;
  640. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  641. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","]}),
  642. smalltalk.HLCodeWidget);
  643. smalltalk.addMethod(
  644. smalltalk.method({
  645. selector: "hintFor:options:",
  646. fn: function (anEditor,options){
  647. var self=this;
  648. var cursor,token,completions;
  649. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  650. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  651. return smalltalk.withContext(function($ctx1) {
  652. var $1,$2;
  653. cursor=_st(anEditor)._getCursor();
  654. token=_st(anEditor)._getTokenAt_(cursor);
  655. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  656. $1=_st(_st(token)._type()).__eq("variable");
  657. if(smalltalk.assert($1)){
  658. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  659. } else {
  660. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  661. };
  662. $2=smalltalk.HashedCollection._fromPairs_([_st("list").__minus_gt(completions),_st("from").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._end())),_st("to").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start()))]);
  663. return $2;
  664. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  665. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"]}),
  666. smalltalk.HLCodeWidget.klass);
  667. smalltalk.addMethod(
  668. smalltalk.method({
  669. selector: "initialize",
  670. fn: function (){
  671. var self=this;
  672. return smalltalk.withContext(function($ctx1) {
  673. var $1,$2;
  674. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  675. $1=self;
  676. _st($1)._setupCodeMirror();
  677. _st($1)._setupCommands();
  678. $2=_st($1)._setupKeyMaps();
  679. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  680. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"]}),
  681. smalltalk.HLCodeWidget.klass);
  682. smalltalk.addMethod(
  683. smalltalk.method({
  684. selector: "keyMap",
  685. fn: function (){
  686. var self=this;
  687. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  688. return smalltalk.withContext(function($ctx1) {
  689. var $2,$1;
  690. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  691. if(smalltalk.assert($2)){
  692. $1=_st(self)._macKeyMap();
  693. } else {
  694. $1=_st(self)._pcKeyMap();
  695. };
  696. return $1;
  697. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  698. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"]}),
  699. smalltalk.HLCodeWidget.klass);
  700. smalltalk.addMethod(
  701. smalltalk.method({
  702. selector: "macKeyMap",
  703. fn: function (){
  704. var self=this;
  705. return smalltalk.withContext(function($ctx1) {
  706. var $1;
  707. $1=smalltalk.HashedCollection._fromPairs_([_st("Alt-Backspace").__minus_gt("delWordBefore"),_st("Alt-Delete").__minus_gt("delWordAfter"),_st("Alt-Left").__minus_gt("goWordBoundaryLeft"),_st("Alt-Right").__minus_gt("goWordBoundaryRight"),_st("Cmd-A").__minus_gt("selectAll"),_st("Cmd-Alt-F").__minus_gt("replace"),_st("Cmd-D").__minus_gt("doIt"),_st("Cmd-Down").__minus_gt("goDocEnd"),_st("Cmd-End").__minus_gt("goDocEnd"),_st("Cmd-F").__minus_gt("find"),_st("Cmd-G").__minus_gt("findNext"),_st("Cmd-I").__minus_gt("inspectIt"),_st("Cmd-Left").__minus_gt("goLineStart"),_st("Cmd-P").__minus_gt("printIt"),_st("Cmd-Right").__minus_gt("goLineEnd"),_st("Cmd-S").__minus_gt("saveIt"),_st("Cmd-Up").__minus_gt("goDocStart"),_st("Cmd-Y").__minus_gt("redo"),_st("Cmd-Z").__minus_gt("undo"),_st("Cmd-[").__minus_gt("indentLess"),_st("Cmd-]").__minus_gt("indentMore"),_st("Ctrl-Alt-Backspace").__minus_gt("delWordAfter"),_st("Shift-Cmd-Alt-F").__minus_gt("replaceAll"),_st("Shift-Cmd-G").__minus_gt("findPrev"),_st("Shift-Cmd-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic","emacsy"])]);
  708. return $1;
  709. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  710. messageSends: ["->"]}),
  711. smalltalk.HLCodeWidget.klass);
  712. smalltalk.addMethod(
  713. smalltalk.method({
  714. selector: "messageHintFor:token:",
  715. fn: function (anEditor,aToken){
  716. var self=this;
  717. return smalltalk.withContext(function($ctx1) {
  718. var $1;
  719. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  720. return $1;
  721. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  722. messageSends: ["messageHintFor:token:", "at:"]}),
  723. smalltalk.HLCodeWidget.klass);
  724. smalltalk.addMethod(
  725. smalltalk.method({
  726. selector: "pcKeyMap",
  727. fn: function (){
  728. var self=this;
  729. return smalltalk.withContext(function($ctx1) {
  730. var $1;
  731. $1=[_st("Alt-Left").__minus_gt("goLineStart"),_st("Alt-Right").__minus_gt("goLineEnd"),_st("Alt-Up").__minus_gt("goDocStart"),_st("Ctrl-A").__minus_gt("selectAll"),_st("Ctrl-Backspace").__minus_gt("delWordBefore"),_st("Ctrl-D").__minus_gt("doIt"),_st("Ctrl-Delete").__minus_gt("delWordAfter"),_st("Ctrl-Down").__minus_gt("goDocEnd"),_st("Ctrl-End").__minus_gt("goDocEnd"),_st("Ctrl-F").__minus_gt("find"),_st("Ctrl-G").__minus_gt("findNext"),_st("Ctrl-I").__minus_gt("inspectIt"),_st("Ctrl-Home").__minus_gt("goDocStart"),_st("Ctrl-Left").__minus_gt("goWordBoundaryLeft"),_st("Ctrl-P").__minus_gt("printIt"),_st("Ctrl-Right").__minus_gt("goWordBoundaryRight"),_st("Ctrl-S").__minus_gt("saveIt"),_st("Ctrl-Y").__minus_gt("redo"),_st("Ctrl-Z").__minus_gt("undo"),_st("Ctrl-[").__minus_gt("indentLess"),_st("Ctrl-]").__minus_gt("indentMore"),_st("Shift-Ctrl-F").__minus_gt("replace"),_st("Shift-Ctrl-G").__minus_gt("findPrev"),_st("Shift-Ctrl-R").__minus_gt("replaceAll"),_st("Shift-Ctrl-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic"])];
  732. return $1;
  733. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  734. messageSends: ["->"]}),
  735. smalltalk.HLCodeWidget.klass);
  736. smalltalk.addMethod(
  737. smalltalk.method({
  738. selector: "setupCodeMirror",
  739. fn: function (){
  740. var self=this;
  741. return smalltalk.withContext(function($ctx1) {
  742. CodeMirror.keyMap.default.fallthrough = ["basic"];
  743. CodeMirror.commands.autocomplete = function(cm) {
  744. CodeMirror.showHint(cm, self._hintFor_options_);
  745. }
  746. ;
  747. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  748. messageSends: []}),
  749. smalltalk.HLCodeWidget.klass);
  750. smalltalk.addMethod(
  751. smalltalk.method({
  752. selector: "setupCommands",
  753. fn: function (){
  754. var self=this;
  755. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  756. return smalltalk.withContext(function($ctx1) {
  757. var $1,$2;
  758. $1=_st($CodeMirror())._basicAt_("commands");
  759. _st($1)._at_put_("doIt",(function(cm){
  760. return smalltalk.withContext(function($ctx2) {
  761. return _st(_st(cm)._amberCodeWidget())._doIt();
  762. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  763. _st($1)._at_put_("inspectIt",(function(cm){
  764. return smalltalk.withContext(function($ctx2) {
  765. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  766. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  767. _st($1)._at_put_("printIt",(function(cm){
  768. return smalltalk.withContext(function($ctx2) {
  769. return _st(_st(cm)._amberCodeWidget())._printIt();
  770. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  771. $2=_st($1)._at_put_("saveIt",(function(cm){
  772. return smalltalk.withContext(function($ctx2) {
  773. return _st(_st(cm)._amberCodeWidget())._saveIt();
  774. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  775. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  776. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"]}),
  777. smalltalk.HLCodeWidget.klass);
  778. smalltalk.addMethod(
  779. smalltalk.method({
  780. selector: "setupKeyMaps",
  781. fn: function (){
  782. var self=this;
  783. return smalltalk.withContext(function($ctx1) {
  784. CodeMirror.keyMap['Amber'] = self._keyMap();
  785. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  786. messageSends: []}),
  787. smalltalk.HLCodeWidget.klass);
  788. smalltalk.addMethod(
  789. smalltalk.method({
  790. selector: "variableHintFor:token:",
  791. fn: function (anEditor,aToken){
  792. var self=this;
  793. return smalltalk.withContext(function($ctx1) {
  794. var $1;
  795. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  796. return $1;
  797. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  798. messageSends: ["variableHintFor:token:", "at:"]}),
  799. smalltalk.HLCodeWidget.klass);
  800. smalltalk.addClass('HLNavigationCodeWidget', smalltalk.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  801. smalltalk.addMethod(
  802. smalltalk.method({
  803. selector: "configureEditor",
  804. fn: function (){
  805. var self=this;
  806. return smalltalk.withContext(function($ctx1) {
  807. smalltalk.HLCodeWidget.fn.prototype._configureEditor.apply(_st(self), []);
  808. _st(self)._contents_(_st(self)._methodContents());
  809. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLNavigationCodeWidget)})},
  810. messageSends: ["configureEditor", "contents:", "methodContents"]}),
  811. smalltalk.HLNavigationCodeWidget);
  812. smalltalk.addMethod(
  813. smalltalk.method({
  814. selector: "contents:",
  815. fn: function (aString){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx1) {
  818. _st(self)._methodContents_(aString);
  819. smalltalk.HLCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  820. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  821. messageSends: ["methodContents:", "contents:"]}),
  822. smalltalk.HLNavigationCodeWidget);
  823. smalltalk.addMethod(
  824. smalltalk.method({
  825. selector: "hasModification",
  826. fn: function (){
  827. var self=this;
  828. return smalltalk.withContext(function($ctx1) {
  829. var $1;
  830. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  831. return $1;
  832. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
  833. messageSends: ["not", "=", "contents", "methodContents"]}),
  834. smalltalk.HLNavigationCodeWidget);
  835. smalltalk.addMethod(
  836. smalltalk.method({
  837. selector: "methodContents",
  838. fn: function (){
  839. var self=this;
  840. return smalltalk.withContext(function($ctx1) {
  841. var $2,$1;
  842. $2=self["@methodContents"];
  843. if(($receiver = $2) == nil || $receiver == undefined){
  844. $1="";
  845. } else {
  846. $1=$2;
  847. };
  848. return $1;
  849. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
  850. messageSends: ["ifNil:"]}),
  851. smalltalk.HLNavigationCodeWidget);
  852. smalltalk.addMethod(
  853. smalltalk.method({
  854. selector: "methodContents:",
  855. fn: function (aString){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) {
  858. var $1;
  859. self["@methodContents"]=aString;
  860. $1=self["@methodContents"];
  861. return $1;
  862. }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  863. messageSends: []}),
  864. smalltalk.HLNavigationCodeWidget);
  865. smalltalk.addMethod(
  866. smalltalk.method({
  867. selector: "previous",
  868. fn: function (){
  869. var self=this;
  870. return smalltalk.withContext(function($ctx1) {
  871. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
  872. messageSends: []}),
  873. smalltalk.HLNavigationCodeWidget);
  874. smalltalk.addMethod(
  875. smalltalk.method({
  876. selector: "previous:",
  877. fn: function (aWidget){
  878. var self=this;
  879. return smalltalk.withContext(function($ctx1) {
  880. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
  881. messageSends: []}),
  882. smalltalk.HLNavigationCodeWidget);
  883. smalltalk.addMethod(
  884. smalltalk.method({
  885. selector: "canBeOpenAsTab",
  886. fn: function (){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) {
  889. return false;
  890. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
  891. messageSends: []}),
  892. smalltalk.HLNavigationCodeWidget.klass);
  893. smalltalk.addMethod(
  894. smalltalk.method({
  895. selector: "on:",
  896. fn: function (aBrowserModel){
  897. var self=this;
  898. return smalltalk.withContext(function($ctx1) {
  899. var $2,$3,$1;
  900. $2=_st(self)._new();
  901. _st($2)._browserModel_(aBrowserModel);
  902. $3=_st($2)._yourself();
  903. $1=$3;
  904. return $1;
  905. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
  906. messageSends: ["browserModel:", "new", "yourself"]}),
  907. smalltalk.HLNavigationCodeWidget.klass);
  908. smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  909. smalltalk.addMethod(
  910. smalltalk.method({
  911. selector: "browserModel",
  912. fn: function (){
  913. var self=this;
  914. return smalltalk.withContext(function($ctx1) {
  915. var $1;
  916. $1=self["@browserModel"];
  917. return $1;
  918. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  919. messageSends: []}),
  920. smalltalk.HLBrowserCodeWidget);
  921. smalltalk.addMethod(
  922. smalltalk.method({
  923. selector: "browserModel:",
  924. fn: function (aBrowserModel){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) {
  927. var $1,$2;
  928. self["@browserModel"]=aBrowserModel;
  929. $1=self;
  930. _st($1)._observeSystem();
  931. $2=_st($1)._observeBrowserModel();
  932. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  933. messageSends: ["observeSystem", "observeBrowserModel"]}),
  934. smalltalk.HLBrowserCodeWidget);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "observeBrowserModel",
  938. fn: function (){
  939. var self=this;
  940. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  941. function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  942. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  943. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  944. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  945. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  946. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  947. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  948. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  949. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  950. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  951. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  952. return smalltalk.withContext(function($ctx1) {
  953. var $1,$2;
  954. $1=_st(_st(self)._browserModel())._announcer();
  955. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  956. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  957. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  958. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  959. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  960. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  961. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  962. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  963. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  964. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  965. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  966. $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  967. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
  968. messageSends: ["on:send:to:", "announcer", "browserModel"]}),
  969. smalltalk.HLBrowserCodeWidget);
  970. smalltalk.addMethod(
  971. smalltalk.method({
  972. selector: "observeSystem",
  973. fn: function (){
  974. var self=this;
  975. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  976. return smalltalk.withContext(function($ctx1) {
  977. _st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  978. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
  979. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"]}),
  980. smalltalk.HLBrowserCodeWidget);
  981. smalltalk.addMethod(
  982. smalltalk.method({
  983. selector: "onBrowserAboutToChange:",
  984. fn: function (anAnnouncement){
  985. var self=this;
  986. var block;
  987. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  988. return smalltalk.withContext(function($ctx1) {
  989. var $1;
  990. block=_st(anAnnouncement)._actionBlock();
  991. $1=_st(self)._hasModification();
  992. if(smalltalk.assert($1)){
  993. _st(self)._confirm_ifTrue_("Do you want to cancel changes?",(function(){
  994. return smalltalk.withContext(function($ctx2) {
  995. _st(self)._methodContents_(_st(self)._contents());
  996. return _st(block)._value();
  997. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  998. _st($HLChangeForbidden())._signal();
  999. };
  1000. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
  1001. messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"]}),
  1002. smalltalk.HLBrowserCodeWidget);
  1003. smalltalk.addMethod(
  1004. smalltalk.method({
  1005. selector: "onClassSelected:",
  1006. fn: function (anAnnouncement){
  1007. var self=this;
  1008. var class_;
  1009. return smalltalk.withContext(function($ctx1) {
  1010. var $1,$2;
  1011. class_=_st(anAnnouncement)._item();
  1012. $1=class_;
  1013. if(($receiver = $1) == nil || $receiver == undefined){
  1014. $2=_st(self)._contents_("");
  1015. return $2;
  1016. } else {
  1017. $1;
  1018. };
  1019. _st(self)._contents_(_st(class_)._definition());
  1020. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
  1021. messageSends: ["item", "ifNil:", "contents:", "definition"]}),
  1022. smalltalk.HLBrowserCodeWidget);
  1023. smalltalk.addMethod(
  1024. smalltalk.method({
  1025. selector: "onCompileError:",
  1026. fn: function (anAnnouncement){
  1027. var self=this;
  1028. return smalltalk.withContext(function($ctx1) {
  1029. _st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1030. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1031. messageSends: ["alert:", "messageText", "error"]}),
  1032. smalltalk.HLBrowserCodeWidget);
  1033. smalltalk.addMethod(
  1034. smalltalk.method({
  1035. selector: "onInstVarAdded",
  1036. fn: function (){
  1037. var self=this;
  1038. return smalltalk.withContext(function($ctx1) {
  1039. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1040. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
  1041. messageSends: ["save:", "contents", "browserModel"]}),
  1042. smalltalk.HLBrowserCodeWidget);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "onMethodModified:",
  1046. fn: function (anAnnouncement){
  1047. var self=this;
  1048. var method;
  1049. return smalltalk.withContext(function($ctx1) {
  1050. var $1,$2,$3,$4,$5,$6;
  1051. method=_st(anAnnouncement)._method();
  1052. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
  1053. if(! smalltalk.assert($1)){
  1054. $2=self;
  1055. return $2;
  1056. };
  1057. $3=_st(_st(self)._browserModel())._selectedMethod();
  1058. if(($receiver = $3) == nil || $receiver == undefined){
  1059. $4=self;
  1060. return $4;
  1061. } else {
  1062. $3;
  1063. };
  1064. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
  1065. if(! smalltalk.assert($5)){
  1066. $6=self;
  1067. return $6;
  1068. };
  1069. _st(self)._refresh();
  1070. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1071. messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"]}),
  1072. smalltalk.HLBrowserCodeWidget);
  1073. smalltalk.addMethod(
  1074. smalltalk.method({
  1075. selector: "onMethodSelected:",
  1076. fn: function (anAnnouncement){
  1077. var self=this;
  1078. var method;
  1079. return smalltalk.withContext(function($ctx1) {
  1080. var $1,$2;
  1081. method=_st(anAnnouncement)._item();
  1082. $1=method;
  1083. if(($receiver = $1) == nil || $receiver == undefined){
  1084. $2=_st(self)._contents_("");
  1085. return $2;
  1086. } else {
  1087. $1;
  1088. };
  1089. _st(self)._contents_(_st(method)._source());
  1090. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1091. messageSends: ["item", "ifNil:", "contents:", "source"]}),
  1092. smalltalk.HLBrowserCodeWidget);
  1093. smalltalk.addMethod(
  1094. smalltalk.method({
  1095. selector: "onParseError:",
  1096. fn: function (anAnnouncement){
  1097. var self=this;
  1098. var lineIndex,newContents;
  1099. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1100. return smalltalk.withContext(function($ctx1) {
  1101. var $1,$2,$3;
  1102. lineIndex=(1);
  1103. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1104. return smalltalk.withContext(function($ctx2) {
  1105. return _st(_st(self)._contents())._linesDo_((function(each){
  1106. return smalltalk.withContext(function($ctx3) {
  1107. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1108. if(smalltalk.assert($1)){
  1109. $2=stream;
  1110. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1111. _st($2)._nextPutAll_("<- ");
  1112. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1113. _st($2)._nextPutAll_(" ");
  1114. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1115. $3;
  1116. } else {
  1117. _st(stream)._nextPutAll_(each);
  1118. };
  1119. _st(stream)._nextPutAll_(_st($String())._cr());
  1120. lineIndex=_st(lineIndex).__plus((1));
  1121. return lineIndex;
  1122. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1123. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1124. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1125. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"]}),
  1126. smalltalk.HLBrowserCodeWidget);
  1127. smalltalk.addMethod(
  1128. smalltalk.method({
  1129. selector: "onProtocolSelected:",
  1130. fn: function (anAnnouncement){
  1131. var self=this;
  1132. return smalltalk.withContext(function($ctx1) {
  1133. var $1,$2;
  1134. $1=_st(_st(self)._browserModel())._selectedClass();
  1135. if(($receiver = $1) == nil || $receiver == undefined){
  1136. $2=_st(self)._contents_("");
  1137. return $2;
  1138. } else {
  1139. $1;
  1140. };
  1141. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1142. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1143. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
  1144. smalltalk.HLBrowserCodeWidget);
  1145. smalltalk.addMethod(
  1146. smalltalk.method({
  1147. selector: "onSaveIt",
  1148. fn: function (){
  1149. var self=this;
  1150. return smalltalk.withContext(function($ctx1) {
  1151. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1152. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1153. messageSends: ["save:", "contents", "browserModel"]}),
  1154. smalltalk.HLBrowserCodeWidget);
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "onShowInstanceToggled",
  1158. fn: function (){
  1159. var self=this;
  1160. return smalltalk.withContext(function($ctx1) {
  1161. var $1,$2;
  1162. $1=_st(_st(self)._browserModel())._selectedClass();
  1163. if(($receiver = $1) == nil || $receiver == undefined){
  1164. $2=_st(self)._contents_("");
  1165. return $2;
  1166. } else {
  1167. $1;
  1168. };
  1169. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1170. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
  1171. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
  1172. smalltalk.HLBrowserCodeWidget);
  1173. smalltalk.addMethod(
  1174. smalltalk.method({
  1175. selector: "onSourceCodeFocusRequested",
  1176. fn: function (){
  1177. var self=this;
  1178. return smalltalk.withContext(function($ctx1) {
  1179. _st(self)._focus();
  1180. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1181. messageSends: ["focus"]}),
  1182. smalltalk.HLBrowserCodeWidget);
  1183. smalltalk.addMethod(
  1184. smalltalk.method({
  1185. selector: "onSourceCodeSaved",
  1186. fn: function (){
  1187. var self=this;
  1188. return smalltalk.withContext(function($ctx1) {
  1189. _st(self)._methodContents_(_st(self)._contents());
  1190. _st(self)._updateState();
  1191. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
  1192. messageSends: ["methodContents:", "contents", "updateState"]}),
  1193. smalltalk.HLBrowserCodeWidget);
  1194. smalltalk.addMethod(
  1195. smalltalk.method({
  1196. selector: "onUnknownVariableError:",
  1197. fn: function (anAnnouncement){
  1198. var self=this;
  1199. var error;
  1200. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1201. return smalltalk.withContext(function($ctx1) {
  1202. var $1,$2;
  1203. error=_st(anAnnouncement)._error();
  1204. _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1205. return smalltalk.withContext(function($ctx2) {
  1206. $1=stream;
  1207. _st($1)._nextPutAll_(_st(error)._messageText());
  1208. _st($1)._nextPutAll_(_st($String())._cr());
  1209. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1210. return $2;
  1211. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
  1212. return smalltalk.withContext(function($ctx2) {
  1213. return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1214. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1215. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
  1216. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"]}),
  1217. smalltalk.HLBrowserCodeWidget);
  1218. smalltalk.addMethod(
  1219. smalltalk.method({
  1220. selector: "refresh",
  1221. fn: function (){
  1222. var self=this;
  1223. return smalltalk.withContext(function($ctx1) {
  1224. var $1,$2,$3,$4;
  1225. $1=_st(self)._hasModification();
  1226. if(smalltalk.assert($1)){
  1227. $2=self;
  1228. return $2;
  1229. };
  1230. $3=_st(self)._hasFocus();
  1231. if(smalltalk.assert($3)){
  1232. $4=self;
  1233. return $4;
  1234. };
  1235. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedMethod())._source());
  1236. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
  1237. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"]}),
  1238. smalltalk.HLBrowserCodeWidget);
  1239. smalltalk.addMethod(
  1240. smalltalk.method({
  1241. selector: "renderButtonsOn:",
  1242. fn: function (html){
  1243. var self=this;
  1244. return smalltalk.withContext(function($ctx1) {
  1245. var $1,$2;
  1246. $1=_st(html)._button();
  1247. _st($1)._class_("button");
  1248. _st($1)._with_("SaveIt");
  1249. $2=_st($1)._onClick_((function(){
  1250. return smalltalk.withContext(function($ctx2) {
  1251. return _st(self)._saveIt();
  1252. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1253. smalltalk.HLNavigationCodeWidget.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1254. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLBrowserCodeWidget)})},
  1255. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"]}),
  1256. smalltalk.HLBrowserCodeWidget);
  1257. smalltalk.addMethod(
  1258. smalltalk.method({
  1259. selector: "saveIt",
  1260. fn: function (){
  1261. var self=this;
  1262. return smalltalk.withContext(function($ctx1) {
  1263. _st(_st(self)._browserModel())._saveSourceCode();
  1264. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1265. messageSends: ["saveSourceCode", "browserModel"]}),
  1266. smalltalk.HLBrowserCodeWidget);
  1267. smalltalk.addMethod(
  1268. smalltalk.method({
  1269. selector: "unregister",
  1270. fn: function (){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) {
  1273. smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
  1274. _st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
  1275. _st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
  1276. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
  1277. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"]}),
  1278. smalltalk.HLBrowserCodeWidget);
  1279. smalltalk.addMethod(
  1280. smalltalk.method({
  1281. selector: "canBeOpenAsTab",
  1282. fn: function (){
  1283. var self=this;
  1284. return smalltalk.withContext(function($ctx1) {
  1285. return false;
  1286. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1287. messageSends: []}),
  1288. smalltalk.HLBrowserCodeWidget.klass);
  1289. smalltalk.addMethod(
  1290. smalltalk.method({
  1291. selector: "on:",
  1292. fn: function (aBrowserModel){
  1293. var self=this;
  1294. return smalltalk.withContext(function($ctx1) {
  1295. var $2,$3,$1;
  1296. $2=_st(self)._new();
  1297. _st($2)._browserModel_(aBrowserModel);
  1298. $3=_st($2)._yourself();
  1299. $1=$3;
  1300. return $1;
  1301. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1302. messageSends: ["browserModel:", "new", "yourself"]}),
  1303. smalltalk.HLBrowserCodeWidget.klass);
  1304. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  1305. smalltalk.addMethod(
  1306. smalltalk.method({
  1307. selector: "canHaveFocus",
  1308. fn: function (){
  1309. var self=this;
  1310. return smalltalk.withContext(function($ctx1) {
  1311. return true;
  1312. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1313. messageSends: []}),
  1314. smalltalk.HLWorkspace);
  1315. smalltalk.addMethod(
  1316. smalltalk.method({
  1317. selector: "codeWidget",
  1318. fn: function (){
  1319. var self=this;
  1320. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1321. return smalltalk.withContext(function($ctx1) {
  1322. var $2,$1;
  1323. $2=self["@codeWidget"];
  1324. if(($receiver = $2) == nil || $receiver == undefined){
  1325. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1326. $1=self["@codeWidget"];
  1327. } else {
  1328. $1=$2;
  1329. };
  1330. return $1;
  1331. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1332. messageSends: ["ifNil:", "new"]}),
  1333. smalltalk.HLWorkspace);
  1334. smalltalk.addMethod(
  1335. smalltalk.method({
  1336. selector: "focus",
  1337. fn: function (){
  1338. var self=this;
  1339. return smalltalk.withContext(function($ctx1) {
  1340. var $1;
  1341. $1=_st(_st(self)._codeWidget())._focus();
  1342. return $1;
  1343. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1344. messageSends: ["focus", "codeWidget"]}),
  1345. smalltalk.HLWorkspace);
  1346. smalltalk.addMethod(
  1347. smalltalk.method({
  1348. selector: "renderContentOn:",
  1349. fn: function (html){
  1350. var self=this;
  1351. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  1352. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1353. return smalltalk.withContext(function($ctx1) {
  1354. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(_st(self)._codeWidget(),(function(canvas){
  1355. return smalltalk.withContext(function($ctx2) {
  1356. return _st(self)._renderTranscriptOn_(canvas);
  1357. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1)})}))));
  1358. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1359. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"]}),
  1360. smalltalk.HLWorkspace);
  1361. smalltalk.addMethod(
  1362. smalltalk.method({
  1363. selector: "renderTranscriptOn:",
  1364. fn: function (html){
  1365. var self=this;
  1366. return smalltalk.withContext(function($ctx1) {
  1367. var $1,$3,$4,$2;
  1368. $1=_st(html)._div();
  1369. _st($1)._class_("transcript-container");
  1370. $2=_st($1)._with_((function(){
  1371. return smalltalk.withContext(function($ctx2) {
  1372. $3=_st(html)._div();
  1373. _st($3)._class_("list-label");
  1374. $4=_st($3)._with_("Transcript");
  1375. $4;
  1376. return _st(_st(self)._transcript())._renderOn_(html);
  1377. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1378. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},smalltalk.HLWorkspace)})},
  1379. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"]}),
  1380. smalltalk.HLWorkspace);
  1381. smalltalk.addMethod(
  1382. smalltalk.method({
  1383. selector: "transcript",
  1384. fn: function (){
  1385. var self=this;
  1386. function $HLTranscript(){return smalltalk.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  1387. return smalltalk.withContext(function($ctx1) {
  1388. var $2,$1;
  1389. $2=self["@transcript"];
  1390. if(($receiver = $2) == nil || $receiver == undefined){
  1391. self["@transcript"]=_st($HLTranscript())._new();
  1392. $1=self["@transcript"];
  1393. } else {
  1394. $1=$2;
  1395. };
  1396. return $1;
  1397. }, function($ctx1) {$ctx1.fill(self,"transcript",{},smalltalk.HLWorkspace)})},
  1398. messageSends: ["ifNil:", "new"]}),
  1399. smalltalk.HLWorkspace);
  1400. smalltalk.addMethod(
  1401. smalltalk.method({
  1402. selector: "unregister",
  1403. fn: function (){
  1404. var self=this;
  1405. return smalltalk.withContext(function($ctx1) {
  1406. smalltalk.HLWidget.fn.prototype._unregister.apply(_st(self), []);
  1407. _st(_st(self)._transcript())._unregister();
  1408. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWorkspace)})},
  1409. messageSends: ["unregister", "transcript"]}),
  1410. smalltalk.HLWorkspace);
  1411. smalltalk.addMethod(
  1412. smalltalk.method({
  1413. selector: "canBeOpenAsTab",
  1414. fn: function (){
  1415. var self=this;
  1416. return smalltalk.withContext(function($ctx1) {
  1417. return true;
  1418. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1419. messageSends: []}),
  1420. smalltalk.HLWorkspace.klass);
  1421. smalltalk.addMethod(
  1422. smalltalk.method({
  1423. selector: "tabClass",
  1424. fn: function (){
  1425. var self=this;
  1426. return smalltalk.withContext(function($ctx1) {
  1427. return "workspace";
  1428. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWorkspace.klass)})},
  1429. messageSends: []}),
  1430. smalltalk.HLWorkspace.klass);
  1431. smalltalk.addMethod(
  1432. smalltalk.method({
  1433. selector: "tabLabel",
  1434. fn: function (){
  1435. var self=this;
  1436. return smalltalk.withContext(function($ctx1) {
  1437. return "Workspace";
  1438. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1439. messageSends: []}),
  1440. smalltalk.HLWorkspace.klass);
  1441. smalltalk.addMethod(
  1442. smalltalk.method({
  1443. selector: "tabPriority",
  1444. fn: function (){
  1445. var self=this;
  1446. return smalltalk.withContext(function($ctx1) {
  1447. var $1;
  1448. $1=(10);
  1449. return $1;
  1450. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1451. messageSends: []}),
  1452. smalltalk.HLWorkspace.klass);