Helios-Workspace.deploy.js 54 KB

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