Helios-Workspace.js 89 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367
  1. define("amber_core/Helios-Workspace", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Helios-Core"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Helios-Workspace');
  3. smalltalk.packages["Helios-Workspace"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLCodeModel', globals.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "announcer",
  8. protocol: 'accessing',
  9. fn: function (){
  10. var self=this;
  11. function $Announcer(){return globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  12. return smalltalk.withContext(function($ctx1) {
  13. var $2,$1;
  14. $2=self["@announcer"];
  15. if(($receiver = $2) == nil || $receiver == null){
  16. self["@announcer"]=_st($Announcer())._new();
  17. $1=self["@announcer"];
  18. } else {
  19. $1=$2;
  20. };
  21. return $1;
  22. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLCodeModel)})},
  23. args: [],
  24. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  25. messageSends: ["ifNil:", "new"],
  26. referencedClasses: ["Announcer"]
  27. }),
  28. globals.HLCodeModel);
  29. smalltalk.addMethod(
  30. smalltalk.method({
  31. selector: "browse:",
  32. protocol: 'actions',
  33. fn: function (anObject){
  34. var self=this;
  35. return smalltalk.withContext(function($ctx1) {
  36. _st(anObject)._browse();
  37. return self}, function($ctx1) {$ctx1.fill(self,"browse:",{anObject:anObject},globals.HLCodeModel)})},
  38. args: ["anObject"],
  39. source: "browse: anObject\x0a\x09anObject browse",
  40. messageSends: ["browse"],
  41. referencedClasses: []
  42. }),
  43. globals.HLCodeModel);
  44. smalltalk.addMethod(
  45. smalltalk.method({
  46. selector: "defaultReceiver",
  47. protocol: 'defaults',
  48. fn: function (){
  49. var self=this;
  50. return smalltalk.withContext(function($ctx1) {
  51. var $1;
  52. $1=_st(self._environment())._doItReceiver();
  53. return $1;
  54. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},globals.HLCodeModel)})},
  55. args: [],
  56. source: "defaultReceiver\x0a\x09^ self environment doItReceiver",
  57. messageSends: ["doItReceiver", "environment"],
  58. referencedClasses: []
  59. }),
  60. globals.HLCodeModel);
  61. smalltalk.addMethod(
  62. smalltalk.method({
  63. selector: "doIt:",
  64. protocol: 'actions',
  65. fn: function (aString){
  66. var self=this;
  67. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  68. return smalltalk.withContext(function($ctx1) {
  69. var $1;
  70. $1=self._try_catch_((function(){
  71. return smalltalk.withContext(function($ctx2) {
  72. return _st(self._environment())._eval_on_(aString,self._receiver());
  73. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(e){
  74. return smalltalk.withContext(function($ctx2) {
  75. _st($ErrorHandler())._handleError_(e);
  76. return nil;
  77. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,2)})}));
  78. return $1;
  79. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},globals.HLCodeModel)})},
  80. args: ["aString"],
  81. source: "doIt: aString\x0a\x09\x22Evaluate aString in the receiver's `environment`.\x0a\x09\x0a\x09Note: Catch any error and handle it manually, bypassing\x0a\x09boot.js behavior to avoid the browser default action on\x0a\x09ctrl+d/ctrl+p.\x0a\x09\x0a\x09See https://github.com/amber-smalltalk/amber/issues/882\x22\x0a\x0a\x09^ self \x0a\x09\x09try: [ self environment eval: aString on: self receiver ]\x0a\x09\x09catch: [ :e | \x0a\x09\x09\x09ErrorHandler handleError: e.\x0a\x09\x09\x09nil ]",
  82. messageSends: ["try:catch:", "eval:on:", "environment", "receiver", "handleError:"],
  83. referencedClasses: ["ErrorHandler"]
  84. }),
  85. globals.HLCodeModel);
  86. smalltalk.addMethod(
  87. smalltalk.method({
  88. selector: "environment",
  89. protocol: 'accessing',
  90. fn: function (){
  91. var self=this;
  92. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  93. return smalltalk.withContext(function($ctx1) {
  94. var $2,$1;
  95. $2=self["@environment"];
  96. if(($receiver = $2) == nil || $receiver == null){
  97. $1=_st(_st($HLManager())._current())._environment();
  98. } else {
  99. $1=$2;
  100. };
  101. return $1;
  102. }, function($ctx1) {$ctx1.fill(self,"environment",{},globals.HLCodeModel)})},
  103. args: [],
  104. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  105. messageSends: ["ifNil:", "environment", "current"],
  106. referencedClasses: ["HLManager"]
  107. }),
  108. globals.HLCodeModel);
  109. smalltalk.addMethod(
  110. smalltalk.method({
  111. selector: "environment:",
  112. protocol: 'accessing',
  113. fn: function (anEnvironment){
  114. var self=this;
  115. self["@environment"]=anEnvironment;
  116. return self},
  117. args: ["anEnvironment"],
  118. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  119. messageSends: [],
  120. referencedClasses: []
  121. }),
  122. globals.HLCodeModel);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "inspect:",
  126. protocol: 'actions',
  127. fn: function (anObject){
  128. var self=this;
  129. return smalltalk.withContext(function($ctx1) {
  130. _st(self._environment())._inspect_(anObject);
  131. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},globals.HLCodeModel)})},
  132. args: ["anObject"],
  133. source: "inspect: anObject\x0a\x09self environment inspect: anObject",
  134. messageSends: ["inspect:", "environment"],
  135. referencedClasses: []
  136. }),
  137. globals.HLCodeModel);
  138. smalltalk.addMethod(
  139. smalltalk.method({
  140. selector: "receiver",
  141. protocol: 'accessing',
  142. fn: function (){
  143. var self=this;
  144. return smalltalk.withContext(function($ctx1) {
  145. var $2,$1;
  146. $2=self["@receiver"];
  147. if(($receiver = $2) == nil || $receiver == null){
  148. self["@receiver"]=self._defaultReceiver();
  149. $1=self["@receiver"];
  150. } else {
  151. $1=$2;
  152. };
  153. return $1;
  154. }, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.HLCodeModel)})},
  155. args: [],
  156. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  157. messageSends: ["ifNil:", "defaultReceiver"],
  158. referencedClasses: []
  159. }),
  160. globals.HLCodeModel);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "receiver:",
  164. protocol: 'accessing',
  165. fn: function (anObject){
  166. var self=this;
  167. self["@receiver"]=anObject;
  168. return self},
  169. args: ["anObject"],
  170. source: "receiver: anObject\x0a\x09receiver := anObject",
  171. messageSends: [],
  172. referencedClasses: []
  173. }),
  174. globals.HLCodeModel);
  175. smalltalk.addMethod(
  176. smalltalk.method({
  177. selector: "on:",
  178. protocol: 'actions',
  179. fn: function (anEnvironment){
  180. var self=this;
  181. return smalltalk.withContext(function($ctx1) {
  182. var $2,$3,$1;
  183. $2=self._new();
  184. _st($2)._environment_(anEnvironment);
  185. $3=_st($2)._yourself();
  186. $1=$3;
  187. return $1;
  188. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},globals.HLCodeModel.klass)})},
  189. args: ["anEnvironment"],
  190. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  191. messageSends: ["environment:", "new", "yourself"],
  192. referencedClasses: []
  193. }),
  194. globals.HLCodeModel.klass);
  195. smalltalk.addClass('HLCodeWidget', globals.HLWidget, ['model', 'wrapper', 'code', 'editor', 'state'], 'Helios-Workspace');
  196. smalltalk.addMethod(
  197. smalltalk.method({
  198. selector: "announcer",
  199. protocol: 'accessing',
  200. fn: function (){
  201. var self=this;
  202. return smalltalk.withContext(function($ctx1) {
  203. var $1;
  204. $1=_st(self._model())._announcer();
  205. return $1;
  206. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLCodeWidget)})},
  207. args: [],
  208. source: "announcer\x0a\x09^ self model announcer",
  209. messageSends: ["announcer", "model"],
  210. referencedClasses: []
  211. }),
  212. globals.HLCodeWidget);
  213. smalltalk.addMethod(
  214. smalltalk.method({
  215. selector: "browseIt",
  216. protocol: 'actions',
  217. fn: function (){
  218. var self=this;
  219. var result;
  220. function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
  221. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  222. return smalltalk.withContext(function($ctx1) {
  223. var $1;
  224. var $early={};
  225. try {
  226. result=_st((function(){
  227. return smalltalk.withContext(function($ctx2) {
  228. return self._doIt();
  229. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(exception){
  230. return smalltalk.withContext(function($ctx2) {
  231. $1=_st($ErrorHandler())._handleError_(exception);
  232. throw $early=[$1];
  233. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,2)})}));
  234. _st(self._model())._browse_(result);
  235. return self}
  236. catch(e) {if(e===$early)return e[0]; throw e}
  237. }, function($ctx1) {$ctx1.fill(self,"browseIt",{result:result},globals.HLCodeWidget)})},
  238. args: [],
  239. source: "browseIt\x0a\x09| result |\x0a\x09\x0a\x09result := [ self doIt ] on: Error do: [ :exception | \x0a\x09\x09^ ErrorHandler handleError: exception ].\x0a\x09\x09\x0a\x09self model browse: result",
  240. messageSends: ["on:do:", "doIt", "handleError:", "browse:", "model"],
  241. referencedClasses: ["Error", "ErrorHandler"]
  242. }),
  243. globals.HLCodeWidget);
  244. smalltalk.addMethod(
  245. smalltalk.method({
  246. selector: "canHaveFocus",
  247. protocol: 'testing',
  248. fn: function (){
  249. var self=this;
  250. return true;
  251. },
  252. args: [],
  253. source: "canHaveFocus\x0a\x09^ true",
  254. messageSends: [],
  255. referencedClasses: []
  256. }),
  257. globals.HLCodeWidget);
  258. smalltalk.addMethod(
  259. smalltalk.method({
  260. selector: "clear",
  261. protocol: 'actions',
  262. fn: function (){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx1) {
  265. self._contents_("");
  266. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},globals.HLCodeWidget)})},
  267. args: [],
  268. source: "clear\x0a\x09self contents: ''",
  269. messageSends: ["contents:"],
  270. referencedClasses: []
  271. }),
  272. globals.HLCodeWidget);
  273. smalltalk.addMethod(
  274. smalltalk.method({
  275. selector: "configureEditor",
  276. protocol: 'actions',
  277. fn: function (){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) {
  280. var $1,$2,$3;
  281. $1=self._editor();
  282. $ctx1.sendIdx["editor"]=1;
  283. _st($1)._at_put_("amberCodeWidget",self);
  284. $2=self._editor();
  285. $ctx1.sendIdx["editor"]=2;
  286. _st($2)._on_do_("change",(function(){
  287. return smalltalk.withContext(function($ctx2) {
  288. return self._onChange();
  289. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  290. _st(_st(self._wrapper())._asJQuery())._on_in_do_("mousedown",".CodeMirror pre",(function(event){
  291. var position,node;
  292. return smalltalk.withContext(function($ctx2) {
  293. $3=_st(event)._at_("ctrlKey");
  294. if(smalltalk.assert($3)){
  295. position=_st(self._editor())._coordsChar_(globals.HashedCollection._newFromPairs_(["left",_st(event)._clientX(),"top",_st(event)._clientY()]));
  296. position;
  297. self._onCtrlClickAt_(_st(_st(_st(position)._line()).__at(_st(position)._ch())).__plus((1)));
  298. return _st(event)._preventDefault();
  299. };
  300. }, function($ctx2) {$ctx2.fillBlock({event:event,position:position,node:node},$ctx1,2)})}));
  301. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLCodeWidget)})},
  302. args: [],
  303. source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self.\x0a\x09self editor on: 'change' do: [ self onChange ].\x0a\x0a\x09self wrapper asJQuery on: 'mousedown' in: '.CodeMirror pre' do: [ :event | | position node |\x0a\x09\x09(event at: 'ctrlKey') ifTrue: [\x0a\x09\x09\x09position := self editor coordsChar: #{ \x0a\x09\x09\x09\x09'left' -> event clientX.\x0a\x09\x09\x09\x09'top' -> event clientY\x0a\x09\x09\x09}.\x0a\x09\x09\x09self onCtrlClickAt: (position line @ position ch) + 1.\x0a\x09\x09\x09event preventDefault ] ]",
  304. messageSends: ["at:put:", "editor", "on:do:", "onChange", "on:in:do:", "asJQuery", "wrapper", "ifTrue:", "at:", "coordsChar:", "clientX", "clientY", "onCtrlClickAt:", "+", "@", "line", "ch", "preventDefault"],
  305. referencedClasses: []
  306. }),
  307. globals.HLCodeWidget);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "contents",
  311. protocol: 'accessing',
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) {
  315. var $1;
  316. $1=_st(self["@editor"])._getValue();
  317. return $1;
  318. }, function($ctx1) {$ctx1.fill(self,"contents",{},globals.HLCodeWidget)})},
  319. args: [],
  320. source: "contents\x0a\x09^ editor getValue",
  321. messageSends: ["getValue"],
  322. referencedClasses: []
  323. }),
  324. globals.HLCodeWidget);
  325. smalltalk.addMethod(
  326. smalltalk.method({
  327. selector: "contents:",
  328. protocol: 'accessing',
  329. fn: function (aString){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx1) {
  332. var $1;
  333. _st(self["@editor"])._setValue_(aString);
  334. $1=self["@state"];
  335. if(($receiver = $1) == nil || $receiver == null){
  336. $1;
  337. } else {
  338. self._updateState();
  339. };
  340. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLCodeWidget)})},
  341. args: ["aString"],
  342. source: "contents: aString\x0a\x09editor setValue: aString.\x0a\x09state ifNotNil: [ self updateState ]",
  343. messageSends: ["setValue:", "ifNotNil:", "updateState"],
  344. referencedClasses: []
  345. }),
  346. globals.HLCodeWidget);
  347. smalltalk.addMethod(
  348. smalltalk.method({
  349. selector: "currentLine",
  350. protocol: 'accessing',
  351. fn: function (){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) {
  354. var $1;
  355. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  356. return $1;
  357. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},globals.HLCodeWidget)})},
  358. args: [],
  359. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  360. messageSends: ["getLine:", "line", "getCursor"],
  361. referencedClasses: []
  362. }),
  363. globals.HLCodeWidget);
  364. smalltalk.addMethod(
  365. smalltalk.method({
  366. selector: "currentLineOrSelection",
  367. protocol: 'accessing',
  368. fn: function (){
  369. var self=this;
  370. return smalltalk.withContext(function($ctx1) {
  371. var $2,$1;
  372. $2=_st(self["@editor"])._somethingSelected();
  373. if(smalltalk.assert($2)){
  374. $1=self._selection();
  375. } else {
  376. $1=self._currentLine();
  377. };
  378. return $1;
  379. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},globals.HLCodeWidget)})},
  380. args: [],
  381. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
  382. messageSends: ["ifFalse:ifTrue:", "somethingSelected", "currentLine", "selection"],
  383. referencedClasses: []
  384. }),
  385. globals.HLCodeWidget);
  386. smalltalk.addMethod(
  387. smalltalk.method({
  388. selector: "doIt",
  389. protocol: 'actions',
  390. fn: function (){
  391. var self=this;
  392. var result;
  393. function $HLDoItExecuted(){return globals.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  394. return smalltalk.withContext(function($ctx1) {
  395. var $1,$2;
  396. $1=self._model();
  397. $ctx1.sendIdx["model"]=1;
  398. result=_st($1)._doIt_(self._currentLineOrSelection());
  399. _st(_st(self._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  400. $2=result;
  401. return $2;
  402. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},globals.HLCodeWidget)})},
  403. args: [],
  404. source: "doIt\x0a\x09| result |\x0a\x0a\x09result := self model doIt: self currentLineOrSelection.\x0a\x09self model announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result",
  405. messageSends: ["doIt:", "model", "currentLineOrSelection", "announce:", "announcer", "on:"],
  406. referencedClasses: ["HLDoItExecuted"]
  407. }),
  408. globals.HLCodeWidget);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "editor",
  412. protocol: 'actions',
  413. fn: function (){
  414. var self=this;
  415. var $1;
  416. $1=self["@editor"];
  417. return $1;
  418. },
  419. args: [],
  420. source: "editor\x0a\x09^ editor",
  421. messageSends: [],
  422. referencedClasses: []
  423. }),
  424. globals.HLCodeWidget);
  425. smalltalk.addMethod(
  426. smalltalk.method({
  427. selector: "editorOptions",
  428. protocol: 'accessing',
  429. fn: function (){
  430. var self=this;
  431. function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  432. return smalltalk.withContext(function($ctx1) {
  433. var $2,$1;
  434. $2="helios.codeMirrorTheme"._settingValueIfAbsent_("default helios");
  435. $ctx1.sendIdx["settingValueIfAbsent:"]=1;
  436. $1=globals.HashedCollection._newFromPairs_(["theme",$2,"mode","text/x-stsrc","lineNumbers",true,"enterMode","flat","indentWithTabs",true,"indentUnit",(4),"matchBrackets",true,"electricChars",false,"keyMap","Amber","extraKeys",_st($HashedCollection())._with_(_st("helios.completionKey"._settingValueIfAbsent_("Shift-Space")).__minus_gt("autocomplete"))]);
  437. return $1;
  438. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},globals.HLCodeWidget)})},
  439. args: [],
  440. source: "editorOptions\x0a\x09^ #{\x0a\x09\x09'theme' -> ('helios.codeMirrorTheme' settingValueIfAbsent: 'default helios').\x0a\x09\x09'mode' -> 'text/x-stsrc'.\x0a 'lineNumbers' -> true.\x0a 'enterMode' -> 'flat'.\x0a 'indentWithTabs' -> true.\x0a\x09\x09'indentUnit' -> 4.\x0a 'matchBrackets' -> true.\x0a 'electricChars' -> false.\x0a\x09\x09'keyMap' -> 'Amber'.\x0a\x09\x09'extraKeys' -> (HashedCollection with: ('helios.completionKey' settingValueIfAbsent: 'Shift-Space') -> 'autocomplete')\x0a\x09}",
  441. messageSends: ["settingValueIfAbsent:", "with:", "->"],
  442. referencedClasses: ["HashedCollection"]
  443. }),
  444. globals.HLCodeWidget);
  445. smalltalk.addMethod(
  446. smalltalk.method({
  447. selector: "focus",
  448. protocol: 'actions',
  449. fn: function (){
  450. var self=this;
  451. return smalltalk.withContext(function($ctx1) {
  452. _st(self["@editor"])._focus();
  453. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLCodeWidget)})},
  454. args: [],
  455. source: "focus\x0a\x09editor focus",
  456. messageSends: ["focus"],
  457. referencedClasses: []
  458. }),
  459. globals.HLCodeWidget);
  460. smalltalk.addMethod(
  461. smalltalk.method({
  462. selector: "hasFocus",
  463. protocol: 'testing',
  464. fn: function (){
  465. var self=this;
  466. return smalltalk.withContext(function($ctx1) {
  467. var $1;
  468. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  469. return $1;
  470. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},globals.HLCodeWidget)})},
  471. args: [],
  472. source: "hasFocus\x0a\x09^ code asJQuery is: ':active'",
  473. messageSends: ["is:", "asJQuery"],
  474. referencedClasses: []
  475. }),
  476. globals.HLCodeWidget);
  477. smalltalk.addMethod(
  478. smalltalk.method({
  479. selector: "hasModification",
  480. protocol: 'testing',
  481. fn: function (){
  482. var self=this;
  483. return false;
  484. },
  485. args: [],
  486. source: "hasModification\x0a\x09^ false",
  487. messageSends: [],
  488. referencedClasses: []
  489. }),
  490. globals.HLCodeWidget);
  491. smalltalk.addMethod(
  492. smalltalk.method({
  493. selector: "inspectIt",
  494. protocol: 'actions',
  495. fn: function (){
  496. var self=this;
  497. return smalltalk.withContext(function($ctx1) {
  498. _st(self._model())._inspect_(self._doIt());
  499. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{},globals.HLCodeWidget)})},
  500. args: [],
  501. source: "inspectIt\x0a\x09self model inspect: self doIt",
  502. messageSends: ["inspect:", "model", "doIt"],
  503. referencedClasses: []
  504. }),
  505. globals.HLCodeWidget);
  506. smalltalk.addMethod(
  507. smalltalk.method({
  508. selector: "messageHintFor:token:",
  509. protocol: 'hints',
  510. fn: function (anEditor,aToken){
  511. var self=this;
  512. function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  513. return smalltalk.withContext(function($ctx1) {
  514. var $2,$1;
  515. $1=_st(_st(_st(_st(_st($Smalltalk())._vm())._allSelectors())._asArray())._select_((function(each){
  516. return smalltalk.withContext(function($ctx2) {
  517. $2=_st(aToken)._string();
  518. $ctx2.sendIdx["string"]=1;
  519. return _st(each)._includesSubString_($2);
  520. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._reject_((function(each){
  521. return smalltalk.withContext(function($ctx2) {
  522. return _st(each).__eq(_st(aToken)._string());
  523. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  524. return $1;
  525. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget)})},
  526. args: ["anEditor", "aToken"],
  527. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (Smalltalk vm allSelectors asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  528. messageSends: ["reject:", "select:", "asArray", "allSelectors", "vm", "includesSubString:", "string", "="],
  529. referencedClasses: ["Smalltalk"]
  530. }),
  531. globals.HLCodeWidget);
  532. smalltalk.addMethod(
  533. smalltalk.method({
  534. selector: "model",
  535. protocol: 'accessing',
  536. fn: function (){
  537. var self=this;
  538. function $HLCodeModel(){return globals.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  539. return smalltalk.withContext(function($ctx1) {
  540. var $2,$1;
  541. $2=self["@model"];
  542. if(($receiver = $2) == nil || $receiver == null){
  543. self["@model"]=_st($HLCodeModel())._new();
  544. $1=self["@model"];
  545. } else {
  546. $1=$2;
  547. };
  548. return $1;
  549. }, function($ctx1) {$ctx1.fill(self,"model",{},globals.HLCodeWidget)})},
  550. args: [],
  551. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  552. messageSends: ["ifNil:", "new"],
  553. referencedClasses: ["HLCodeModel"]
  554. }),
  555. globals.HLCodeWidget);
  556. smalltalk.addMethod(
  557. smalltalk.method({
  558. selector: "model:",
  559. protocol: 'accessing',
  560. fn: function (aModel){
  561. var self=this;
  562. self["@model"]=aModel;
  563. return self},
  564. args: ["aModel"],
  565. source: "model: aModel\x0a\x09model := aModel",
  566. messageSends: [],
  567. referencedClasses: []
  568. }),
  569. globals.HLCodeWidget);
  570. smalltalk.addMethod(
  571. smalltalk.method({
  572. selector: "navigateTo:",
  573. protocol: 'actions',
  574. fn: function (aString){
  575. var self=this;
  576. function $Finder(){return globals.Finder||(typeof Finder=="undefined"?nil:Finder)}
  577. return smalltalk.withContext(function($ctx1) {
  578. _st($Finder())._findString_(aString);
  579. return self}, function($ctx1) {$ctx1.fill(self,"navigateTo:",{aString:aString},globals.HLCodeWidget)})},
  580. args: ["aString"],
  581. source: "navigateTo: aString\x0a\x09Finder findString: aString",
  582. messageSends: ["findString:"],
  583. referencedClasses: ["Finder"]
  584. }),
  585. globals.HLCodeWidget);
  586. smalltalk.addMethod(
  587. smalltalk.method({
  588. selector: "navigateToReference:",
  589. protocol: 'actions',
  590. fn: function (aString){
  591. var self=this;
  592. function $HLReferences(){return globals.HLReferences||(typeof HLReferences=="undefined"?nil:HLReferences)}
  593. return smalltalk.withContext(function($ctx1) {
  594. _st(_st($HLReferences())._openAsTab())._search_(aString);
  595. return self}, function($ctx1) {$ctx1.fill(self,"navigateToReference:",{aString:aString},globals.HLCodeWidget)})},
  596. args: ["aString"],
  597. source: "navigateToReference: aString\x0a\x09(HLReferences openAsTab)\x0a\x09\x09search: aString",
  598. messageSends: ["search:", "openAsTab"],
  599. referencedClasses: ["HLReferences"]
  600. }),
  601. globals.HLCodeWidget);
  602. smalltalk.addMethod(
  603. smalltalk.method({
  604. selector: "onChange",
  605. protocol: 'reactions',
  606. fn: function (){
  607. var self=this;
  608. return smalltalk.withContext(function($ctx1) {
  609. self._updateState();
  610. return self}, function($ctx1) {$ctx1.fill(self,"onChange",{},globals.HLCodeWidget)})},
  611. args: [],
  612. source: "onChange\x0a\x09self updateState",
  613. messageSends: ["updateState"],
  614. referencedClasses: []
  615. }),
  616. globals.HLCodeWidget);
  617. smalltalk.addMethod(
  618. smalltalk.method({
  619. selector: "onCtrlClickAt:",
  620. protocol: 'reactions',
  621. fn: function (aPoint){
  622. var self=this;
  623. var ast,node;
  624. function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  625. function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
  626. return smalltalk.withContext(function($ctx1) {
  627. var $early={};
  628. try {
  629. ast=_st((function(){
  630. return smalltalk.withContext(function($ctx2) {
  631. return _st($Smalltalk())._parse_(_st(self._editor())._getValue());
  632. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(error){
  633. throw $early=[self];
  634. }));
  635. node=_st(ast)._navigationNodeAt_ifAbsent_(aPoint,(function(){
  636. throw $early=[nil];
  637. }));
  638. self._navigateTo_(_st(node)._navigationLink());
  639. return self}
  640. catch(e) {if(e===$early)return e[0]; throw e}
  641. }, function($ctx1) {$ctx1.fill(self,"onCtrlClickAt:",{aPoint:aPoint,ast:ast,node:node},globals.HLCodeWidget)})},
  642. args: ["aPoint"],
  643. source: "onCtrlClickAt: aPoint\x0a\x09| ast node |\x0a\x09\x0a\x09ast := [ Smalltalk parse: self editor getValue ] \x0a\x09\x09on: Error \x0a\x09\x09do: [ :error | ^ self ].\x0a\x09\x0a\x09node := ast \x0a\x09\x09navigationNodeAt: aPoint \x0a\x09\x09ifAbsent: [ ^ nil ].\x0a\x09\x09\x0a\x09self navigateTo: node navigationLink",
  644. messageSends: ["on:do:", "parse:", "getValue", "editor", "navigationNodeAt:ifAbsent:", "navigateTo:", "navigationLink"],
  645. referencedClasses: ["Smalltalk", "Error"]
  646. }),
  647. globals.HLCodeWidget);
  648. smalltalk.addMethod(
  649. smalltalk.method({
  650. selector: "onInspectIt",
  651. protocol: 'reactions',
  652. fn: function (){
  653. var self=this;
  654. return smalltalk.withContext(function($ctx1) {
  655. self._inspectIt();
  656. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},globals.HLCodeWidget)})},
  657. args: [],
  658. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  659. messageSends: ["inspectIt"],
  660. referencedClasses: []
  661. }),
  662. globals.HLCodeWidget);
  663. smalltalk.addMethod(
  664. smalltalk.method({
  665. selector: "onPrintIt",
  666. protocol: 'reactions',
  667. fn: function (){
  668. var self=this;
  669. return smalltalk.withContext(function($ctx1) {
  670. self._printIt();
  671. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},globals.HLCodeWidget)})},
  672. args: [],
  673. source: "onPrintIt\x0a\x0a\x09self printIt",
  674. messageSends: ["printIt"],
  675. referencedClasses: []
  676. }),
  677. globals.HLCodeWidget);
  678. smalltalk.addMethod(
  679. smalltalk.method({
  680. selector: "onSaveIt",
  681. protocol: 'reactions',
  682. fn: function (){
  683. var self=this;
  684. return self},
  685. args: [],
  686. source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
  687. messageSends: [],
  688. referencedClasses: []
  689. }),
  690. globals.HLCodeWidget);
  691. smalltalk.addMethod(
  692. smalltalk.method({
  693. selector: "print:",
  694. protocol: 'actions',
  695. fn: function (aString){
  696. var self=this;
  697. var start,stop,currentLine;
  698. function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  699. return smalltalk.withContext(function($ctx1) {
  700. var $1,$2,$4,$3,$5,$6,$7,$8,$9,$10,$12,$11;
  701. $1=_st(self["@editor"])._getCursor_(false);
  702. $ctx1.sendIdx["getCursor:"]=1;
  703. currentLine=_st($1)._line();
  704. start=_st($HashedCollection())._new();
  705. $ctx1.sendIdx["new"]=1;
  706. _st(start)._at_put_("line",currentLine);
  707. $ctx1.sendIdx["at:put:"]=1;
  708. $2=start;
  709. $4=_st(self["@editor"])._getCursor_(false);
  710. $ctx1.sendIdx["getCursor:"]=2;
  711. $3=_st($4)._ch();
  712. _st($2)._at_put_("ch",$3);
  713. $ctx1.sendIdx["at:put:"]=2;
  714. $5=_st(self["@editor"])._getSelection();
  715. $ctx1.sendIdx["getSelection"]=1;
  716. _st($5)._ifEmpty_((function(){
  717. return smalltalk.withContext(function($ctx2) {
  718. $6=start;
  719. $7=_st(_st(self["@editor"])._getLine_(currentLine))._size();
  720. $ctx2.sendIdx["size"]=1;
  721. _st($6)._at_put_("ch",$7);
  722. $ctx2.sendIdx["at:put:"]=3;
  723. return _st(self["@editor"])._setSelection_end_(globals.HashedCollection._newFromPairs_(["line",currentLine,"ch",(0)]),start);
  724. $ctx2.sendIdx["setSelection:end:"]=1;
  725. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  726. stop=_st($HashedCollection())._new();
  727. _st(stop)._at_put_("line",currentLine);
  728. $ctx1.sendIdx["at:put:"]=4;
  729. $8=stop;
  730. $9=_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2));
  731. $ctx1.sendIdx["+"]=1;
  732. _st($8)._at_put_("ch",$9);
  733. $10=self["@editor"];
  734. $12=_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString);
  735. $ctx1.sendIdx[","]=2;
  736. $11=_st($12).__comma(" ");
  737. $ctx1.sendIdx[","]=1;
  738. _st($10)._replaceSelection_($11);
  739. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  740. _st(self["@editor"])._setSelection_end_(stop,start);
  741. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},globals.HLCodeWidget)})},
  742. args: ["aString"],
  743. source: "print: aString\x0a\x09| start stop currentLine |\x0a currentLine := (editor getCursor: false) line.\x0a\x09start := HashedCollection new.\x0a\x09start at: 'line' put: currentLine.\x0a\x09start at: 'ch' put: (editor getCursor: false) ch.\x0a (editor getSelection) ifEmpty: [\x0a \x09\x22select current line if selection is empty\x22\x0a \x09start at: 'ch' put: (editor getLine: currentLine) size.\x0a editor setSelection: #{'line' -> currentLine. 'ch' -> 0} end: start.\x0a ].\x0a\x09stop := HashedCollection new.\x0a\x09stop at: 'line' put: currentLine.\x0a\x09stop at: 'ch' put: ((start at: 'ch') + aString size + 2).\x0a\x0a\x09editor replaceSelection: (editor getSelection, ' ', aString, ' ').\x0a\x09editor setCursor: (editor getCursor: true).\x0a\x09editor setSelection: stop end: start",
  744. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "getSelection", "size", "getLine:", "setSelection:end:", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  745. referencedClasses: ["HashedCollection"]
  746. }),
  747. globals.HLCodeWidget);
  748. smalltalk.addMethod(
  749. smalltalk.method({
  750. selector: "printIt",
  751. protocol: 'actions',
  752. fn: function (){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. self._print_(_st(self._doIt())._printString());
  756. self._focus();
  757. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{},globals.HLCodeWidget)})},
  758. args: [],
  759. source: "printIt\x0a\x09self print: self doIt printString.\x0a\x09self focus.",
  760. messageSends: ["print:", "printString", "doIt", "focus"],
  761. referencedClasses: []
  762. }),
  763. globals.HLCodeWidget);
  764. smalltalk.addMethod(
  765. smalltalk.method({
  766. selector: "receiver",
  767. protocol: 'accessing',
  768. fn: function (){
  769. var self=this;
  770. return smalltalk.withContext(function($ctx1) {
  771. var $1;
  772. $1=_st(self._model())._receiver();
  773. return $1;
  774. }, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.HLCodeWidget)})},
  775. args: [],
  776. source: "receiver\x0a\x09^ self model receiver",
  777. messageSends: ["receiver", "model"],
  778. referencedClasses: []
  779. }),
  780. globals.HLCodeWidget);
  781. smalltalk.addMethod(
  782. smalltalk.method({
  783. selector: "receiver:",
  784. protocol: 'accessing',
  785. fn: function (anObject){
  786. var self=this;
  787. return smalltalk.withContext(function($ctx1) {
  788. _st(self._model())._receiver_(anObject);
  789. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},globals.HLCodeWidget)})},
  790. args: ["anObject"],
  791. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  792. messageSends: ["receiver:", "model"],
  793. referencedClasses: []
  794. }),
  795. globals.HLCodeWidget);
  796. smalltalk.addMethod(
  797. smalltalk.method({
  798. selector: "renderButtonsOn:",
  799. protocol: 'rendering',
  800. fn: function (html){
  801. var self=this;
  802. return smalltalk.withContext(function($ctx1) {
  803. var $1,$2,$3,$4,$5,$6,$7,$8;
  804. $1=_st(html)._button();
  805. $ctx1.sendIdx["button"]=1;
  806. _st($1)._class_("button");
  807. $ctx1.sendIdx["class:"]=1;
  808. _st($1)._with_("DoIt");
  809. $ctx1.sendIdx["with:"]=1;
  810. $2=_st($1)._onClick_((function(){
  811. return smalltalk.withContext(function($ctx2) {
  812. return self._doIt();
  813. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  814. $ctx1.sendIdx["onClick:"]=1;
  815. $3=_st(html)._button();
  816. $ctx1.sendIdx["button"]=2;
  817. _st($3)._class_("button");
  818. $ctx1.sendIdx["class:"]=2;
  819. _st($3)._with_("PrintIt");
  820. $ctx1.sendIdx["with:"]=2;
  821. $4=_st($3)._onClick_((function(){
  822. return smalltalk.withContext(function($ctx2) {
  823. return self._printIt();
  824. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  825. $ctx1.sendIdx["onClick:"]=2;
  826. $5=_st(html)._button();
  827. $ctx1.sendIdx["button"]=3;
  828. _st($5)._class_("button");
  829. $ctx1.sendIdx["class:"]=3;
  830. _st($5)._with_("InspectIt");
  831. $ctx1.sendIdx["with:"]=3;
  832. $6=_st($5)._onClick_((function(){
  833. return smalltalk.withContext(function($ctx2) {
  834. return self._inspectIt();
  835. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  836. $ctx1.sendIdx["onClick:"]=3;
  837. $7=_st(html)._button();
  838. _st($7)._class_("button");
  839. _st($7)._with_("BrowseIt");
  840. $8=_st($7)._onClick_((function(){
  841. return smalltalk.withContext(function($ctx2) {
  842. return self._browseIt();
  843. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
  844. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLCodeWidget)})},
  845. args: ["html"],
  846. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'DoIt';\x0a\x09\x09onClick: [ self doIt ].\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'PrintIt';\x0a\x09\x09onClick: [ self printIt ].\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'InspectIt';\x0a\x09\x09onClick: [ self inspectIt ].\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'BrowseIt';\x0a\x09\x09onClick: [ self browseIt ]",
  847. messageSends: ["class:", "button", "with:", "onClick:", "doIt", "printIt", "inspectIt", "browseIt"],
  848. referencedClasses: []
  849. }),
  850. globals.HLCodeWidget);
  851. smalltalk.addMethod(
  852. smalltalk.method({
  853. selector: "renderContentOn:",
  854. protocol: 'rendering',
  855. fn: function (html){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) {
  858. var $1,$2,$3,$4,$5,$6;
  859. $1=_st(html)._div();
  860. $ctx1.sendIdx["div"]=1;
  861. _st($1)._class_("editor");
  862. $ctx1.sendIdx["class:"]=1;
  863. $2=_st($1)._with_((function(){
  864. return smalltalk.withContext(function($ctx2) {
  865. self["@code"]=_st(html)._textarea();
  866. return self["@code"];
  867. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  868. $ctx1.sendIdx["with:"]=1;
  869. $3=_st(html)._div();
  870. $ctx1.sendIdx["div"]=2;
  871. self["@state"]=_st($3)._class_("state");
  872. $ctx1.sendIdx["class:"]=2;
  873. $4=_st(html)._div();
  874. _st($4)._class_("buttons_bar");
  875. $5=_st($4)._with_((function(){
  876. return smalltalk.withContext(function($ctx2) {
  877. return self._renderButtonsOn_(html);
  878. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  879. self._setEditorOn_(_st(self["@code"])._element());
  880. self._configureEditor();
  881. $6=self._updateState();
  882. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLCodeWidget)})},
  883. args: ["html"],
  884. source: "renderContentOn: html\x0a\x09html div class: 'editor'; with: [\x0a\x09\x09code := html textarea ].\x0a\x09state := html div class: 'state'.\x0a\x09\x0a\x09html div \x0a\x09\x09class: 'buttons_bar';\x0a\x09\x09with: [ self renderButtonsOn: html ].\x0a\x09\x0a\x09self \x0a\x09\x09setEditorOn: code element;\x0a\x09\x09configureEditor;\x0a\x09\x09updateState",
  885. messageSends: ["class:", "div", "with:", "textarea", "renderButtonsOn:", "setEditorOn:", "element", "configureEditor", "updateState"],
  886. referencedClasses: []
  887. }),
  888. globals.HLCodeWidget);
  889. smalltalk.addMethod(
  890. smalltalk.method({
  891. selector: "saveIt",
  892. protocol: 'actions',
  893. fn: function (){
  894. var self=this;
  895. return self},
  896. args: [],
  897. source: "saveIt\x0a\x09\x22I do not do anything\x22",
  898. messageSends: [],
  899. referencedClasses: []
  900. }),
  901. globals.HLCodeWidget);
  902. smalltalk.addMethod(
  903. smalltalk.method({
  904. selector: "selection",
  905. protocol: 'accessing',
  906. fn: function (){
  907. var self=this;
  908. return smalltalk.withContext(function($ctx1) {
  909. var $1;
  910. $1=_st(self["@editor"])._getSelection();
  911. return $1;
  912. }, function($ctx1) {$ctx1.fill(self,"selection",{},globals.HLCodeWidget)})},
  913. args: [],
  914. source: "selection\x0a\x09^editor getSelection",
  915. messageSends: ["getSelection"],
  916. referencedClasses: []
  917. }),
  918. globals.HLCodeWidget);
  919. smalltalk.addMethod(
  920. smalltalk.method({
  921. selector: "selectionEnd",
  922. protocol: 'accessing',
  923. fn: function (){
  924. var self=this;
  925. return smalltalk.withContext(function($ctx1) {
  926. var $1;
  927. $1=_st(_st(self["@code"])._element())._selectionEnd();
  928. return $1;
  929. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},globals.HLCodeWidget)})},
  930. args: [],
  931. source: "selectionEnd\x0a ^code element selectionEnd",
  932. messageSends: ["selectionEnd", "element"],
  933. referencedClasses: []
  934. }),
  935. globals.HLCodeWidget);
  936. smalltalk.addMethod(
  937. smalltalk.method({
  938. selector: "selectionEnd:",
  939. protocol: 'accessing',
  940. fn: function (anInteger){
  941. var self=this;
  942. return smalltalk.withContext(function($ctx1) {
  943. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  944. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},globals.HLCodeWidget)})},
  945. args: ["anInteger"],
  946. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  947. messageSends: ["selectionEnd:", "element"],
  948. referencedClasses: []
  949. }),
  950. globals.HLCodeWidget);
  951. smalltalk.addMethod(
  952. smalltalk.method({
  953. selector: "selectionStart",
  954. protocol: 'accessing',
  955. fn: function (){
  956. var self=this;
  957. return smalltalk.withContext(function($ctx1) {
  958. var $1;
  959. $1=_st(_st(self["@code"])._element())._selectionStart();
  960. return $1;
  961. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},globals.HLCodeWidget)})},
  962. args: [],
  963. source: "selectionStart\x0a ^code element selectionStart",
  964. messageSends: ["selectionStart", "element"],
  965. referencedClasses: []
  966. }),
  967. globals.HLCodeWidget);
  968. smalltalk.addMethod(
  969. smalltalk.method({
  970. selector: "selectionStart:",
  971. protocol: 'accessing',
  972. fn: function (anInteger){
  973. var self=this;
  974. return smalltalk.withContext(function($ctx1) {
  975. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  976. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},globals.HLCodeWidget)})},
  977. args: ["anInteger"],
  978. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  979. messageSends: ["selectionStart:", "element"],
  980. referencedClasses: []
  981. }),
  982. globals.HLCodeWidget);
  983. smalltalk.addMethod(
  984. smalltalk.method({
  985. selector: "setEditorOn:",
  986. protocol: 'actions',
  987. fn: function (aTextarea){
  988. var self=this;
  989. return smalltalk.withContext(function($ctx1) {
  990. self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions());
  991. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},globals.HLCodeWidget)})},
  992. args: ["aTextarea"],
  993. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions())>",
  994. messageSends: [],
  995. referencedClasses: []
  996. }),
  997. globals.HLCodeWidget);
  998. smalltalk.addMethod(
  999. smalltalk.method({
  1000. selector: "updateState",
  1001. protocol: 'updating',
  1002. fn: function (){
  1003. var self=this;
  1004. return smalltalk.withContext(function($ctx1) {
  1005. var $1,$2;
  1006. $1=self._hasModification();
  1007. if(smalltalk.assert($1)){
  1008. $2=_st(self["@state"])._asJQuery();
  1009. $ctx1.sendIdx["asJQuery"]=1;
  1010. _st($2)._addClass_("modified");
  1011. } else {
  1012. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  1013. };
  1014. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},globals.HLCodeWidget)})},
  1015. args: [],
  1016. source: "updateState\x0a\x09self hasModification \x0a\x09\x09ifTrue: [ state asJQuery addClass: 'modified' ]\x0a\x09\x09ifFalse: [ state asJQuery removeClass: 'modified' ]",
  1017. messageSends: ["ifTrue:ifFalse:", "hasModification", "addClass:", "asJQuery", "removeClass:"],
  1018. referencedClasses: []
  1019. }),
  1020. globals.HLCodeWidget);
  1021. smalltalk.addMethod(
  1022. smalltalk.method({
  1023. selector: "variableHintFor:token:",
  1024. protocol: 'hints',
  1025. fn: function (anEditor,aToken){
  1026. var self=this;
  1027. var variables,classNames,pseudoVariables;
  1028. function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1029. return smalltalk.withContext(function($ctx1) {
  1030. var $3,$2,$1,$9,$8,$7,$6,$10,$5,$4;
  1031. $3=_st(_st(_st(anEditor)._display())._wrapper())._asJQuery();
  1032. $ctx1.sendIdx["asJQuery"]=1;
  1033. $2=_st($3)._find_("span.cm-variable");
  1034. $1=_st($2)._get();
  1035. variables=_st($1)._collect_((function(each){
  1036. return smalltalk.withContext(function($ctx2) {
  1037. return _st(_st(each)._asJQuery())._html();
  1038. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1039. $ctx1.sendIdx["collect:"]=1;
  1040. classNames=_st(_st($Smalltalk())._classes())._collect_((function(each){
  1041. return smalltalk.withContext(function($ctx2) {
  1042. return _st(each)._name();
  1043. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  1044. pseudoVariables=_st($Smalltalk())._pseudoVariableNames();
  1045. $9=_st(_st(variables).__comma(classNames)).__comma(pseudoVariables);
  1046. $ctx1.sendIdx[","]=1;
  1047. $8=_st($9)._asSet();
  1048. $7=_st($8)._asArray();
  1049. $6=_st($7)._sort();
  1050. $5=_st($6)._select_((function(each){
  1051. return smalltalk.withContext(function($ctx2) {
  1052. $10=_st(aToken)._string();
  1053. $ctx2.sendIdx["string"]=1;
  1054. return _st(each)._includesSubString_($10);
  1055. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  1056. $4=_st($5)._reject_((function(each){
  1057. return smalltalk.withContext(function($ctx2) {
  1058. return _st(each).__eq(_st(aToken)._string());
  1059. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  1060. return $4;
  1061. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},globals.HLCodeWidget)})},
  1062. args: ["anEditor", "aToken"],
  1063. source: "variableHintFor: anEditor token: aToken\x0a\x09| variables classNames pseudoVariables |\x0a\x09\x0a\x09variables := (anEditor display wrapper asJQuery find: 'span.cm-variable') get\x0a\x09\x09collect: [ :each | each asJQuery html ].\x0a\x09\x0a\x09classNames := Smalltalk classes collect: [ :each | each name ].\x0a\x09pseudoVariables := Smalltalk pseudoVariableNames.\x0a\x09\x0a\x09^ ((variables, classNames, pseudoVariables) asSet asArray sort\x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  1064. messageSends: ["collect:", "get", "find:", "asJQuery", "wrapper", "display", "html", "classes", "name", "pseudoVariableNames", "reject:", "select:", "sort", "asArray", "asSet", ",", "includesSubString:", "string", "="],
  1065. referencedClasses: ["Smalltalk"]
  1066. }),
  1067. globals.HLCodeWidget);
  1068. smalltalk.addMethod(
  1069. smalltalk.method({
  1070. selector: "hintFor:options:",
  1071. protocol: 'hints',
  1072. fn: function (anEditor,options){
  1073. var self=this;
  1074. var cursor,token,completions;
  1075. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1076. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1077. return smalltalk.withContext(function($ctx1) {
  1078. var $1,$4,$3,$2,$5,$7,$9,$10,$8,$6;
  1079. cursor=_st(anEditor)._getCursor();
  1080. token=_st(anEditor)._getTokenAt_(cursor);
  1081. $1=token;
  1082. $4=_st($CodeMirror())._basicAt_("innerMode");
  1083. $ctx1.sendIdx["basicAt:"]=1;
  1084. $3=_st($4)._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state"));
  1085. $ctx1.sendIdx["value:value:"]=1;
  1086. $2=_st($3)._state();
  1087. _st($1)._at_put_("state",$2);
  1088. $5=_st(_st(token)._type()).__eq("variable");
  1089. if(smalltalk.assert($5)){
  1090. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  1091. } else {
  1092. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  1093. };
  1094. $7=completions;
  1095. $9=_st($CodeMirror())._basicAt_("Pos");
  1096. $ctx1.sendIdx["basicAt:"]=2;
  1097. $10=_st(cursor)._line();
  1098. $ctx1.sendIdx["line"]=1;
  1099. $8=_st($9)._value_value_($10,_st(token)._end());
  1100. $ctx1.sendIdx["value:value:"]=2;
  1101. $6=globals.HashedCollection._newFromPairs_(["list",$7,"from",$8,"to",_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start())]);
  1102. return $6;
  1103. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},globals.HLCodeWidget.klass)})},
  1104. args: ["anEditor", "options"],
  1105. source: "hintFor: anEditor options: options\x0a\x09| cursor token completions |\x0a\x09\x0a\x09cursor := anEditor getCursor.\x0a\x09token := anEditor getTokenAt: cursor.\x0a\x09token at: 'state' put: ((CodeMirror basicAt: 'innerMode')\x0a\x09\x09value: anEditor getMode value: (token at: 'state')) state.\x0a\x09\x0a\x09completions := token type = 'variable' \x0a\x09\x09ifTrue: [ HLCodeWidget variableHintFor: anEditor token: token ]\x0a\x09\x09ifFalse: [ HLCodeWidget messageHintFor: anEditor token: token ].\x0a\x09\x0a\x09^ #{\x0a\x09\x09'list' -> completions.\x0a\x09\x09'from' -> ((CodeMirror basicAt: 'Pos') value: cursor line value: token end).\x0a\x09\x09'to' -> ((CodeMirror basicAt: 'Pos') value: cursor line value: token start)\x0a\x09}",
  1106. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "basicAt:", "getMode", "at:", "ifTrue:ifFalse:", "=", "type", "variableHintFor:token:", "messageHintFor:token:", "line", "end", "start"],
  1107. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  1108. }),
  1109. globals.HLCodeWidget.klass);
  1110. smalltalk.addMethod(
  1111. smalltalk.method({
  1112. selector: "initialize",
  1113. protocol: 'initialization',
  1114. fn: function (){
  1115. var self=this;
  1116. return smalltalk.withContext(function($ctx1) {
  1117. var $1;
  1118. globals.HLCodeWidget.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1119. self._setupCodeMirror();
  1120. self._setupCommands();
  1121. $1=self._setupKeyMaps();
  1122. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLCodeWidget.klass)})},
  1123. args: [],
  1124. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  1125. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  1126. referencedClasses: []
  1127. }),
  1128. globals.HLCodeWidget.klass);
  1129. smalltalk.addMethod(
  1130. smalltalk.method({
  1131. selector: "keyMap",
  1132. protocol: 'accessing',
  1133. fn: function (){
  1134. var self=this;
  1135. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1136. return smalltalk.withContext(function($ctx1) {
  1137. var $2,$1;
  1138. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  1139. if(smalltalk.assert($2)){
  1140. $1=self._macKeyMap();
  1141. } else {
  1142. $1=self._pcKeyMap();
  1143. };
  1144. return $1;
  1145. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},globals.HLCodeWidget.klass)})},
  1146. args: [],
  1147. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  1148. messageSends: ["ifTrue:ifFalse:", "systemIsMac", "keyBinder", "current", "macKeyMap", "pcKeyMap"],
  1149. referencedClasses: ["HLManager"]
  1150. }),
  1151. globals.HLCodeWidget.klass);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "macKeyMap",
  1155. protocol: 'accessing',
  1156. fn: function (){
  1157. var self=this;
  1158. var $1;
  1159. $1=globals.HashedCollection._newFromPairs_(["Alt-Backspace","delWordBefore","Alt-Delete","delWordAfter","Alt-Left","goWordLeft","Alt-Right","goWordRight","Cmd-A","selectAll","Cmd-Alt-F","replace","Cmd-D","doIt","Cmd-B","browseIt","Cmd-Down","goDocEnd","Cmd-End","goDocEnd","Cmd-F","find","Cmd-G","findNext","Cmd-I","inspectIt","Cmd-Left","goLineStart","Cmd-P","printIt","Cmd-Right","goLineEnd","Cmd-S","saveIt","Cmd-Up","goDocStart","Cmd-Y","redo","Cmd-Z","undo","Cmd-[","indentLess","Cmd-]","indentMore","Ctrl-Alt-Backspace","delWordAfter","Shift-Cmd-Alt-F","replaceAll","Shift-Cmd-G","findPrev","Shift-Cmd-Z","redo","fallthrough",["basic","emacsy"]]);
  1160. return $1;
  1161. },
  1162. args: [],
  1163. source: "macKeyMap\x0a\x09^ #{\x0a\x09\x09'Alt-Backspace'\x09\x09\x09-> 'delWordBefore'.\x0a\x09\x09'Alt-Delete'\x09\x09\x09-> 'delWordAfter'. \x0a\x09\x09'Alt-Left'\x09\x09\x09\x09-> 'goWordLeft'.\x0a\x09\x09'Alt-Right'\x09\x09\x09\x09-> 'goWordRight'. \x0a\x09\x09'Cmd-A'\x09\x09\x09\x09\x09-> 'selectAll'. \x0a\x09\x09'Cmd-Alt-F'\x09\x09\x09\x09-> 'replace'. \x0a\x09\x09'Cmd-D'\x09\x09\x09\x09\x09-> 'doIt'. \x0a\x09\x09'Cmd-B'\x09\x09\x09\x09\x09-> 'browseIt'. \x0a\x09\x09'Cmd-Down'\x09\x09\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-End'\x09\x09\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-F'\x09\x09\x09\x09\x09-> 'find'.\x0a\x09\x09'Cmd-G'\x09\x09\x09\x09\x09-> 'findNext'. \x0a\x09\x09'Cmd-I'\x09\x09\x09\x09\x09-> 'inspectIt'. \x0a\x09\x09'Cmd-Left'\x09\x09\x09\x09-> 'goLineStart'. \x0a\x09\x09'Cmd-P'\x09\x09\x09\x09\x09-> 'printIt'. \x0a\x09\x09'Cmd-Right'\x09\x09\x09\x09-> 'goLineEnd'. \x0a\x09\x09'Cmd-S'\x09\x09\x09\x09\x09-> 'saveIt'. \x0a\x09\x09'Cmd-Up'\x09\x09\x09\x09-> 'goDocStart'. \x0a\x09\x09'Cmd-Y'\x09\x09\x09\x09\x09-> 'redo'.\x0a\x09\x09'Cmd-Z'\x09\x09\x09\x09\x09-> 'undo'. \x0a\x09\x09'Cmd-['\x09\x09\x09\x09\x09-> 'indentLess'. \x0a\x09\x09'Cmd-]'\x09\x09\x09\x09\x09-> 'indentMore'.\x0a\x09\x09'Ctrl-Alt-Backspace'\x09-> 'delWordAfter'. \x0a\x09\x09'Shift-Cmd-Alt-F'\x09\x09-> 'replaceAll'.\x0a\x09\x09'Shift-Cmd-G'\x09\x09\x09-> 'findPrev'. \x0a\x09\x09'Shift-Cmd-Z'\x09\x09\x09-> 'redo'. \x0a \x09'fallthrough' \x09\x09\x09-> { 'basic'. 'emacsy' }\x0a }",
  1164. messageSends: [],
  1165. referencedClasses: []
  1166. }),
  1167. globals.HLCodeWidget.klass);
  1168. smalltalk.addMethod(
  1169. smalltalk.method({
  1170. selector: "messageHintFor:token:",
  1171. protocol: 'hints',
  1172. fn: function (anEditor,aToken){
  1173. var self=this;
  1174. return smalltalk.withContext(function($ctx1) {
  1175. var $1;
  1176. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  1177. return $1;
  1178. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1179. args: ["anEditor", "aToken"],
  1180. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  1181. messageSends: ["messageHintFor:token:", "at:"],
  1182. referencedClasses: []
  1183. }),
  1184. globals.HLCodeWidget.klass);
  1185. smalltalk.addMethod(
  1186. smalltalk.method({
  1187. selector: "pcKeyMap",
  1188. protocol: 'accessing',
  1189. fn: function (){
  1190. var self=this;
  1191. var $1;
  1192. $1=globals.HashedCollection._newFromPairs_(["Alt-Left","goLineStart","Alt-Right","goLineEnd","Alt-Up","goDocStart","Ctrl-A","selectAll","Ctrl-Backspace","delWordBefore","Ctrl-D","doIt","Ctrl-B","browseIt","Ctrl-Delete","delWordAfter","Ctrl-Down","goDocEnd","Ctrl-End","goDocEnd","Ctrl-F","find","Ctrl-G","findNext","Ctrl-I","inspectIt","Ctrl-Home","goDocStart","Ctrl-Left","goWordLeft","Ctrl-P","printIt","Ctrl-Right","goWordRight","Ctrl-S","saveIt","Ctrl-Y","redo","Ctrl-Z","undo","Ctrl-[","indentLess","Ctrl-]","indentMore","Shift-Ctrl-F","replace","Shift-Ctrl-G","findPrev","Shift-Ctrl-R","replaceAll","Shift-Ctrl-Z","redo","fallthrough",["basic"]]);
  1193. return $1;
  1194. },
  1195. args: [],
  1196. source: "pcKeyMap\x0a\x09^ #{\x0a\x09\x09'Alt-Left' -> \x09\x09'goLineStart'. \x0a\x09\x09'Alt-Right' -> \x09\x09'goLineEnd'.\x0a\x09\x09'Alt-Up' -> \x09\x09'goDocStart'. \x0a\x09\x09'Ctrl-A' -> \x09\x09'selectAll'. \x0a\x09\x09'Ctrl-Backspace' -> 'delWordBefore'. \x0a\x09\x09'Ctrl-D' -> \x09\x09'doIt'. \x0a\x09\x09'Ctrl-B' -> \x09\x09'browseIt'. \x0a\x09\x09'Ctrl-Delete' -> \x09\x09'delWordAfter'. \x0a\x09\x09'Ctrl-Down' -> \x09\x09'goDocEnd'.\x0a\x09\x09'Ctrl-End' -> \x09\x09'goDocEnd'. \x0a\x09\x09'Ctrl-F' -> \x09\x09'find'.\x0a\x09\x09'Ctrl-G' -> \x09\x09'findNext'. \x0a\x09\x09'Ctrl-I' -> \x09\x09'inspectIt'.\x0a\x09\x09'Ctrl-Home' -> \x09\x09'goDocStart'. \x0a\x09\x09'Ctrl-Left' -> \x09\x09'goWordLeft'. \x0a\x09\x09'Ctrl-P' -> \x09\x09'printIt'.\x0a\x09\x09'Ctrl-Right' -> \x09'goWordRight'. \x0a\x09\x09'Ctrl-S' -> \x09\x09'saveIt'. \x0a\x09\x09'Ctrl-Y' -> \x09\x09'redo'.\x0a\x09\x09'Ctrl-Z' -> \x09\x09'undo'. \x0a\x09\x09'Ctrl-[' -> \x09\x09'indentLess'. \x0a\x09\x09'Ctrl-]' -> \x09\x09'indentMore'.\x0a\x09\x09'Shift-Ctrl-F' -> \x09'replace'. \x0a\x09\x09'Shift-Ctrl-G' -> \x09'findPrev'. \x0a\x09\x09'Shift-Ctrl-R' -> \x09'replaceAll'.\x0a\x09\x09'Shift-Ctrl-Z' -> \x09'redo'. \x0a\x09\x09'fallthrough' -> \x09#('basic')\x0a}",
  1197. messageSends: [],
  1198. referencedClasses: []
  1199. }),
  1200. globals.HLCodeWidget.klass);
  1201. smalltalk.addMethod(
  1202. smalltalk.method({
  1203. selector: "setupCodeMirror",
  1204. protocol: 'initialization',
  1205. fn: function (){
  1206. var self=this;
  1207. return smalltalk.withContext(function($ctx1) {
  1208. CodeMirror.keyMap.default.fallthrough = ["basic"];
  1209. CodeMirror.commands.autocomplete = function(cm) {
  1210. CodeMirror.showHint(cm, self._hintFor_options_);
  1211. }
  1212. ;
  1213. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},globals.HLCodeWidget.klass)})},
  1214. args: [],
  1215. source: "setupCodeMirror\x0a\x09< \x0a\x09\x09CodeMirror.keyMap.default.fallthrough = [\x22basic\x22];\x0a\x09\x09CodeMirror.commands.autocomplete = function(cm) {\x0a\x09\x09\x09CodeMirror.showHint(cm, self._hintFor_options_);\x0a\x09\x09}\x0a\x09>",
  1216. messageSends: [],
  1217. referencedClasses: []
  1218. }),
  1219. globals.HLCodeWidget.klass);
  1220. smalltalk.addMethod(
  1221. smalltalk.method({
  1222. selector: "setupCommands",
  1223. protocol: 'initialization',
  1224. fn: function (){
  1225. var self=this;
  1226. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1227. return smalltalk.withContext(function($ctx1) {
  1228. var $1,$2,$3,$4,$5,$6;
  1229. $1=_st($CodeMirror())._basicAt_("commands");
  1230. _st($1)._at_put_("doIt",(function(cm){
  1231. return smalltalk.withContext(function($ctx2) {
  1232. $2=_st(cm)._amberCodeWidget();
  1233. $ctx2.sendIdx["amberCodeWidget"]=1;
  1234. return _st($2)._doIt();
  1235. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,1)})}));
  1236. $ctx1.sendIdx["at:put:"]=1;
  1237. _st($1)._at_put_("inspectIt",(function(cm){
  1238. return smalltalk.withContext(function($ctx2) {
  1239. $3=_st(cm)._amberCodeWidget();
  1240. $ctx2.sendIdx["amberCodeWidget"]=2;
  1241. return _st($3)._inspectIt();
  1242. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,2)})}));
  1243. $ctx1.sendIdx["at:put:"]=2;
  1244. _st($1)._at_put_("printIt",(function(cm){
  1245. return smalltalk.withContext(function($ctx2) {
  1246. $4=_st(cm)._amberCodeWidget();
  1247. $ctx2.sendIdx["amberCodeWidget"]=3;
  1248. return _st($4)._printIt();
  1249. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,3)})}));
  1250. $ctx1.sendIdx["at:put:"]=3;
  1251. _st($1)._at_put_("saveIt",(function(cm){
  1252. return smalltalk.withContext(function($ctx2) {
  1253. $5=_st(cm)._amberCodeWidget();
  1254. $ctx2.sendIdx["amberCodeWidget"]=4;
  1255. return _st($5)._saveIt();
  1256. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,4)})}));
  1257. $ctx1.sendIdx["at:put:"]=4;
  1258. $6=_st($1)._at_put_("browseIt",(function(cm){
  1259. return smalltalk.withContext(function($ctx2) {
  1260. return _st(_st(cm)._amberCodeWidget())._browseIt();
  1261. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,5)})}));
  1262. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},globals.HLCodeWidget.klass)})},
  1263. args: [],
  1264. source: "setupCommands\x0a\x09(CodeMirror basicAt: 'commands') \x0a\x09\x09at: 'doIt' put: [ :cm | cm amberCodeWidget doIt ];\x0a\x09\x09at: 'inspectIt' put: [ :cm | cm amberCodeWidget inspectIt ];\x0a\x09\x09at: 'printIt' put: [ :cm | cm amberCodeWidget printIt ];\x0a\x09\x09at: 'saveIt' put: [ :cm | cm amberCodeWidget saveIt ];\x0a\x09\x09at: 'browseIt' put: [ :cm | cm amberCodeWidget browseIt ]",
  1265. messageSends: ["at:put:", "basicAt:", "doIt", "amberCodeWidget", "inspectIt", "printIt", "saveIt", "browseIt"],
  1266. referencedClasses: ["CodeMirror"]
  1267. }),
  1268. globals.HLCodeWidget.klass);
  1269. smalltalk.addMethod(
  1270. smalltalk.method({
  1271. selector: "setupKeyMaps",
  1272. protocol: 'initialization',
  1273. fn: function (){
  1274. var self=this;
  1275. return smalltalk.withContext(function($ctx1) {
  1276. CodeMirror.keyMap['Amber'] = self._keyMap();
  1277. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},globals.HLCodeWidget.klass)})},
  1278. args: [],
  1279. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  1280. messageSends: [],
  1281. referencedClasses: []
  1282. }),
  1283. globals.HLCodeWidget.klass);
  1284. smalltalk.addMethod(
  1285. smalltalk.method({
  1286. selector: "variableHintFor:token:",
  1287. protocol: 'hints',
  1288. fn: function (anEditor,aToken){
  1289. var self=this;
  1290. return smalltalk.withContext(function($ctx1) {
  1291. var $1;
  1292. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1293. return $1;
  1294. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1295. args: ["anEditor", "aToken"],
  1296. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1297. messageSends: ["variableHintFor:token:", "at:"],
  1298. referencedClasses: []
  1299. }),
  1300. globals.HLCodeWidget.klass);
  1301. smalltalk.addClass('HLNavigationCodeWidget', globals.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1302. smalltalk.addMethod(
  1303. smalltalk.method({
  1304. selector: "configureEditor",
  1305. protocol: 'accessing',
  1306. fn: function (){
  1307. var self=this;
  1308. return smalltalk.withContext(function($ctx1) {
  1309. globals.HLNavigationCodeWidget.superclass.fn.prototype._configureEditor.apply(_st(self), []);
  1310. self._contents_(self._methodContents());
  1311. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLNavigationCodeWidget)})},
  1312. args: [],
  1313. source: "configureEditor\x0a\x09super configureEditor.\x0a\x09self contents: self methodContents",
  1314. messageSends: ["configureEditor", "contents:", "methodContents"],
  1315. referencedClasses: []
  1316. }),
  1317. globals.HLNavigationCodeWidget);
  1318. smalltalk.addMethod(
  1319. smalltalk.method({
  1320. selector: "contents:",
  1321. protocol: 'accessing',
  1322. fn: function (aString){
  1323. var self=this;
  1324. return smalltalk.withContext(function($ctx1) {
  1325. self._methodContents_(aString);
  1326. globals.HLNavigationCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]);
  1327. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLNavigationCodeWidget)})},
  1328. args: ["aString"],
  1329. source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
  1330. messageSends: ["methodContents:", "contents:"],
  1331. referencedClasses: []
  1332. }),
  1333. globals.HLNavigationCodeWidget);
  1334. smalltalk.addMethod(
  1335. smalltalk.method({
  1336. selector: "hasModification",
  1337. protocol: 'testing',
  1338. fn: function (){
  1339. var self=this;
  1340. return smalltalk.withContext(function($ctx1) {
  1341. var $1;
  1342. $1=_st(_st(self._methodContents()).__eq(self._contents()))._not();
  1343. return $1;
  1344. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},globals.HLNavigationCodeWidget)})},
  1345. args: [],
  1346. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1347. messageSends: ["not", "=", "methodContents", "contents"],
  1348. referencedClasses: []
  1349. }),
  1350. globals.HLNavigationCodeWidget);
  1351. smalltalk.addMethod(
  1352. smalltalk.method({
  1353. selector: "methodContents",
  1354. protocol: 'accessing',
  1355. fn: function (){
  1356. var self=this;
  1357. return smalltalk.withContext(function($ctx1) {
  1358. var $2,$1;
  1359. $2=self["@methodContents"];
  1360. if(($receiver = $2) == nil || $receiver == null){
  1361. $1="";
  1362. } else {
  1363. $1=$2;
  1364. };
  1365. return $1;
  1366. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},globals.HLNavigationCodeWidget)})},
  1367. args: [],
  1368. source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
  1369. messageSends: ["ifNil:"],
  1370. referencedClasses: []
  1371. }),
  1372. globals.HLNavigationCodeWidget);
  1373. smalltalk.addMethod(
  1374. smalltalk.method({
  1375. selector: "methodContents:",
  1376. protocol: 'accessing',
  1377. fn: function (aString){
  1378. var self=this;
  1379. var $1;
  1380. self["@methodContents"]=aString;
  1381. $1=self["@methodContents"];
  1382. return $1;
  1383. },
  1384. args: ["aString"],
  1385. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1386. messageSends: [],
  1387. referencedClasses: []
  1388. }),
  1389. globals.HLNavigationCodeWidget);
  1390. smalltalk.addMethod(
  1391. smalltalk.method({
  1392. selector: "previous",
  1393. protocol: 'accessing',
  1394. fn: function (){
  1395. var self=this;
  1396. return self},
  1397. args: [],
  1398. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1399. messageSends: [],
  1400. referencedClasses: []
  1401. }),
  1402. globals.HLNavigationCodeWidget);
  1403. smalltalk.addMethod(
  1404. smalltalk.method({
  1405. selector: "previous:",
  1406. protocol: 'accessing',
  1407. fn: function (aWidget){
  1408. var self=this;
  1409. return self},
  1410. args: ["aWidget"],
  1411. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1412. messageSends: [],
  1413. referencedClasses: []
  1414. }),
  1415. globals.HLNavigationCodeWidget);
  1416. smalltalk.addMethod(
  1417. smalltalk.method({
  1418. selector: "canBeOpenAsTab",
  1419. protocol: 'testing',
  1420. fn: function (){
  1421. var self=this;
  1422. return false;
  1423. },
  1424. args: [],
  1425. source: "canBeOpenAsTab\x0a\x09^ false",
  1426. messageSends: [],
  1427. referencedClasses: []
  1428. }),
  1429. globals.HLNavigationCodeWidget.klass);
  1430. smalltalk.addMethod(
  1431. smalltalk.method({
  1432. selector: "on:",
  1433. protocol: 'instance creation',
  1434. fn: function (aBrowserModel){
  1435. var self=this;
  1436. return smalltalk.withContext(function($ctx1) {
  1437. var $2,$3,$1;
  1438. $2=self._new();
  1439. _st($2)._browserModel_(aBrowserModel);
  1440. $3=_st($2)._yourself();
  1441. $1=$3;
  1442. return $1;
  1443. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLNavigationCodeWidget.klass)})},
  1444. args: ["aBrowserModel"],
  1445. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1446. messageSends: ["browserModel:", "new", "yourself"],
  1447. referencedClasses: []
  1448. }),
  1449. globals.HLNavigationCodeWidget.klass);
  1450. smalltalk.addClass('HLBrowserCodeWidget', globals.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1451. smalltalk.addMethod(
  1452. smalltalk.method({
  1453. selector: "browserModel",
  1454. protocol: 'accessing',
  1455. fn: function (){
  1456. var self=this;
  1457. var $1;
  1458. $1=self["@browserModel"];
  1459. return $1;
  1460. },
  1461. args: [],
  1462. source: "browserModel\x0a\x09^ browserModel",
  1463. messageSends: [],
  1464. referencedClasses: []
  1465. }),
  1466. globals.HLBrowserCodeWidget);
  1467. smalltalk.addMethod(
  1468. smalltalk.method({
  1469. selector: "browserModel:",
  1470. protocol: 'accessing',
  1471. fn: function (aBrowserModel){
  1472. var self=this;
  1473. return smalltalk.withContext(function($ctx1) {
  1474. var $1;
  1475. self["@browserModel"]=aBrowserModel;
  1476. self._observeSystem();
  1477. $1=self._observeBrowserModel();
  1478. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget)})},
  1479. args: ["aBrowserModel"],
  1480. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1481. messageSends: ["observeSystem", "observeBrowserModel"],
  1482. referencedClasses: []
  1483. }),
  1484. globals.HLBrowserCodeWidget);
  1485. smalltalk.addMethod(
  1486. smalltalk.method({
  1487. selector: "observeBrowserModel",
  1488. protocol: 'actions',
  1489. fn: function (){
  1490. var self=this;
  1491. function $HLSaveSourceCode(){return globals.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1492. function $HLShowInstanceToggled(){return globals.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  1493. function $HLSourceCodeSaved(){return globals.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  1494. function $HLAboutToChange(){return globals.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  1495. function $HLParseErrorRaised(){return globals.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1496. function $HLCompileErrorRaised(){return globals.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1497. function $HLUnknownVariableErrorRaised(){return globals.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1498. function $HLInstVarAdded(){return globals.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1499. function $HLMethodSelected(){return globals.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1500. function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1501. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  1502. function $HLProtocolSelected(){return globals.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1503. function $HLSourceCodeFocusRequested(){return globals.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1504. function $HLShowTemplate(){return globals.HLShowTemplate||(typeof HLShowTemplate=="undefined"?nil:HLShowTemplate)}
  1505. return smalltalk.withContext(function($ctx1) {
  1506. var $1,$2;
  1507. $1=_st(self._browserModel())._announcer();
  1508. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  1509. $ctx1.sendIdx["on:send:to:"]=1;
  1510. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  1511. $ctx1.sendIdx["on:send:to:"]=2;
  1512. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  1513. $ctx1.sendIdx["on:send:to:"]=3;
  1514. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  1515. $ctx1.sendIdx["on:send:to:"]=4;
  1516. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  1517. $ctx1.sendIdx["on:send:to:"]=5;
  1518. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  1519. $ctx1.sendIdx["on:send:to:"]=6;
  1520. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  1521. $ctx1.sendIdx["on:send:to:"]=7;
  1522. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  1523. $ctx1.sendIdx["on:send:to:"]=8;
  1524. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  1525. $ctx1.sendIdx["on:send:to:"]=9;
  1526. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  1527. $ctx1.sendIdx["on:send:to:"]=10;
  1528. _st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
  1529. $ctx1.sendIdx["on:send:to:"]=11;
  1530. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  1531. $ctx1.sendIdx["on:send:to:"]=12;
  1532. _st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  1533. $ctx1.sendIdx["on:send:to:"]=13;
  1534. $2=_st($1)._on_send_to_($HLShowTemplate(),"onShowTemplate:",self);
  1535. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLBrowserCodeWidget)})},
  1536. args: [],
  1537. source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09send: #onSaveIt\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09send: #onShowInstanceToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09send: #onSourceCodeSaved\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09send: #onBrowserAboutToChange:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09send: #onParseError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09send: #onCompileError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09send: #onUnknownVariableError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09send: #onInstVarAdded\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a \x09on: HLClassSelected \x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLPackageSelected \x0a\x09\x09send: #onPackageSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a \x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09send: #onSourceCodeFocusRequested\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowTemplate\x0a\x09\x09send: #onShowTemplate:\x0a\x09\x09to: self",
  1538. messageSends: ["on:send:to:", "announcer", "browserModel"],
  1539. referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLPackageSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested", "HLShowTemplate"]
  1540. }),
  1541. globals.HLBrowserCodeWidget);
  1542. smalltalk.addMethod(
  1543. smalltalk.method({
  1544. selector: "observeSystem",
  1545. protocol: 'actions',
  1546. fn: function (){
  1547. var self=this;
  1548. function $MethodModified(){return globals.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1549. return smalltalk.withContext(function($ctx1) {
  1550. _st(_st(self._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  1551. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},globals.HLBrowserCodeWidget)})},
  1552. args: [],
  1553. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
  1554. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
  1555. referencedClasses: ["MethodModified"]
  1556. }),
  1557. globals.HLBrowserCodeWidget);
  1558. smalltalk.addMethod(
  1559. smalltalk.method({
  1560. selector: "onBrowserAboutToChange:",
  1561. protocol: 'reactions',
  1562. fn: function (anAnnouncement){
  1563. var self=this;
  1564. var block;
  1565. function $HLChangeForbidden(){return globals.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1566. return smalltalk.withContext(function($ctx1) {
  1567. var $1;
  1568. block=_st(anAnnouncement)._actionBlock();
  1569. $1=self._hasModification();
  1570. if(smalltalk.assert($1)){
  1571. self._confirm_ifTrue_("Changes have not been saved. Do you want to discard these changes?",(function(){
  1572. return smalltalk.withContext(function($ctx2) {
  1573. self._methodContents_(self._contents());
  1574. return _st(block)._value();
  1575. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1576. _st($HLChangeForbidden())._signal();
  1577. };
  1578. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},globals.HLBrowserCodeWidget)})},
  1579. args: ["anAnnouncement"],
  1580. source: "onBrowserAboutToChange: anAnnouncement\x0a\x09| block |\x0a\x09\x0a\x09block := anAnnouncement actionBlock.\x0a\x09\x0a\x09self hasModification\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self \x0a\x09\x09\x09\x09confirm: 'Changes have not been saved. Do you want to discard these changes?' \x0a\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x22Don't ask twice\x22\x0a\x09\x09\x09\x09\x09self methodContents: self contents.\x0a\x09\x09\x09\x09\x09block value ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x0a\x09\x09\x09HLChangeForbidden signal ]",
  1581. messageSends: ["actionBlock", "ifTrue:", "hasModification", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal"],
  1582. referencedClasses: ["HLChangeForbidden"]
  1583. }),
  1584. globals.HLBrowserCodeWidget);
  1585. smalltalk.addMethod(
  1586. smalltalk.method({
  1587. selector: "onClassSelected:",
  1588. protocol: 'reactions',
  1589. fn: function (anAnnouncement){
  1590. var self=this;
  1591. var class_;
  1592. return smalltalk.withContext(function($ctx1) {
  1593. var $1,$2;
  1594. class_=_st(anAnnouncement)._item();
  1595. $1=class_;
  1596. if(($receiver = $1) == nil || $receiver == null){
  1597. $2=self._contents_("");
  1598. $ctx1.sendIdx["contents:"]=1;
  1599. return $2;
  1600. } else {
  1601. $1;
  1602. };
  1603. self._contents_(_st(class_)._definition());
  1604. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},globals.HLBrowserCodeWidget)})},
  1605. args: ["anAnnouncement"],
  1606. source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a\x09self contents: class definition",
  1607. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1608. referencedClasses: []
  1609. }),
  1610. globals.HLBrowserCodeWidget);
  1611. smalltalk.addMethod(
  1612. smalltalk.method({
  1613. selector: "onCompileError:",
  1614. protocol: 'reactions',
  1615. fn: function (anAnnouncement){
  1616. var self=this;
  1617. return smalltalk.withContext(function($ctx1) {
  1618. self._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1619. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1620. args: ["anAnnouncement"],
  1621. source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
  1622. messageSends: ["alert:", "messageText", "error"],
  1623. referencedClasses: []
  1624. }),
  1625. globals.HLBrowserCodeWidget);
  1626. smalltalk.addMethod(
  1627. smalltalk.method({
  1628. selector: "onInstVarAdded",
  1629. protocol: 'reactions',
  1630. fn: function (){
  1631. var self=this;
  1632. return smalltalk.withContext(function($ctx1) {
  1633. _st(self._browserModel())._save_(self._contents());
  1634. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},globals.HLBrowserCodeWidget)})},
  1635. args: [],
  1636. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1637. messageSends: ["save:", "browserModel", "contents"],
  1638. referencedClasses: []
  1639. }),
  1640. globals.HLBrowserCodeWidget);
  1641. smalltalk.addMethod(
  1642. smalltalk.method({
  1643. selector: "onMethodModified:",
  1644. protocol: 'reactions',
  1645. fn: function (anAnnouncement){
  1646. var self=this;
  1647. var method;
  1648. return smalltalk.withContext(function($ctx1) {
  1649. var $3,$2,$1,$5,$4,$7,$6;
  1650. method=_st(anAnnouncement)._method();
  1651. $3=self._browserModel();
  1652. $ctx1.sendIdx["browserModel"]=1;
  1653. $2=_st($3)._selectedClass();
  1654. $1=_st($2).__eq(_st(method)._methodClass());
  1655. $ctx1.sendIdx["="]=1;
  1656. if(! smalltalk.assert($1)){
  1657. return self;
  1658. };
  1659. $5=self._browserModel();
  1660. $ctx1.sendIdx["browserModel"]=2;
  1661. $4=_st($5)._selectedMethod();
  1662. $ctx1.sendIdx["selectedMethod"]=1;
  1663. if(($receiver = $4) == nil || $receiver == null){
  1664. return self;
  1665. } else {
  1666. $4;
  1667. };
  1668. $7=_st(_st(self._browserModel())._selectedMethod())._selector();
  1669. $ctx1.sendIdx["selector"]=1;
  1670. $6=_st($7).__eq(_st(method)._selector());
  1671. if(! smalltalk.assert($6)){
  1672. return self;
  1673. };
  1674. self._refresh();
  1675. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1676. args: ["anAnnouncement"],
  1677. source: "onMethodModified: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement method.\x0a\x09\x0a\x09self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a\x09self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
  1678. messageSends: ["method", "ifFalse:", "=", "selectedClass", "browserModel", "methodClass", "ifNil:", "selectedMethod", "selector", "refresh"],
  1679. referencedClasses: []
  1680. }),
  1681. globals.HLBrowserCodeWidget);
  1682. smalltalk.addMethod(
  1683. smalltalk.method({
  1684. selector: "onMethodSelected:",
  1685. protocol: 'reactions',
  1686. fn: function (anAnnouncement){
  1687. var self=this;
  1688. var method;
  1689. return smalltalk.withContext(function($ctx1) {
  1690. var $1,$2;
  1691. method=_st(anAnnouncement)._item();
  1692. $1=method;
  1693. if(($receiver = $1) == nil || $receiver == null){
  1694. $2=self._contents_("");
  1695. $ctx1.sendIdx["contents:"]=1;
  1696. return $2;
  1697. } else {
  1698. $1;
  1699. };
  1700. self._contents_(_st(method)._source());
  1701. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1702. args: ["anAnnouncement"],
  1703. source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a\x09self contents: method source",
  1704. messageSends: ["item", "ifNil:", "contents:", "source"],
  1705. referencedClasses: []
  1706. }),
  1707. globals.HLBrowserCodeWidget);
  1708. smalltalk.addMethod(
  1709. smalltalk.method({
  1710. selector: "onPackageSelected:",
  1711. protocol: 'reactions',
  1712. fn: function (anAnnouncement){
  1713. var self=this;
  1714. var package_;
  1715. return smalltalk.withContext(function($ctx1) {
  1716. var $1,$2;
  1717. package_=_st(anAnnouncement)._item();
  1718. $1=package_;
  1719. if(($receiver = $1) == nil || $receiver == null){
  1720. $2=self._contents_("");
  1721. $ctx1.sendIdx["contents:"]=1;
  1722. return $2;
  1723. } else {
  1724. $1;
  1725. };
  1726. self._contents_(_st(package_)._definition());
  1727. return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,package_:package_},globals.HLBrowserCodeWidget)})},
  1728. args: ["anAnnouncement"],
  1729. source: "onPackageSelected: anAnnouncement\x0a\x09| package |\x0a\x09\x0a\x09package := anAnnouncement item.\x0a\x09\x0a\x09package ifNil: [ ^ self contents: '' ].\x0a\x09self contents: package definition",
  1730. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1731. referencedClasses: []
  1732. }),
  1733. globals.HLBrowserCodeWidget);
  1734. smalltalk.addMethod(
  1735. smalltalk.method({
  1736. selector: "onParseError:",
  1737. protocol: 'reactions',
  1738. fn: function (anAnnouncement){
  1739. var self=this;
  1740. var lineIndex,newContents;
  1741. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1742. return smalltalk.withContext(function($ctx1) {
  1743. var $1,$3,$2,$6,$5,$4;
  1744. lineIndex=(1);
  1745. self._contents_(_st($String())._streamContents_((function(stream){
  1746. return smalltalk.withContext(function($ctx2) {
  1747. return _st(self._contents())._linesDo_((function(each){
  1748. return smalltalk.withContext(function($ctx3) {
  1749. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1750. if(smalltalk.assert($1)){
  1751. $3=_st(anAnnouncement)._column();
  1752. $ctx3.sendIdx["column"]=1;
  1753. $2=_st(each)._copyFrom_to_((1),$3);
  1754. $ctx3.sendIdx["copyFrom:to:"]=1;
  1755. _st(stream)._nextPutAll_($2);
  1756. $ctx3.sendIdx["nextPutAll:"]=1;
  1757. _st(stream)._nextPutAll_("<- ");
  1758. $ctx3.sendIdx["nextPutAll:"]=2;
  1759. _st(stream)._nextPutAll_(_st(anAnnouncement)._message());
  1760. $ctx3.sendIdx["nextPutAll:"]=3;
  1761. _st(stream)._nextPutAll_(" ");
  1762. $ctx3.sendIdx["nextPutAll:"]=4;
  1763. $6=_st(_st(anAnnouncement)._column()).__plus((1));
  1764. $ctx3.sendIdx["+"]=1;
  1765. $5=_st(each)._copyFrom_to_($6,_st(each)._size());
  1766. $4=_st(stream)._nextPutAll_($5);
  1767. $ctx3.sendIdx["nextPutAll:"]=5;
  1768. $4;
  1769. } else {
  1770. _st(stream)._nextPutAll_(each);
  1771. $ctx3.sendIdx["nextPutAll:"]=6;
  1772. };
  1773. _st(stream)._nextPutAll_(_st($String())._cr());
  1774. lineIndex=_st(lineIndex).__plus((1));
  1775. return lineIndex;
  1776. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  1777. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})));
  1778. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},globals.HLBrowserCodeWidget)})},
  1779. args: ["anAnnouncement"],
  1780. source: "onParseError: anAnnouncement\x0a\x09| lineIndex newContents |\x0a\x09\x0a\x09lineIndex := 1.\x0a\x09\x0a\x09self contents: (String streamContents: [ :stream |\x0a\x09\x09self contents linesDo: [ :each |\x0a\x09\x09\x09lineIndex = anAnnouncement line \x0a\x09\x09\x09\x09ifTrue: [ \x0a\x09\x09\x09\x09\x09stream \x0a\x09\x09\x09\x09\x09\x09nextPutAll: (each copyFrom: 1 to: anAnnouncement column);\x0a\x09\x09\x09\x09\x09\x09nextPutAll: '<- ';\x0a\x09\x09\x09\x09\x09\x09nextPutAll: anAnnouncement message;\x0a\x09\x09\x09\x09\x09\x09nextPutAll: ' ';\x0a\x09\x09\x09\x09\x09\x09nextPutAll: (each copyFrom: anAnnouncement column + 1 to: each size) ]\x0a\x09\x09\x09\x09ifFalse: [ stream nextPutAll: each ].\x0a\x09\x09\x09stream nextPutAll: String cr.\x0a\x09\x09\x09lineIndex := lineIndex + 1 ] ])",
  1781. messageSends: ["contents:", "streamContents:", "linesDo:", "contents", "ifTrue:ifFalse:", "=", "line", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "cr"],
  1782. referencedClasses: ["String"]
  1783. }),
  1784. globals.HLBrowserCodeWidget);
  1785. smalltalk.addMethod(
  1786. smalltalk.method({
  1787. selector: "onProtocolSelected:",
  1788. protocol: 'reactions',
  1789. fn: function (anAnnouncement){
  1790. var self=this;
  1791. return smalltalk.withContext(function($ctx1) {
  1792. var $2,$1,$3;
  1793. $2=self._browserModel();
  1794. $ctx1.sendIdx["browserModel"]=1;
  1795. $1=_st($2)._selectedClass();
  1796. $ctx1.sendIdx["selectedClass"]=1;
  1797. if(($receiver = $1) == nil || $receiver == null){
  1798. $3=self._contents_("");
  1799. $ctx1.sendIdx["contents:"]=1;
  1800. return $3;
  1801. } else {
  1802. $1;
  1803. };
  1804. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1805. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1806. args: ["anAnnouncement"],
  1807. source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a\x09self contents: self browserModel selectedClass definition",
  1808. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1809. referencedClasses: []
  1810. }),
  1811. globals.HLBrowserCodeWidget);
  1812. smalltalk.addMethod(
  1813. smalltalk.method({
  1814. selector: "onSaveIt",
  1815. protocol: 'reactions',
  1816. fn: function (){
  1817. var self=this;
  1818. return smalltalk.withContext(function($ctx1) {
  1819. _st(self._browserModel())._save_(self._contents());
  1820. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},globals.HLBrowserCodeWidget)})},
  1821. args: [],
  1822. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1823. messageSends: ["save:", "browserModel", "contents"],
  1824. referencedClasses: []
  1825. }),
  1826. globals.HLBrowserCodeWidget);
  1827. smalltalk.addMethod(
  1828. smalltalk.method({
  1829. selector: "onShowInstanceToggled",
  1830. protocol: 'reactions',
  1831. fn: function (){
  1832. var self=this;
  1833. return smalltalk.withContext(function($ctx1) {
  1834. var $2,$1,$3;
  1835. $2=self._browserModel();
  1836. $ctx1.sendIdx["browserModel"]=1;
  1837. $1=_st($2)._selectedClass();
  1838. $ctx1.sendIdx["selectedClass"]=1;
  1839. if(($receiver = $1) == nil || $receiver == null){
  1840. $3=self._contents_("");
  1841. $ctx1.sendIdx["contents:"]=1;
  1842. return $3;
  1843. } else {
  1844. $1;
  1845. };
  1846. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1847. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},globals.HLBrowserCodeWidget)})},
  1848. args: [],
  1849. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a\x09self contents: self browserModel selectedClass definition",
  1850. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1851. referencedClasses: []
  1852. }),
  1853. globals.HLBrowserCodeWidget);
  1854. smalltalk.addMethod(
  1855. smalltalk.method({
  1856. selector: "onShowTemplate:",
  1857. protocol: 'reactions',
  1858. fn: function (anAnnouncement){
  1859. var self=this;
  1860. return smalltalk.withContext(function($ctx1) {
  1861. self._contents_(_st(anAnnouncement)._template());
  1862. return self}, function($ctx1) {$ctx1.fill(self,"onShowTemplate:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1863. args: ["anAnnouncement"],
  1864. source: "onShowTemplate: anAnnouncement\x0a\x09self contents: anAnnouncement template",
  1865. messageSends: ["contents:", "template"],
  1866. referencedClasses: []
  1867. }),
  1868. globals.HLBrowserCodeWidget);
  1869. smalltalk.addMethod(
  1870. smalltalk.method({
  1871. selector: "onSourceCodeFocusRequested",
  1872. protocol: 'reactions',
  1873. fn: function (){
  1874. var self=this;
  1875. return smalltalk.withContext(function($ctx1) {
  1876. self._focus();
  1877. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},globals.HLBrowserCodeWidget)})},
  1878. args: [],
  1879. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1880. messageSends: ["focus"],
  1881. referencedClasses: []
  1882. }),
  1883. globals.HLBrowserCodeWidget);
  1884. smalltalk.addMethod(
  1885. smalltalk.method({
  1886. selector: "onSourceCodeSaved",
  1887. protocol: 'reactions',
  1888. fn: function (){
  1889. var self=this;
  1890. return smalltalk.withContext(function($ctx1) {
  1891. self._methodContents_(self._contents());
  1892. self._updateState();
  1893. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},globals.HLBrowserCodeWidget)})},
  1894. args: [],
  1895. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1896. messageSends: ["methodContents:", "contents", "updateState"],
  1897. referencedClasses: []
  1898. }),
  1899. globals.HLBrowserCodeWidget);
  1900. smalltalk.addMethod(
  1901. smalltalk.method({
  1902. selector: "onUnknownVariableError:",
  1903. protocol: 'reactions',
  1904. fn: function (anAnnouncement){
  1905. var self=this;
  1906. var error;
  1907. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1908. return smalltalk.withContext(function($ctx1) {
  1909. var $1;
  1910. error=_st(anAnnouncement)._error();
  1911. self._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1912. return smalltalk.withContext(function($ctx2) {
  1913. _st(stream)._nextPutAll_(_st(error)._messageText());
  1914. $ctx2.sendIdx["nextPutAll:"]=1;
  1915. _st(stream)._nextPutAll_(_st($String())._cr());
  1916. $ctx2.sendIdx["nextPutAll:"]=2;
  1917. $1=_st(stream)._nextPutAll_("Would you like to define an instance variable?");
  1918. return $1;
  1919. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})),(function(){
  1920. return smalltalk.withContext(function($ctx2) {
  1921. return _st(self._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1922. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1923. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},globals.HLBrowserCodeWidget)})},
  1924. args: ["anAnnouncement"],
  1925. source: "onUnknownVariableError: anAnnouncement\x0a\x09| error |\x0a\x09\x0a\x09error := anAnnouncement error.\x0a\x09\x0a\x09self \x0a\x09\x09confirm: (String streamContents: [ :stream |\x0a\x09\x09\x09stream \x0a\x09\x09\x09\x09nextPutAll: error messageText;\x0a\x09\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ])\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self browserModel addInstVarNamed: error variableName ]",
  1926. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "browserModel", "variableName"],
  1927. referencedClasses: ["String"]
  1928. }),
  1929. globals.HLBrowserCodeWidget);
  1930. smalltalk.addMethod(
  1931. smalltalk.method({
  1932. selector: "refresh",
  1933. protocol: 'actions',
  1934. fn: function (){
  1935. var self=this;
  1936. return smalltalk.withContext(function($ctx1) {
  1937. var $1,$2;
  1938. $1=self._hasModification();
  1939. if(smalltalk.assert($1)){
  1940. return self;
  1941. };
  1942. $2=self._hasFocus();
  1943. if(smalltalk.assert($2)){
  1944. return self;
  1945. };
  1946. self._contents_(_st(_st(self._browserModel())._selectedMethod())._source());
  1947. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},globals.HLBrowserCodeWidget)})},
  1948. args: [],
  1949. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1950. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1951. referencedClasses: []
  1952. }),
  1953. globals.HLBrowserCodeWidget);
  1954. smalltalk.addMethod(
  1955. smalltalk.method({
  1956. selector: "renderButtonsOn:",
  1957. protocol: 'actions',
  1958. fn: function (html){
  1959. var self=this;
  1960. return smalltalk.withContext(function($ctx1) {
  1961. var $1,$2;
  1962. $1=_st(html)._button();
  1963. _st($1)._class_("button");
  1964. _st($1)._with_("SaveIt");
  1965. $2=_st($1)._onClick_((function(){
  1966. return smalltalk.withContext(function($ctx2) {
  1967. return self._saveIt();
  1968. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1969. globals.HLBrowserCodeWidget.superclass.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1970. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLBrowserCodeWidget)})},
  1971. args: ["html"],
  1972. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'SaveIt';\x0a\x09\x09onClick: [ self saveIt ].\x0a\x09super renderButtonsOn: html",
  1973. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"],
  1974. referencedClasses: []
  1975. }),
  1976. globals.HLBrowserCodeWidget);
  1977. smalltalk.addMethod(
  1978. smalltalk.method({
  1979. selector: "saveIt",
  1980. protocol: 'actions',
  1981. fn: function (){
  1982. var self=this;
  1983. return smalltalk.withContext(function($ctx1) {
  1984. _st(self._browserModel())._saveSourceCode();
  1985. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},globals.HLBrowserCodeWidget)})},
  1986. args: [],
  1987. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1988. messageSends: ["saveSourceCode", "browserModel"],
  1989. referencedClasses: []
  1990. }),
  1991. globals.HLBrowserCodeWidget);
  1992. smalltalk.addMethod(
  1993. smalltalk.method({
  1994. selector: "unregister",
  1995. protocol: 'actions',
  1996. fn: function (){
  1997. var self=this;
  1998. return smalltalk.withContext(function($ctx1) {
  1999. var $2,$1;
  2000. globals.HLBrowserCodeWidget.superclass.fn.prototype._unregsiter.apply(_st(self), []);
  2001. $2=self._browserModel();
  2002. $ctx1.sendIdx["browserModel"]=1;
  2003. $1=_st($2)._announcer();
  2004. _st($1)._unsubscribe_(self);
  2005. $ctx1.sendIdx["unsubscribe:"]=1;
  2006. _st(_st(self._browserModel())._systemAnnouncer())._unsubscribe_(self);
  2007. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLBrowserCodeWidget)})},
  2008. args: [],
  2009. source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
  2010. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
  2011. referencedClasses: []
  2012. }),
  2013. globals.HLBrowserCodeWidget);
  2014. smalltalk.addMethod(
  2015. smalltalk.method({
  2016. selector: "canBeOpenAsTab",
  2017. protocol: 'testing',
  2018. fn: function (){
  2019. var self=this;
  2020. return false;
  2021. },
  2022. args: [],
  2023. source: "canBeOpenAsTab\x0a\x09^ false",
  2024. messageSends: [],
  2025. referencedClasses: []
  2026. }),
  2027. globals.HLBrowserCodeWidget.klass);
  2028. smalltalk.addMethod(
  2029. smalltalk.method({
  2030. selector: "on:",
  2031. protocol: 'instance creation',
  2032. fn: function (aBrowserModel){
  2033. var self=this;
  2034. return smalltalk.withContext(function($ctx1) {
  2035. var $2,$3,$1;
  2036. $2=self._new();
  2037. _st($2)._browserModel_(aBrowserModel);
  2038. $3=_st($2)._yourself();
  2039. $1=$3;
  2040. return $1;
  2041. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget.klass)})},
  2042. args: ["aBrowserModel"],
  2043. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  2044. messageSends: ["browserModel:", "new", "yourself"],
  2045. referencedClasses: []
  2046. }),
  2047. globals.HLBrowserCodeWidget.klass);
  2048. smalltalk.addClass('HLWorkspace', globals.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  2049. smalltalk.addMethod(
  2050. smalltalk.method({
  2051. selector: "canHaveFocus",
  2052. protocol: 'testing',
  2053. fn: function (){
  2054. var self=this;
  2055. return true;
  2056. },
  2057. args: [],
  2058. source: "canHaveFocus\x0a\x09^ true",
  2059. messageSends: [],
  2060. referencedClasses: []
  2061. }),
  2062. globals.HLWorkspace);
  2063. smalltalk.addMethod(
  2064. smalltalk.method({
  2065. selector: "codeWidget",
  2066. protocol: 'accessing',
  2067. fn: function (){
  2068. var self=this;
  2069. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  2070. return smalltalk.withContext(function($ctx1) {
  2071. var $2,$1;
  2072. $2=self["@codeWidget"];
  2073. if(($receiver = $2) == nil || $receiver == null){
  2074. self["@codeWidget"]=_st($HLCodeWidget())._new();
  2075. $1=self["@codeWidget"];
  2076. } else {
  2077. $1=$2;
  2078. };
  2079. return $1;
  2080. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},globals.HLWorkspace)})},
  2081. args: [],
  2082. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  2083. messageSends: ["ifNil:", "new"],
  2084. referencedClasses: ["HLCodeWidget"]
  2085. }),
  2086. globals.HLWorkspace);
  2087. smalltalk.addMethod(
  2088. smalltalk.method({
  2089. selector: "focus",
  2090. protocol: 'actions',
  2091. fn: function (){
  2092. var self=this;
  2093. return smalltalk.withContext(function($ctx1) {
  2094. var $1;
  2095. $1=_st(self._codeWidget())._focus();
  2096. return $1;
  2097. }, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLWorkspace)})},
  2098. args: [],
  2099. source: "focus\x0a\x09^ self codeWidget focus",
  2100. messageSends: ["focus", "codeWidget"],
  2101. referencedClasses: []
  2102. }),
  2103. globals.HLWorkspace);
  2104. smalltalk.addMethod(
  2105. smalltalk.method({
  2106. selector: "renderContentOn:",
  2107. protocol: 'rendering',
  2108. fn: function (html){
  2109. var self=this;
  2110. function $HLContainer(){return globals.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  2111. function $HLHorizontalSplitter(){return globals.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  2112. return smalltalk.withContext(function($ctx1) {
  2113. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._codeWidget(),(function(canvas){
  2114. return smalltalk.withContext(function($ctx2) {
  2115. return self._renderTranscriptOn_(canvas);
  2116. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1,1)})}))));
  2117. $ctx1.sendIdx["with:"]=1;
  2118. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLWorkspace)})},
  2119. args: ["html"],
  2120. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self codeWidget\x0a\x09\x09with: [ :canvas | self renderTranscriptOn: canvas ]))",
  2121. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"],
  2122. referencedClasses: ["HLContainer", "HLHorizontalSplitter"]
  2123. }),
  2124. globals.HLWorkspace);
  2125. smalltalk.addMethod(
  2126. smalltalk.method({
  2127. selector: "renderTranscriptOn:",
  2128. protocol: 'rendering',
  2129. fn: function (html){
  2130. var self=this;
  2131. return smalltalk.withContext(function($ctx1) {
  2132. var $1,$3,$4,$2;
  2133. $1=_st(html)._div();
  2134. $ctx1.sendIdx["div"]=1;
  2135. _st($1)._class_("transcript-container");
  2136. $ctx1.sendIdx["class:"]=1;
  2137. $2=_st($1)._with_((function(){
  2138. return smalltalk.withContext(function($ctx2) {
  2139. $3=_st(html)._div();
  2140. _st($3)._class_("list-label");
  2141. $4=_st($3)._with_("Transcript");
  2142. $4;
  2143. return _st(self._transcript())._renderOn_(html);
  2144. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2145. $ctx1.sendIdx["with:"]=1;
  2146. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},globals.HLWorkspace)})},
  2147. args: ["html"],
  2148. source: "renderTranscriptOn: html\x0a\x09html div \x0a\x09\x09class: 'transcript-container';\x0a\x09\x09with: [\x0a\x09\x09\x09html div\x0a\x09\x09\x09\x09class: 'list-label';\x0a\x09\x09\x09\x09with: 'Transcript'.\x0a\x09\x09\x09self transcript renderOn: html ]",
  2149. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"],
  2150. referencedClasses: []
  2151. }),
  2152. globals.HLWorkspace);
  2153. smalltalk.addMethod(
  2154. smalltalk.method({
  2155. selector: "transcript",
  2156. protocol: 'accessing',
  2157. fn: function (){
  2158. var self=this;
  2159. function $HLTranscript(){return globals.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  2160. return smalltalk.withContext(function($ctx1) {
  2161. var $2,$1;
  2162. $2=self["@transcript"];
  2163. if(($receiver = $2) == nil || $receiver == null){
  2164. self["@transcript"]=_st($HLTranscript())._new();
  2165. $1=self["@transcript"];
  2166. } else {
  2167. $1=$2;
  2168. };
  2169. return $1;
  2170. }, function($ctx1) {$ctx1.fill(self,"transcript",{},globals.HLWorkspace)})},
  2171. args: [],
  2172. source: "transcript\x0a\x09^ transcript ifNil: [ transcript := HLTranscript new ]",
  2173. messageSends: ["ifNil:", "new"],
  2174. referencedClasses: ["HLTranscript"]
  2175. }),
  2176. globals.HLWorkspace);
  2177. smalltalk.addMethod(
  2178. smalltalk.method({
  2179. selector: "unregister",
  2180. protocol: 'actions',
  2181. fn: function (){
  2182. var self=this;
  2183. return smalltalk.withContext(function($ctx1) {
  2184. globals.HLWorkspace.superclass.fn.prototype._unregister.apply(_st(self), []);
  2185. $ctx1.sendIdx["unregister"]=1;
  2186. _st(self._transcript())._unregister();
  2187. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLWorkspace)})},
  2188. args: [],
  2189. source: "unregister\x0a\x09super unregister.\x0a\x09self transcript unregister",
  2190. messageSends: ["unregister", "transcript"],
  2191. referencedClasses: []
  2192. }),
  2193. globals.HLWorkspace);
  2194. smalltalk.addMethod(
  2195. smalltalk.method({
  2196. selector: "canBeOpenAsTab",
  2197. protocol: 'testing',
  2198. fn: function (){
  2199. var self=this;
  2200. return true;
  2201. },
  2202. args: [],
  2203. source: "canBeOpenAsTab\x0a\x09^ true",
  2204. messageSends: [],
  2205. referencedClasses: []
  2206. }),
  2207. globals.HLWorkspace.klass);
  2208. smalltalk.addMethod(
  2209. smalltalk.method({
  2210. selector: "tabClass",
  2211. protocol: 'accessing',
  2212. fn: function (){
  2213. var self=this;
  2214. return "workspace";
  2215. },
  2216. args: [],
  2217. source: "tabClass\x0a\x09^ 'workspace'",
  2218. messageSends: [],
  2219. referencedClasses: []
  2220. }),
  2221. globals.HLWorkspace.klass);
  2222. smalltalk.addMethod(
  2223. smalltalk.method({
  2224. selector: "tabLabel",
  2225. protocol: 'accessing',
  2226. fn: function (){
  2227. var self=this;
  2228. return "Workspace";
  2229. },
  2230. args: [],
  2231. source: "tabLabel\x0a\x09^ 'Workspace'",
  2232. messageSends: [],
  2233. referencedClasses: []
  2234. }),
  2235. globals.HLWorkspace.klass);
  2236. smalltalk.addMethod(
  2237. smalltalk.method({
  2238. selector: "tabPriority",
  2239. protocol: 'accessing',
  2240. fn: function (){
  2241. var self=this;
  2242. return (10);
  2243. },
  2244. args: [],
  2245. source: "tabPriority\x0a\x09^ 10",
  2246. messageSends: [],
  2247. referencedClasses: []
  2248. }),
  2249. globals.HLWorkspace.klass);
  2250. });