2
0

Helios-Workspace.deploy.js 58 KB

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