Helios-Workspace.deploy.js 58 KB

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