Helios-Core.js 144 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "announcer",
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  10. return smalltalk.withContext(function($ctx1) {
  11. var $2,$1;
  12. $2=self["@announcer"];
  13. if(($receiver = $2) == nil || $receiver == undefined){
  14. self["@announcer"]=_st($Announcer())._new();
  15. $1=self["@announcer"];
  16. } else {
  17. $1=$2;
  18. };
  19. return $1;
  20. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLModel)})},
  21. args: [],
  22. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  23. messageSends: ["ifNil:", "new"],
  24. referencedClasses: ["Announcer"]
  25. }),
  26. smalltalk.HLModel);
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "environment",
  30. category: 'accessing',
  31. fn: function (){
  32. var self=this;
  33. return smalltalk.withContext(function($ctx1) {
  34. var $2,$1;
  35. $2=self["@environment"];
  36. if(($receiver = $2) == nil || $receiver == undefined){
  37. $1=_st(_st(self)._manager())._environment();
  38. } else {
  39. $1=$2;
  40. };
  41. return $1;
  42. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLModel)})},
  43. args: [],
  44. source: "environment\x0a\x09^ environment ifNil: [ self manager environment ]",
  45. messageSends: ["ifNil:", "environment", "manager"],
  46. referencedClasses: []
  47. }),
  48. smalltalk.HLModel);
  49. smalltalk.addMethod(
  50. smalltalk.method({
  51. selector: "environment:",
  52. category: 'accessing',
  53. fn: function (anEnvironment){
  54. var self=this;
  55. return smalltalk.withContext(function($ctx1) {
  56. self["@environment"]=anEnvironment;
  57. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLModel)})},
  58. args: ["anEnvironment"],
  59. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  60. messageSends: [],
  61. referencedClasses: []
  62. }),
  63. smalltalk.HLModel);
  64. smalltalk.addMethod(
  65. smalltalk.method({
  66. selector: "isBrowserModel",
  67. category: 'testing',
  68. fn: function (){
  69. var self=this;
  70. return smalltalk.withContext(function($ctx1) {
  71. return false;
  72. }, function($ctx1) {$ctx1.fill(self,"isBrowserModel",{},smalltalk.HLModel)})},
  73. args: [],
  74. source: "isBrowserModel\x0a\x09^ false",
  75. messageSends: [],
  76. referencedClasses: []
  77. }),
  78. smalltalk.HLModel);
  79. smalltalk.addMethod(
  80. smalltalk.method({
  81. selector: "isReferencesModel",
  82. category: 'testing',
  83. fn: function (){
  84. var self=this;
  85. return smalltalk.withContext(function($ctx1) {
  86. return false;
  87. }, function($ctx1) {$ctx1.fill(self,"isReferencesModel",{},smalltalk.HLModel)})},
  88. args: [],
  89. source: "isReferencesModel\x0a\x09^ false",
  90. messageSends: [],
  91. referencedClasses: []
  92. }),
  93. smalltalk.HLModel);
  94. smalltalk.addMethod(
  95. smalltalk.method({
  96. selector: "isToolModel",
  97. category: 'testing',
  98. fn: function (){
  99. var self=this;
  100. return smalltalk.withContext(function($ctx1) {
  101. return false;
  102. }, function($ctx1) {$ctx1.fill(self,"isToolModel",{},smalltalk.HLModel)})},
  103. args: [],
  104. source: "isToolModel\x0a\x09^ false",
  105. messageSends: [],
  106. referencedClasses: []
  107. }),
  108. smalltalk.HLModel);
  109. smalltalk.addMethod(
  110. smalltalk.method({
  111. selector: "manager",
  112. category: 'accessing',
  113. fn: function (){
  114. var self=this;
  115. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  116. return smalltalk.withContext(function($ctx1) {
  117. var $1;
  118. $1=_st($HLManager())._current();
  119. return $1;
  120. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLModel)})},
  121. args: [],
  122. source: "manager\x0a\x09^ HLManager current",
  123. messageSends: ["current"],
  124. referencedClasses: ["HLManager"]
  125. }),
  126. smalltalk.HLModel);
  127. smalltalk.addMethod(
  128. smalltalk.method({
  129. selector: "systemAnnouncer",
  130. category: 'accessing',
  131. fn: function (){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) {
  134. var $1;
  135. $1=_st(_st(self)._environment())._systemAnnouncer();
  136. return $1;
  137. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLModel)})},
  138. args: [],
  139. source: "systemAnnouncer\x0a\x09^ self environment systemAnnouncer",
  140. messageSends: ["systemAnnouncer", "environment"],
  141. referencedClasses: []
  142. }),
  143. smalltalk.HLModel);
  144. smalltalk.addMethod(
  145. smalltalk.method({
  146. selector: "withChangesDo:",
  147. category: 'error handling',
  148. fn: function (aBlock){
  149. var self=this;
  150. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  151. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  152. return smalltalk.withContext(function($ctx1) {
  153. _st((function(){
  154. return smalltalk.withContext(function($ctx2) {
  155. _st(_st(self)._announcer())._announce_(_st(_st($HLAboutToChange())._new())._actionBlock_(aBlock));
  156. return _st(aBlock)._value();
  157. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($HLChangeForbidden(),(function(ex){
  158. return smalltalk.withContext(function($ctx2) {
  159. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  160. return self}, function($ctx1) {$ctx1.fill(self,"withChangesDo:",{aBlock:aBlock},smalltalk.HLModel)})},
  161. args: ["aBlock"],
  162. source: "withChangesDo: aBlock\x0a\x09[ \x0a\x09\x09self announcer announce: (HLAboutToChange new\x0a\x09\x09\x09actionBlock: aBlock).\x0a\x09\x09aBlock value.\x0a\x09]\x0a\x09\x09on: HLChangeForbidden \x0a\x09\x09do: [ :ex | ]",
  163. messageSends: ["on:do:", "announce:", "actionBlock:", "new", "announcer", "value"],
  164. referencedClasses: ["HLChangeForbidden", "HLAboutToChange"]
  165. }),
  166. smalltalk.HLModel);
  167. smalltalk.addClass('HLToolModel', smalltalk.HLModel, ['selectedClass', 'selectedPackage', 'selectedProtocol', 'selectedSelector'], 'Helios-Core');
  168. smalltalk.addMethod(
  169. smalltalk.method({
  170. selector: "addInstVarNamed:",
  171. category: 'actions',
  172. fn: function (aString){
  173. var self=this;
  174. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  175. return smalltalk.withContext(function($ctx1) {
  176. var $1,$2;
  177. _st(_st(self)._environment())._addInstVarNamed_to_(aString,_st(self)._selectedClass());
  178. $1=_st($HLInstVarAdded())._new();
  179. _st($1)._theClass_(_st(self)._selectedClass());
  180. _st($1)._variableName_(aString);
  181. $2=_st($1)._yourself();
  182. _st(_st(self)._announcer())._announce_($2);
  183. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:",{aString:aString},smalltalk.HLToolModel)})},
  184. args: ["aString"],
  185. source: "addInstVarNamed: aString\x0a\x09self environment addInstVarNamed: aString to: self selectedClass.\x0a\x09self announcer announce: (HLInstVarAdded new\x0a\x09\x09theClass: self selectedClass;\x0a\x09\x09variableName: aString;\x0a\x09\x09yourself)",
  186. messageSends: ["addInstVarNamed:to:", "selectedClass", "environment", "announce:", "theClass:", "new", "variableName:", "yourself", "announcer"],
  187. referencedClasses: ["HLInstVarAdded"]
  188. }),
  189. smalltalk.HLToolModel);
  190. smalltalk.addMethod(
  191. smalltalk.method({
  192. selector: "allProtocol",
  193. category: 'defaults',
  194. fn: function (){
  195. var self=this;
  196. return smalltalk.withContext(function($ctx1) {
  197. return "-- all --";
  198. }, function($ctx1) {$ctx1.fill(self,"allProtocol",{},smalltalk.HLToolModel)})},
  199. args: [],
  200. source: "allProtocol\x0a\x09^ '-- all --'",
  201. messageSends: [],
  202. referencedClasses: []
  203. }),
  204. smalltalk.HLToolModel);
  205. smalltalk.addMethod(
  206. smalltalk.method({
  207. selector: "allSelectors",
  208. category: 'accessing',
  209. fn: function (){
  210. var self=this;
  211. return smalltalk.withContext(function($ctx1) {
  212. var $1;
  213. $1=_st(_st(self)._environment())._allSelectors();
  214. return $1;
  215. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.HLToolModel)})},
  216. args: [],
  217. source: "allSelectors\x0a\x09^ self environment allSelectors",
  218. messageSends: ["allSelectors", "environment"],
  219. referencedClasses: []
  220. }),
  221. smalltalk.HLToolModel);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "availableClassNames",
  225. category: 'accessing',
  226. fn: function (){
  227. var self=this;
  228. return smalltalk.withContext(function($ctx1) {
  229. var $1;
  230. $1=_st(_st(self)._environment())._availableClassNames();
  231. return $1;
  232. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLToolModel)})},
  233. args: [],
  234. source: "availableClassNames\x0a\x09^ self environment availableClassNames",
  235. messageSends: ["availableClassNames", "environment"],
  236. referencedClasses: []
  237. }),
  238. smalltalk.HLToolModel);
  239. smalltalk.addMethod(
  240. smalltalk.method({
  241. selector: "availablePackageNames",
  242. category: 'accessing',
  243. fn: function (){
  244. var self=this;
  245. return smalltalk.withContext(function($ctx1) {
  246. var $1;
  247. $1=_st(_st(self)._environment())._availablePackageNames();
  248. return $1;
  249. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.HLToolModel)})},
  250. args: [],
  251. source: "availablePackageNames\x0a\x09^ self environment availablePackageNames",
  252. messageSends: ["availablePackageNames", "environment"],
  253. referencedClasses: []
  254. }),
  255. smalltalk.HLToolModel);
  256. smalltalk.addMethod(
  257. smalltalk.method({
  258. selector: "availablePackages",
  259. category: 'accessing',
  260. fn: function (){
  261. var self=this;
  262. return smalltalk.withContext(function($ctx1) {
  263. var $1;
  264. $1=_st(_st(self)._environment())._availablePackageNames();
  265. return $1;
  266. }, function($ctx1) {$ctx1.fill(self,"availablePackages",{},smalltalk.HLToolModel)})},
  267. args: [],
  268. source: "availablePackages\x0a\x09^ self environment availablePackageNames",
  269. messageSends: ["availablePackageNames", "environment"],
  270. referencedClasses: []
  271. }),
  272. smalltalk.HLToolModel);
  273. smalltalk.addMethod(
  274. smalltalk.method({
  275. selector: "availableProtocols",
  276. category: 'accessing',
  277. fn: function (){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) {
  280. var $1;
  281. $1=_st(_st(self)._environment())._availableProtocolsFor_(_st(self)._selectedClass());
  282. return $1;
  283. }, function($ctx1) {$ctx1.fill(self,"availableProtocols",{},smalltalk.HLToolModel)})},
  284. args: [],
  285. source: "availableProtocols\x0a\x09^ self environment availableProtocolsFor: self selectedClass",
  286. messageSends: ["availableProtocolsFor:", "selectedClass", "environment"],
  287. referencedClasses: []
  288. }),
  289. smalltalk.HLToolModel);
  290. smalltalk.addMethod(
  291. smalltalk.method({
  292. selector: "commitPackage",
  293. category: 'commands actions',
  294. fn: function (){
  295. var self=this;
  296. return smalltalk.withContext(function($ctx1) {
  297. _st(self)._withHelperLabelled_do_(_st(_st("Committing package ").__comma(_st(_st(self)._selectedPackage())._name())).__comma("..."),(function(){
  298. return smalltalk.withContext(function($ctx2) {
  299. return _st(_st(self)._environment())._commitPackage_(_st(self)._selectedPackage());
  300. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  301. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage",{},smalltalk.HLToolModel)})},
  302. args: [],
  303. source: "commitPackage\x0a\x09self \x0a\x09\x09withHelperLabelled: 'Committing package ', self selectedPackage name, '...'\x0a\x09\x09do: [ self environment commitPackage: self selectedPackage ]",
  304. messageSends: ["withHelperLabelled:do:", ",", "name", "selectedPackage", "commitPackage:", "environment"],
  305. referencedClasses: []
  306. }),
  307. smalltalk.HLToolModel);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "compilationProtocol",
  311. category: 'private',
  312. fn: function (){
  313. var self=this;
  314. var currentProtocol;
  315. return smalltalk.withContext(function($ctx1) {
  316. var $1,$2,$4,$3;
  317. currentProtocol=_st(self)._selectedProtocol();
  318. $1=currentProtocol;
  319. if(($receiver = $1) == nil || $receiver == undefined){
  320. currentProtocol=_st(self)._unclassifiedProtocol();
  321. currentProtocol;
  322. } else {
  323. $1;
  324. };
  325. $2=_st(self)._selectedMethod();
  326. if(($receiver = $2) == nil || $receiver == undefined){
  327. $2;
  328. } else {
  329. currentProtocol=_st(_st(self)._selectedMethod())._protocol();
  330. currentProtocol;
  331. };
  332. $4=_st(currentProtocol).__eq(_st(self)._allProtocol());
  333. if(smalltalk.assert($4)){
  334. $3=_st(self)._unclassifiedProtocol();
  335. } else {
  336. $3=currentProtocol;
  337. };
  338. return $3;
  339. }, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol},smalltalk.HLToolModel)})},
  340. args: [],
  341. source: "compilationProtocol\x0a\x09| currentProtocol |\x0a\x09\x0a\x09currentProtocol := self selectedProtocol.\x0a\x09currentProtocol ifNil: [ currentProtocol := self unclassifiedProtocol ].\x0a\x09self selectedMethod ifNotNil: [ currentProtocol := self selectedMethod protocol ].\x0a\x0a\x09^ currentProtocol = self allProtocol\x0a\x09\x09ifTrue: [ self unclassifiedProtocol ]\x0a\x09\x09ifFalse: [ currentProtocol ]",
  342. messageSends: ["selectedProtocol", "ifNil:", "unclassifiedProtocol", "ifNotNil:", "protocol", "selectedMethod", "ifTrue:ifFalse:", "=", "allProtocol"],
  343. referencedClasses: []
  344. }),
  345. smalltalk.HLToolModel);
  346. smalltalk.addMethod(
  347. smalltalk.method({
  348. selector: "compileClassComment:",
  349. category: 'compiling',
  350. fn: function (aString){
  351. var self=this;
  352. return smalltalk.withContext(function($ctx1) {
  353. _st(_st(self)._environment())._compileClassComment_for_(aString,_st(self)._selectedClass());
  354. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:",{aString:aString},smalltalk.HLToolModel)})},
  355. args: ["aString"],
  356. source: "compileClassComment: aString\x0a\x09self environment \x0a\x09\x09compileClassComment: aString \x0a\x09\x09for: self selectedClass",
  357. messageSends: ["compileClassComment:for:", "selectedClass", "environment"],
  358. referencedClasses: []
  359. }),
  360. smalltalk.HLToolModel);
  361. smalltalk.addMethod(
  362. smalltalk.method({
  363. selector: "compileClassDefinition:",
  364. category: 'compiling',
  365. fn: function (aString){
  366. var self=this;
  367. return smalltalk.withContext(function($ctx1) {
  368. _st(_st(self)._environment())._compileClassDefinition_(aString);
  369. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.HLToolModel)})},
  370. args: ["aString"],
  371. source: "compileClassDefinition: aString\x0a\x09self environment compileClassDefinition: aString",
  372. messageSends: ["compileClassDefinition:", "environment"],
  373. referencedClasses: []
  374. }),
  375. smalltalk.HLToolModel);
  376. smalltalk.addMethod(
  377. smalltalk.method({
  378. selector: "compileMethod:",
  379. category: 'compiling',
  380. fn: function (aString){
  381. var self=this;
  382. var method;
  383. return smalltalk.withContext(function($ctx1) {
  384. _st(self)._withCompileErrorHandling_((function(){
  385. return smalltalk.withContext(function($ctx2) {
  386. method=_st(_st(self)._environment())._compileMethod_for_protocol_(aString,_st(self)._selectedClass(),_st(self)._compilationProtocol());
  387. method;
  388. return _st(self)._selectedMethod_(method);
  389. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  390. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString,method:method},smalltalk.HLToolModel)})},
  391. args: ["aString"],
  392. source: "compileMethod: aString\x0a\x09| method |\x0a\x09\x0a\x09self withCompileErrorHandling: [ \x0a\x09\x09method := self environment \x0a\x09\x09\x09compileMethod: aString \x0a\x09\x09\x09for: self selectedClass\x0a\x09\x09\x09protocol: self compilationProtocol.\x0a\x0a\x09\x09self selectedMethod: method ]",
  393. messageSends: ["withCompileErrorHandling:", "compileMethod:for:protocol:", "selectedClass", "compilationProtocol", "environment", "selectedMethod:"],
  394. referencedClasses: []
  395. }),
  396. smalltalk.HLToolModel);
  397. smalltalk.addMethod(
  398. smalltalk.method({
  399. selector: "copyClassTo:",
  400. category: 'commands actions',
  401. fn: function (aClassName){
  402. var self=this;
  403. return smalltalk.withContext(function($ctx1) {
  404. _st(self)._withChangesDo_((function(){
  405. return smalltalk.withContext(function($ctx2) {
  406. return _st(_st(self)._environment())._copyClass_to_(_st(_st(self)._selectedClass())._theNonMetaClass(),aClassName);
  407. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  408. return self}, function($ctx1) {$ctx1.fill(self,"copyClassTo:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  409. args: ["aClassName"],
  410. source: "copyClassTo: aClassName\x0a\x09self withChangesDo: [ \x0a\x09\x09self environment \x0a\x09\x09\x09copyClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  411. messageSends: ["withChangesDo:", "copyClass:to:", "theNonMetaClass", "selectedClass", "environment"],
  412. referencedClasses: []
  413. }),
  414. smalltalk.HLToolModel);
  415. smalltalk.addMethod(
  416. smalltalk.method({
  417. selector: "handleCompileError:",
  418. category: 'error handling',
  419. fn: function (anError){
  420. var self=this;
  421. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  422. return smalltalk.withContext(function($ctx1) {
  423. var $1,$2;
  424. $1=_st($HLCompileErrorRaised())._new();
  425. _st($1)._error_(anError);
  426. $2=_st($1)._yourself();
  427. _st(_st(self)._announcer())._announce_($2);
  428. return self}, function($ctx1) {$ctx1.fill(self,"handleCompileError:",{anError:anError},smalltalk.HLToolModel)})},
  429. args: ["anError"],
  430. source: "handleCompileError: anError\x0a\x09self announcer announce: (HLCompileErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  431. messageSends: ["announce:", "error:", "new", "yourself", "announcer"],
  432. referencedClasses: ["HLCompileErrorRaised"]
  433. }),
  434. smalltalk.HLToolModel);
  435. smalltalk.addMethod(
  436. smalltalk.method({
  437. selector: "handleParseError:",
  438. category: 'error handling',
  439. fn: function (anError){
  440. var self=this;
  441. var split,line,column,messageToInsert;
  442. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  443. return smalltalk.withContext(function($ctx1) {
  444. var $1,$2;
  445. split=_st(_st(anError)._messageText())._tokenize_(" : ");
  446. messageToInsert=_st(split)._second();
  447. split=_st(_st(split)._first())._copyFrom_to_((21),_st(_st(split)._first())._size());
  448. split=_st(split)._tokenize_(" column ");
  449. line=_st(split)._first();
  450. column=_st(split)._second();
  451. $1=_st($HLParseErrorRaised())._new();
  452. _st($1)._line_(_st(line)._asNumber());
  453. _st($1)._column_(_st(column)._asNumber());
  454. _st($1)._message_(messageToInsert);
  455. _st($1)._error_(anError);
  456. $2=_st($1)._yourself();
  457. _st(_st(self)._announcer())._announce_($2);
  458. return self}, function($ctx1) {$ctx1.fill(self,"handleParseError:",{anError:anError,split:split,line:line,column:column,messageToInsert:messageToInsert},smalltalk.HLToolModel)})},
  459. args: ["anError"],
  460. source: "handleParseError: anError\x0a\x09| split line column messageToInsert |\x0a\x09\x0a\x09split := anError messageText tokenize: ' : '.\x0a\x09messageToInsert := split second.\x0a\x0a\x09\x2221 = 'Parse error on line ' size + 1\x22\x0a\x09split := split first copyFrom: 21 to: split first size.\x0a\x09\x0a\x09split := split tokenize: ' column '.\x0a\x09line := split first.\x0a\x09column := split second.\x0a\x09\x0a\x09self announcer announce: (HLParseErrorRaised new\x0a\x09\x09line: line asNumber;\x0a\x09\x09column: column asNumber;\x0a\x09\x09message: messageToInsert;\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  461. messageSends: ["tokenize:", "messageText", "second", "copyFrom:to:", "size", "first", "announce:", "line:", "asNumber", "new", "column:", "message:", "error:", "yourself", "announcer"],
  462. referencedClasses: ["HLParseErrorRaised"]
  463. }),
  464. smalltalk.HLToolModel);
  465. smalltalk.addMethod(
  466. smalltalk.method({
  467. selector: "handleUnkownVariableError:",
  468. category: 'error handling',
  469. fn: function (anError){
  470. var self=this;
  471. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  472. return smalltalk.withContext(function($ctx1) {
  473. var $1,$2;
  474. $1=_st($HLUnknownVariableErrorRaised())._new();
  475. _st($1)._error_(anError);
  476. $2=_st($1)._yourself();
  477. _st(_st(self)._announcer())._announce_($2);
  478. return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anError:anError},smalltalk.HLToolModel)})},
  479. args: ["anError"],
  480. source: "handleUnkownVariableError: anError\x0a\x09self announcer announce: (HLUnknownVariableErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  481. messageSends: ["announce:", "error:", "new", "yourself", "announcer"],
  482. referencedClasses: ["HLUnknownVariableErrorRaised"]
  483. }),
  484. smalltalk.HLToolModel);
  485. smalltalk.addMethod(
  486. smalltalk.method({
  487. selector: "isToolModel",
  488. category: 'testing',
  489. fn: function (){
  490. var self=this;
  491. return smalltalk.withContext(function($ctx1) {
  492. return true;
  493. }, function($ctx1) {$ctx1.fill(self,"isToolModel",{},smalltalk.HLToolModel)})},
  494. args: [],
  495. source: "isToolModel\x0a\x09^ true",
  496. messageSends: [],
  497. referencedClasses: []
  498. }),
  499. smalltalk.HLToolModel);
  500. smalltalk.addMethod(
  501. smalltalk.method({
  502. selector: "moveClassToPackage:",
  503. category: 'commands actions',
  504. fn: function (aPackageName){
  505. var self=this;
  506. return smalltalk.withContext(function($ctx1) {
  507. _st(self)._withChangesDo_((function(){
  508. return smalltalk.withContext(function($ctx2) {
  509. return _st(_st(self)._environment())._moveClass_toPackage_(_st(_st(self)._selectedClass())._theNonMetaClass(),aPackageName);
  510. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  511. return self}, function($ctx1) {$ctx1.fill(self,"moveClassToPackage:",{aPackageName:aPackageName},smalltalk.HLToolModel)})},
  512. args: ["aPackageName"],
  513. source: "moveClassToPackage: aPackageName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09toPackage: aPackageName ]",
  514. messageSends: ["withChangesDo:", "moveClass:toPackage:", "theNonMetaClass", "selectedClass", "environment"],
  515. referencedClasses: []
  516. }),
  517. smalltalk.HLToolModel);
  518. smalltalk.addMethod(
  519. smalltalk.method({
  520. selector: "moveMethodToClass:",
  521. category: 'commands actions',
  522. fn: function (aClassName){
  523. var self=this;
  524. return smalltalk.withContext(function($ctx1) {
  525. _st(self)._withChangesDo_((function(){
  526. return smalltalk.withContext(function($ctx2) {
  527. return _st(_st(self)._environment())._moveMethod_toClass_(_st(self)._selectedMethod(),aClassName);
  528. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  529. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  530. args: ["aClassName"],
  531. source: "moveMethodToClass: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toClass: aClassName ]",
  532. messageSends: ["withChangesDo:", "moveMethod:toClass:", "selectedMethod", "environment"],
  533. referencedClasses: []
  534. }),
  535. smalltalk.HLToolModel);
  536. smalltalk.addMethod(
  537. smalltalk.method({
  538. selector: "moveMethodToProtocol:",
  539. category: 'commands actions',
  540. fn: function (aProtocol){
  541. var self=this;
  542. return smalltalk.withContext(function($ctx1) {
  543. _st(self)._withChangesDo_((function(){
  544. return smalltalk.withContext(function($ctx2) {
  545. return _st(_st(self)._environment())._moveMethod_toProtocol_(_st(self)._selectedMethod(),aProtocol);
  546. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  547. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToProtocol:",{aProtocol:aProtocol},smalltalk.HLToolModel)})},
  548. args: ["aProtocol"],
  549. source: "moveMethodToProtocol: aProtocol\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toProtocol: aProtocol ]",
  550. messageSends: ["withChangesDo:", "moveMethod:toProtocol:", "selectedMethod", "environment"],
  551. referencedClasses: []
  552. }),
  553. smalltalk.HLToolModel);
  554. smalltalk.addMethod(
  555. smalltalk.method({
  556. selector: "openClassNamed:",
  557. category: 'commands actions',
  558. fn: function (aString){
  559. var self=this;
  560. var class_;
  561. return smalltalk.withContext(function($ctx1) {
  562. _st(self)._withChangesDo_((function(){
  563. return smalltalk.withContext(function($ctx2) {
  564. class_=_st(_st(self)._environment())._classNamed_(aString);
  565. class_;
  566. _st(self)._selectedPackage_(_st(class_)._package());
  567. return _st(self)._selectedClass_(class_);
  568. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  569. return self}, function($ctx1) {$ctx1.fill(self,"openClassNamed:",{aString:aString,class_:class_},smalltalk.HLToolModel)})},
  570. args: ["aString"],
  571. source: "openClassNamed: aString\x0a\x09| class |\x0a\x09\x0a\x09self withChangesDo: [\x0a\x09\x09class := self environment classNamed: aString.\x0a\x09\x09self selectedPackage: class package.\x0a\x09\x09self selectedClass: class ]",
  572. messageSends: ["withChangesDo:", "classNamed:", "environment", "selectedPackage:", "package", "selectedClass:"],
  573. referencedClasses: []
  574. }),
  575. smalltalk.HLToolModel);
  576. smalltalk.addMethod(
  577. smalltalk.method({
  578. selector: "packages",
  579. category: 'accessing',
  580. fn: function (){
  581. var self=this;
  582. return smalltalk.withContext(function($ctx1) {
  583. var $1;
  584. $1=_st(_st(self)._environment())._packages();
  585. return $1;
  586. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLToolModel)})},
  587. args: [],
  588. source: "packages\x0a\x09^ self environment packages",
  589. messageSends: ["packages", "environment"],
  590. referencedClasses: []
  591. }),
  592. smalltalk.HLToolModel);
  593. smalltalk.addMethod(
  594. smalltalk.method({
  595. selector: "removeClass",
  596. category: 'commands actions',
  597. fn: function (){
  598. var self=this;
  599. return smalltalk.withContext(function($ctx1) {
  600. _st(self)._withChangesDo_((function(){
  601. return smalltalk.withContext(function($ctx2) {
  602. return _st(_st(self)._manager())._confirm_ifTrue_(_st("Do you REALLY want to remove class ").__comma(_st(_st(self)._selectedClass())._name()),(function(){
  603. return smalltalk.withContext(function($ctx3) {
  604. return _st(_st(self)._environment())._removeClass_(_st(self)._selectedClass());
  605. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  606. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  607. return self}, function($ctx1) {$ctx1.fill(self,"removeClass",{},smalltalk.HLToolModel)})},
  608. args: [],
  609. source: "removeClass\x0a\x09self withChangesDo: [\x0a\x09\x09self manager \x0a\x09\x09\x09confirm: 'Do you REALLY want to remove class ', self selectedClass name\x0a\x09\x09\x09ifTrue: [ self environment removeClass: self selectedClass ] ]",
  610. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "name", "selectedClass", "removeClass:", "environment", "manager"],
  611. referencedClasses: []
  612. }),
  613. smalltalk.HLToolModel);
  614. smalltalk.addMethod(
  615. smalltalk.method({
  616. selector: "removeMethod",
  617. category: 'commands actions',
  618. fn: function (){
  619. var self=this;
  620. return smalltalk.withContext(function($ctx1) {
  621. _st(self)._withChangesDo_((function(){
  622. return smalltalk.withContext(function($ctx2) {
  623. return _st(_st(self)._manager())._confirm_ifTrue_(_st(_st(_st("Do you REALLY want to remove method ").__comma(_st(_st(_st(self)._selectedMethod())._methodClass())._name())).__comma(" >> #")).__comma(_st(_st(self)._selectedMethod())._selector()),(function(){
  624. return smalltalk.withContext(function($ctx3) {
  625. return _st(_st(self)._environment())._removeMethod_(_st(self)._selectedMethod());
  626. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  627. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  628. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},smalltalk.HLToolModel)})},
  629. args: [],
  630. source: "removeMethod\x0a\x09self withChangesDo: [\x0a\x09\x09self manager \x0a\x09\x09\x09confirm: 'Do you REALLY want to remove method ', self selectedMethod methodClass name,' >> #', self selectedMethod selector\x0a\x09\x09\x09ifTrue: [ self environment removeMethod: self selectedMethod ] ]",
  631. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "selector", "selectedMethod", "name", "methodClass", "removeMethod:", "environment", "manager"],
  632. referencedClasses: []
  633. }),
  634. smalltalk.HLToolModel);
  635. smalltalk.addMethod(
  636. smalltalk.method({
  637. selector: "removeProtocol",
  638. category: 'commands actions',
  639. fn: function (){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) {
  642. _st(self)._withChangesDo_((function(){
  643. return smalltalk.withContext(function($ctx2) {
  644. return _st(_st(self)._manager())._confirm_ifTrue_(_st("Do you REALLY want to remove protocol ").__comma(_st(self)._selectedProtocol()),(function(){
  645. return smalltalk.withContext(function($ctx3) {
  646. return _st(_st(self)._environment())._removeProtocol_from_(_st(self)._selectedProtocol(),_st(self)._selectedClass());
  647. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  648. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  649. return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol",{},smalltalk.HLToolModel)})},
  650. args: [],
  651. source: "removeProtocol\x0a\x09self withChangesDo: [\x0a\x09\x09self manager \x0a\x09\x09\x09confirm: 'Do you REALLY want to remove protocol ', self selectedProtocol\x0a\x09\x09\x09ifTrue: [ self environment \x0a\x09\x09\x09\x09removeProtocol: self selectedProtocol \x0a\x09\x09\x09\x09from: self selectedClass ] ]",
  652. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "selectedProtocol", "removeProtocol:from:", "selectedClass", "environment", "manager"],
  653. referencedClasses: []
  654. }),
  655. smalltalk.HLToolModel);
  656. smalltalk.addMethod(
  657. smalltalk.method({
  658. selector: "renameClassTo:",
  659. category: 'commands actions',
  660. fn: function (aClassName){
  661. var self=this;
  662. return smalltalk.withContext(function($ctx1) {
  663. _st(self)._withChangesDo_((function(){
  664. return smalltalk.withContext(function($ctx2) {
  665. return _st(_st(self)._environment())._renameClass_to_(_st(_st(self)._selectedClass())._theNonMetaClass(),aClassName);
  666. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  667. return self}, function($ctx1) {$ctx1.fill(self,"renameClassTo:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  668. args: ["aClassName"],
  669. source: "renameClassTo: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09renameClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  670. messageSends: ["withChangesDo:", "renameClass:to:", "theNonMetaClass", "selectedClass", "environment"],
  671. referencedClasses: []
  672. }),
  673. smalltalk.HLToolModel);
  674. smalltalk.addMethod(
  675. smalltalk.method({
  676. selector: "renameProtocolTo:",
  677. category: 'commands actions',
  678. fn: function (aString){
  679. var self=this;
  680. return smalltalk.withContext(function($ctx1) {
  681. _st(self)._withChangesDo_((function(){
  682. return smalltalk.withContext(function($ctx2) {
  683. return _st(_st(self)._environment())._renameProtocol_to_in_(_st(self)._selectedProtocol(),aString,_st(self)._selectedClass());
  684. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  685. return self}, function($ctx1) {$ctx1.fill(self,"renameProtocolTo:",{aString:aString},smalltalk.HLToolModel)})},
  686. args: ["aString"],
  687. source: "renameProtocolTo: aString\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09renameProtocol: self selectedProtocol\x0a\x09\x09\x09to: aString\x0a\x09\x09\x09in: self selectedClass ]",
  688. messageSends: ["withChangesDo:", "renameProtocol:to:in:", "selectedProtocol", "selectedClass", "environment"],
  689. referencedClasses: []
  690. }),
  691. smalltalk.HLToolModel);
  692. smalltalk.addMethod(
  693. smalltalk.method({
  694. selector: "save:",
  695. category: 'actions',
  696. fn: function (aString){
  697. var self=this;
  698. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  699. return smalltalk.withContext(function($ctx1) {
  700. var $1;
  701. _st(_st(self)._announcer())._announce_(_st($HLSourceCodeSaved())._new());
  702. $1=_st(self)._shouldCompileClassDefinition_(aString);
  703. if(smalltalk.assert($1)){
  704. _st(self)._compileClassDefinition_(aString);
  705. } else {
  706. _st(self)._compileMethod_(aString);
  707. };
  708. return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString},smalltalk.HLToolModel)})},
  709. args: ["aString"],
  710. source: "save: aString\x0a\x09self announcer announce: HLSourceCodeSaved new.\x0a\x09\x0a\x09(self shouldCompileClassDefinition: aString)\x0a\x09\x09ifTrue: [ self compileClassDefinition: aString ]\x0a\x09\x09ifFalse: [ self compileMethod: aString ]",
  711. messageSends: ["announce:", "new", "announcer", "ifTrue:ifFalse:", "compileClassDefinition:", "compileMethod:", "shouldCompileClassDefinition:"],
  712. referencedClasses: ["HLSourceCodeSaved"]
  713. }),
  714. smalltalk.HLToolModel);
  715. smalltalk.addMethod(
  716. smalltalk.method({
  717. selector: "saveSourceCode",
  718. category: 'actions',
  719. fn: function (){
  720. var self=this;
  721. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  722. return smalltalk.withContext(function($ctx1) {
  723. _st(_st(self)._announcer())._announce_(_st($HLSaveSourceCode())._new());
  724. return self}, function($ctx1) {$ctx1.fill(self,"saveSourceCode",{},smalltalk.HLToolModel)})},
  725. args: [],
  726. source: "saveSourceCode\x0a\x09self announcer announce: HLSaveSourceCode new",
  727. messageSends: ["announce:", "new", "announcer"],
  728. referencedClasses: ["HLSaveSourceCode"]
  729. }),
  730. smalltalk.HLToolModel);
  731. smalltalk.addMethod(
  732. smalltalk.method({
  733. selector: "selectedClass",
  734. category: 'accessing',
  735. fn: function (){
  736. var self=this;
  737. return smalltalk.withContext(function($ctx1) {
  738. var $1;
  739. $1=self["@selectedClass"];
  740. return $1;
  741. }, function($ctx1) {$ctx1.fill(self,"selectedClass",{},smalltalk.HLToolModel)})},
  742. args: [],
  743. source: "selectedClass\x0a\x09^ selectedClass",
  744. messageSends: [],
  745. referencedClasses: []
  746. }),
  747. smalltalk.HLToolModel);
  748. smalltalk.addMethod(
  749. smalltalk.method({
  750. selector: "selectedClass:",
  751. category: 'accessing',
  752. fn: function (aClass){
  753. var self=this;
  754. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  755. return smalltalk.withContext(function($ctx1) {
  756. var $1,$2,$3,$4,$5;
  757. $1=_st(_st(_st(self)._selectedClass()).__eq(aClass))._and_((function(){
  758. return smalltalk.withContext(function($ctx2) {
  759. return _st(aClass)._isNil();
  760. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  761. if(smalltalk.assert($1)){
  762. $2=self;
  763. return $2;
  764. };
  765. _st(self)._withChangesDo_((function(){
  766. return smalltalk.withContext(function($ctx2) {
  767. $3=_st(self["@selectedClass"]).__eq(aClass);
  768. if(smalltalk.assert($3)){
  769. _st(self)._selectedProtocol_(nil);
  770. };
  771. $4=aClass;
  772. if(($receiver = $4) == nil || $receiver == undefined){
  773. self["@selectedClass"]=nil;
  774. self["@selectedClass"];
  775. } else {
  776. _st(self)._selectedPackage_(_st(_st(aClass)._theNonMetaClass())._package());
  777. $5=_st(self)._showInstance();
  778. if(smalltalk.assert($5)){
  779. self["@selectedClass"]=_st(aClass)._theNonMetaClass();
  780. self["@selectedClass"];
  781. } else {
  782. self["@selectedClass"]=_st(aClass)._theMetaClass();
  783. self["@selectedClass"];
  784. };
  785. };
  786. _st(self)._selectedProtocol_(nil);
  787. return _st(_st(self)._announcer())._announce_(_st($HLClassSelected())._on_(_st(self)._selectedClass()));
  788. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  789. return self}, function($ctx1) {$ctx1.fill(self,"selectedClass:",{aClass:aClass},smalltalk.HLToolModel)})},
  790. args: ["aClass"],
  791. source: "selectedClass: aClass\x0a\x09(self selectedClass = aClass and: [ aClass isNil ]) \x0a\x09\x09ifTrue: [ ^ self ].\x0a\x09\x0a\x09self withChangesDo: [\x0a\x09\x09selectedClass = aClass ifTrue: [ \x0a\x09\x09\x09self selectedProtocol: nil ].\x0a \x0a\x09\x09aClass \x0a \x09\x09\x09ifNil: [ selectedClass := nil ]\x0a \x09\x09ifNotNil: [\x0a\x09\x09\x09\x09self selectedPackage: aClass theNonMetaClass package.\x0a\x09\x09\x09\x09self showInstance \x0a \x09\x09\x09\x09\x09ifTrue: [ selectedClass := aClass theNonMetaClass ]\x0a \x09\x09\x09\x09ifFalse: [ selectedClass := aClass theMetaClass ] ].\x0a\x09\x09self selectedProtocol: nil.\x0a\x09\x09self announcer announce: (HLClassSelected on: self selectedClass) ]",
  792. messageSends: ["ifTrue:", "and:", "isNil", "=", "selectedClass", "withChangesDo:", "selectedProtocol:", "ifNil:ifNotNil:", "selectedPackage:", "package", "theNonMetaClass", "ifTrue:ifFalse:", "theMetaClass", "showInstance", "announce:", "on:", "announcer"],
  793. referencedClasses: ["HLClassSelected"]
  794. }),
  795. smalltalk.HLToolModel);
  796. smalltalk.addMethod(
  797. smalltalk.method({
  798. selector: "selectedMethod",
  799. category: 'accessing',
  800. fn: function (){
  801. var self=this;
  802. return smalltalk.withContext(function($ctx1) {
  803. var $2,$1;
  804. $2=_st(self)._selectedClass();
  805. if(($receiver = $2) == nil || $receiver == undefined){
  806. $1=$2;
  807. } else {
  808. $1=_st(_st(_st(self)._selectedClass())._methodDictionary())._at_ifAbsent_(self["@selectedSelector"],(function(){
  809. return smalltalk.withContext(function($ctx2) {
  810. return nil;
  811. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  812. };
  813. return $1;
  814. }, function($ctx1) {$ctx1.fill(self,"selectedMethod",{},smalltalk.HLToolModel)})},
  815. args: [],
  816. source: "selectedMethod\x0a\x09^ self selectedClass ifNotNil: [ \x0a\x09\x09self selectedClass methodDictionary \x0a\x09\x09\x09at: selectedSelector \x0a\x09\x09\x09ifAbsent: [ nil ] ]",
  817. messageSends: ["ifNotNil:", "at:ifAbsent:", "methodDictionary", "selectedClass"],
  818. referencedClasses: []
  819. }),
  820. smalltalk.HLToolModel);
  821. smalltalk.addMethod(
  822. smalltalk.method({
  823. selector: "selectedMethod:",
  824. category: 'accessing',
  825. fn: function (aCompiledMethod){
  826. var self=this;
  827. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  828. return smalltalk.withContext(function($ctx1) {
  829. var $1,$2,$3;
  830. $1=_st(self["@selectedSelector"]).__eq(aCompiledMethod);
  831. if(smalltalk.assert($1)){
  832. $2=self;
  833. return $2;
  834. };
  835. _st(self)._withChangesDo_((function(){
  836. return smalltalk.withContext(function($ctx2) {
  837. $3=aCompiledMethod;
  838. if(($receiver = $3) == nil || $receiver == undefined){
  839. self["@selectedSelector"]=nil;
  840. self["@selectedSelector"];
  841. } else {
  842. self["@selectedClass"]=_st(aCompiledMethod)._methodClass();
  843. self["@selectedClass"];
  844. self["@selectedSelector"]=_st(aCompiledMethod)._selector();
  845. self["@selectedSelector"];
  846. };
  847. return _st(_st(self)._announcer())._announce_(_st($HLMethodSelected())._on_(aCompiledMethod));
  848. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  849. return self}, function($ctx1) {$ctx1.fill(self,"selectedMethod:",{aCompiledMethod:aCompiledMethod},smalltalk.HLToolModel)})},
  850. args: ["aCompiledMethod"],
  851. source: "selectedMethod: aCompiledMethod\x0a\x09selectedSelector = aCompiledMethod ifTrue: [ ^ self ].\x0a \x0a self withChangesDo: [\x0a\x09\x09aCompiledMethod\x0a \x09\x09ifNil: [ selectedSelector := nil ]\x0a \x09\x09ifNotNil: [\x0a\x09\x09\x09\x09selectedClass := aCompiledMethod methodClass.\x0a\x09\x09\x09\x09selectedSelector := aCompiledMethod selector ].\x0a\x0a\x09\x09self announcer announce: (HLMethodSelected on: aCompiledMethod) ]",
  852. messageSends: ["ifTrue:", "=", "withChangesDo:", "ifNil:ifNotNil:", "methodClass", "selector", "announce:", "on:", "announcer"],
  853. referencedClasses: ["HLMethodSelected"]
  854. }),
  855. smalltalk.HLToolModel);
  856. smalltalk.addMethod(
  857. smalltalk.method({
  858. selector: "selectedPackage",
  859. category: 'accessing',
  860. fn: function (){
  861. var self=this;
  862. return smalltalk.withContext(function($ctx1) {
  863. var $1;
  864. $1=self["@selectedPackage"];
  865. return $1;
  866. }, function($ctx1) {$ctx1.fill(self,"selectedPackage",{},smalltalk.HLToolModel)})},
  867. args: [],
  868. source: "selectedPackage\x0a\x09^ selectedPackage",
  869. messageSends: [],
  870. referencedClasses: []
  871. }),
  872. smalltalk.HLToolModel);
  873. smalltalk.addMethod(
  874. smalltalk.method({
  875. selector: "selectedPackage:",
  876. category: 'accessing',
  877. fn: function (aPackage){
  878. var self=this;
  879. function $HLPackageSelected(){return smalltalk.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  880. return smalltalk.withContext(function($ctx1) {
  881. var $1,$2;
  882. $1=_st(self["@selectedPackage"]).__eq(aPackage);
  883. if(smalltalk.assert($1)){
  884. $2=self;
  885. return $2;
  886. };
  887. _st(self)._withChangesDo_((function(){
  888. return smalltalk.withContext(function($ctx2) {
  889. self["@selectedPackage"]=aPackage;
  890. self["@selectedPackage"];
  891. _st(self)._selectedClass_(nil);
  892. return _st(_st(self)._announcer())._announce_(_st($HLPackageSelected())._on_(aPackage));
  893. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  894. return self}, function($ctx1) {$ctx1.fill(self,"selectedPackage:",{aPackage:aPackage},smalltalk.HLToolModel)})},
  895. args: ["aPackage"],
  896. source: "selectedPackage: aPackage\x0a\x09selectedPackage = aPackage ifTrue: [ ^ self ].\x0a \x0a\x09self withChangesDo: [\x0a\x09\x09selectedPackage := aPackage.\x0a\x09\x09self selectedClass: nil.\x0a\x09\x09self announcer announce: (HLPackageSelected on: aPackage) ]",
  897. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedClass:", "announce:", "on:", "announcer"],
  898. referencedClasses: ["HLPackageSelected"]
  899. }),
  900. smalltalk.HLToolModel);
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "selectedProtocol",
  904. category: 'accessing',
  905. fn: function (){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) {
  908. var $1;
  909. $1=self["@selectedProtocol"];
  910. return $1;
  911. }, function($ctx1) {$ctx1.fill(self,"selectedProtocol",{},smalltalk.HLToolModel)})},
  912. args: [],
  913. source: "selectedProtocol\x0a\x09^ selectedProtocol",
  914. messageSends: [],
  915. referencedClasses: []
  916. }),
  917. smalltalk.HLToolModel);
  918. smalltalk.addMethod(
  919. smalltalk.method({
  920. selector: "selectedProtocol:",
  921. category: 'accessing',
  922. fn: function (aString){
  923. var self=this;
  924. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  925. return smalltalk.withContext(function($ctx1) {
  926. var $1,$2;
  927. $1=_st(self["@selectedProtocol"]).__eq(aString);
  928. if(smalltalk.assert($1)){
  929. $2=self;
  930. return $2;
  931. };
  932. _st(self)._withChangesDo_((function(){
  933. return smalltalk.withContext(function($ctx2) {
  934. self["@selectedProtocol"]=aString;
  935. self["@selectedProtocol"];
  936. _st(self)._selectedMethod_(nil);
  937. return _st(_st(self)._announcer())._announce_(_st($HLProtocolSelected())._on_(aString));
  938. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  939. return self}, function($ctx1) {$ctx1.fill(self,"selectedProtocol:",{aString:aString},smalltalk.HLToolModel)})},
  940. args: ["aString"],
  941. source: "selectedProtocol: aString\x0a\x09selectedProtocol = aString ifTrue: [ ^ self ].\x0a\x0a\x09self withChangesDo: [\x0a\x09\x09selectedProtocol := aString.\x0a\x09\x09self selectedMethod: nil.\x0a\x09\x09self announcer announce: (HLProtocolSelected on: aString) ]",
  942. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedMethod:", "announce:", "on:", "announcer"],
  943. referencedClasses: ["HLProtocolSelected"]
  944. }),
  945. smalltalk.HLToolModel);
  946. smalltalk.addMethod(
  947. smalltalk.method({
  948. selector: "shouldCompileClassDefinition:",
  949. category: 'testing',
  950. fn: function (aString){
  951. var self=this;
  952. return smalltalk.withContext(function($ctx1) {
  953. var $1;
  954. $1=_st(_st(_st(self)._selectedClass())._isNil())._or_((function(){
  955. return smalltalk.withContext(function($ctx2) {
  956. return _st(_st(_st(aString)._first())._asUppercase()).__eq(_st(aString)._first());
  957. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  958. return $1;
  959. }, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition:",{aString:aString},smalltalk.HLToolModel)})},
  960. args: ["aString"],
  961. source: "shouldCompileClassDefinition: aString\x0a\x09^ self selectedClass isNil or: [\x0a\x09\x09aString first asUppercase = aString first ]",
  962. messageSends: ["or:", "=", "first", "asUppercase", "isNil", "selectedClass"],
  963. referencedClasses: []
  964. }),
  965. smalltalk.HLToolModel);
  966. smalltalk.addMethod(
  967. smalltalk.method({
  968. selector: "unclassifiedProtocol",
  969. category: 'defaults',
  970. fn: function (){
  971. var self=this;
  972. return smalltalk.withContext(function($ctx1) {
  973. return "as yet unclassified";
  974. }, function($ctx1) {$ctx1.fill(self,"unclassifiedProtocol",{},smalltalk.HLToolModel)})},
  975. args: [],
  976. source: "unclassifiedProtocol\x0a\x09^ 'as yet unclassified'",
  977. messageSends: [],
  978. referencedClasses: []
  979. }),
  980. smalltalk.HLToolModel);
  981. smalltalk.addMethod(
  982. smalltalk.method({
  983. selector: "withCompileErrorHandling:",
  984. category: 'error handling',
  985. fn: function (aBlock){
  986. var self=this;
  987. function $CompilerError(){return smalltalk.CompilerError||(typeof CompilerError=="undefined"?nil:CompilerError)}
  988. function $UnknownVariableError(){return smalltalk.UnknownVariableError||(typeof UnknownVariableError=="undefined"?nil:UnknownVariableError)}
  989. function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  990. return smalltalk.withContext(function($ctx1) {
  991. _st((function(){
  992. return smalltalk.withContext(function($ctx2) {
  993. return _st((function(){
  994. return smalltalk.withContext(function($ctx3) {
  995. return _st(aBlock)._on_do_($ParseError(),(function(ex){
  996. return smalltalk.withContext(function($ctx4) {
  997. return _st(self)._handleParseError_(ex);
  998. }, function($ctx4) {$ctx4.fillBlock({ex:ex},$ctx1)})}));
  999. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._on_do_($UnknownVariableError(),(function(ex){
  1000. return smalltalk.withContext(function($ctx3) {
  1001. return _st(self)._handleUnkownVariableError_(ex);
  1002. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx1)})}));
  1003. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($CompilerError(),(function(ex){
  1004. return smalltalk.withContext(function($ctx2) {
  1005. return _st(self)._handleCompileError_(ex);
  1006. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  1007. return self}, function($ctx1) {$ctx1.fill(self,"withCompileErrorHandling:",{aBlock:aBlock},smalltalk.HLToolModel)})},
  1008. args: ["aBlock"],
  1009. source: "withCompileErrorHandling: aBlock\x0a\x09[\x0a\x09\x09[\x0a\x09\x09\x09aBlock \x0a\x09\x09\x09\x09on: ParseError\x0a\x09\x09\x09\x09do: [:ex | self handleParseError: ex ]\x0a\x09\x09]\x0a\x09\x09\x09on: UnknownVariableError\x0a\x09\x09\x09do: [ :ex | self handleUnkownVariableError: ex ]\x0a\x09]\x0a\x09\x09on: CompilerError\x0a\x09\x09do: [ :ex | self handleCompileError: ex ]",
  1010. messageSends: ["on:do:", "handleCompileError:", "handleUnkownVariableError:", "handleParseError:"],
  1011. referencedClasses: ["CompilerError", "UnknownVariableError", "ParseError"]
  1012. }),
  1013. smalltalk.HLToolModel);
  1014. smalltalk.addMethod(
  1015. smalltalk.method({
  1016. selector: "withHelperLabelled:do:",
  1017. category: 'private',
  1018. fn: function (aString,aBlock){
  1019. var self=this;
  1020. return smalltalk.withContext(function($ctx1) {
  1021. var $1,$2;
  1022. _st(_st(window)._jQuery_("#helper"))._remove();
  1023. _st((function(html){
  1024. return smalltalk.withContext(function($ctx2) {
  1025. $1=_st(html)._div();
  1026. _st($1)._id_("helper");
  1027. $2=_st($1)._with_(aString);
  1028. return $2;
  1029. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st("body")._asJQuery());
  1030. _st((function(){
  1031. return smalltalk.withContext(function($ctx2) {
  1032. _st(aBlock)._value();
  1033. return _st(_st(window)._jQuery_("#helper"))._remove();
  1034. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((10));
  1035. return self}, function($ctx1) {$ctx1.fill(self,"withHelperLabelled:do:",{aString:aString,aBlock:aBlock},smalltalk.HLToolModel)})},
  1036. args: ["aString", "aBlock"],
  1037. source: "withHelperLabelled: aString do: aBlock\x0a\x09\x22TODO: doesn't belong here\x22\x0a\x0a\x09(window jQuery: '#helper') remove.\x0a\x0a\x09[ :html |\x0a\x09\x09html div \x0a\x09\x09\x09id: 'helper';\x0a\x09\x09\x09with: aString ] appendToJQuery: 'body' asJQuery.\x0a\x09\x0a\x09[\x0a\x09\x09aBlock value.\x0a\x09\x09(window jQuery: '#helper') remove\x0a\x09] \x0a\x09\x09valueWithTimeout: 10",
  1038. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery", "id:", "div", "with:", "valueWithTimeout:", "value"],
  1039. referencedClasses: []
  1040. }),
  1041. smalltalk.HLToolModel);
  1042. smalltalk.addMethod(
  1043. smalltalk.method({
  1044. selector: "on:",
  1045. category: 'actions',
  1046. fn: function (anEnvironment){
  1047. var self=this;
  1048. return smalltalk.withContext(function($ctx1) {
  1049. var $2,$3,$1;
  1050. $2=_st(self)._new();
  1051. _st($2)._environment_(anEnvironment);
  1052. $3=_st($2)._yourself();
  1053. $1=$3;
  1054. return $1;
  1055. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLToolModel.klass)})},
  1056. args: ["anEnvironment"],
  1057. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  1058. messageSends: ["environment:", "new", "yourself"],
  1059. referencedClasses: []
  1060. }),
  1061. smalltalk.HLToolModel.klass);
  1062. smalltalk.addClass('HLTab', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
  1063. smalltalk.addMethod(
  1064. smalltalk.method({
  1065. selector: "activate",
  1066. category: 'accessing',
  1067. fn: function (){
  1068. var self=this;
  1069. return smalltalk.withContext(function($ctx1) {
  1070. _st(_st(self)._manager())._activate_(self);
  1071. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTab)})},
  1072. args: [],
  1073. source: "activate\x0a\x09self manager activate: self",
  1074. messageSends: ["activate:", "manager"],
  1075. referencedClasses: []
  1076. }),
  1077. smalltalk.HLTab);
  1078. smalltalk.addMethod(
  1079. smalltalk.method({
  1080. selector: "add",
  1081. category: 'accessing',
  1082. fn: function (){
  1083. var self=this;
  1084. return smalltalk.withContext(function($ctx1) {
  1085. _st(_st(self)._manager())._addTab_(self);
  1086. return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTab)})},
  1087. args: [],
  1088. source: "add\x0a\x09self manager addTab: self",
  1089. messageSends: ["addTab:", "manager"],
  1090. referencedClasses: []
  1091. }),
  1092. smalltalk.HLTab);
  1093. smalltalk.addMethod(
  1094. smalltalk.method({
  1095. selector: "displayLabel",
  1096. category: 'accessing',
  1097. fn: function (){
  1098. var self=this;
  1099. return smalltalk.withContext(function($ctx1) {
  1100. var $2,$1;
  1101. $2=_st(_st(_st(self)._label())._size()).__gt((20));
  1102. if(smalltalk.assert($2)){
  1103. $1=_st(_st(_st(self)._label())._first_((20))).__comma("...");
  1104. } else {
  1105. $1=_st(self)._label();
  1106. };
  1107. return $1;
  1108. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLTab)})},
  1109. args: [],
  1110. source: "displayLabel\x0a\x09^ self label size > 20 \x0a\x09\x09ifTrue: [ (self label first: 20), '...' ]\x0a\x09\x09ifFalse: [ self label ]",
  1111. messageSends: ["ifTrue:ifFalse:", ",", "first:", "label", ">", "size"],
  1112. referencedClasses: []
  1113. }),
  1114. smalltalk.HLTab);
  1115. smalltalk.addMethod(
  1116. smalltalk.method({
  1117. selector: "focus",
  1118. category: 'accessing',
  1119. fn: function (){
  1120. var self=this;
  1121. return smalltalk.withContext(function($ctx1) {
  1122. var $1;
  1123. $1=_st(_st(self)._widget())._canHaveFocus();
  1124. if(smalltalk.assert($1)){
  1125. _st(_st(self)._widget())._focus();
  1126. };
  1127. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTab)})},
  1128. args: [],
  1129. source: "focus\x0a\x09self widget canHaveFocus ifTrue: [\x0a\x09\x09self widget focus ]",
  1130. messageSends: ["ifTrue:", "focus", "widget", "canHaveFocus"],
  1131. referencedClasses: []
  1132. }),
  1133. smalltalk.HLTab);
  1134. smalltalk.addMethod(
  1135. smalltalk.method({
  1136. selector: "hide",
  1137. category: 'actions',
  1138. fn: function (){
  1139. var self=this;
  1140. return smalltalk.withContext(function($ctx1) {
  1141. var $1;
  1142. $1=self["@root"];
  1143. if(($receiver = $1) == nil || $receiver == undefined){
  1144. $1;
  1145. } else {
  1146. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","hidden");
  1147. };
  1148. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTab)})},
  1149. args: [],
  1150. source: "hide\x0a\x09root ifNotNil: [ root asJQuery css: 'visibility' put: 'hidden' ]",
  1151. messageSends: ["ifNotNil:", "css:put:", "asJQuery"],
  1152. referencedClasses: []
  1153. }),
  1154. smalltalk.HLTab);
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "isActive",
  1158. category: 'testing',
  1159. fn: function (){
  1160. var self=this;
  1161. return smalltalk.withContext(function($ctx1) {
  1162. var $1;
  1163. $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
  1164. return $1;
  1165. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTab)})},
  1166. args: [],
  1167. source: "isActive\x0a\x09^ self manager activeTab = self",
  1168. messageSends: ["=", "activeTab", "manager"],
  1169. referencedClasses: []
  1170. }),
  1171. smalltalk.HLTab);
  1172. smalltalk.addMethod(
  1173. smalltalk.method({
  1174. selector: "label",
  1175. category: 'accessing',
  1176. fn: function (){
  1177. var self=this;
  1178. return smalltalk.withContext(function($ctx1) {
  1179. var $2,$1;
  1180. $2=self["@label"];
  1181. if(($receiver = $2) == nil || $receiver == undefined){
  1182. $1="";
  1183. } else {
  1184. $1=$2;
  1185. };
  1186. return $1;
  1187. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTab)})},
  1188. args: [],
  1189. source: "label\x0a\x09^ label ifNil: [ '' ]",
  1190. messageSends: ["ifNil:"],
  1191. referencedClasses: []
  1192. }),
  1193. smalltalk.HLTab);
  1194. smalltalk.addMethod(
  1195. smalltalk.method({
  1196. selector: "label:",
  1197. category: 'accessing',
  1198. fn: function (aString){
  1199. var self=this;
  1200. return smalltalk.withContext(function($ctx1) {
  1201. self["@label"]=aString;
  1202. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTab)})},
  1203. args: ["aString"],
  1204. source: "label: aString\x0a\x09label := aString",
  1205. messageSends: [],
  1206. referencedClasses: []
  1207. }),
  1208. smalltalk.HLTab);
  1209. smalltalk.addMethod(
  1210. smalltalk.method({
  1211. selector: "manager",
  1212. category: 'accessing',
  1213. fn: function (){
  1214. var self=this;
  1215. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1216. return smalltalk.withContext(function($ctx1) {
  1217. var $1;
  1218. $1=_st($HLManager())._current();
  1219. return $1;
  1220. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTab)})},
  1221. args: [],
  1222. source: "manager\x0a\x09^ HLManager current",
  1223. messageSends: ["current"],
  1224. referencedClasses: ["HLManager"]
  1225. }),
  1226. smalltalk.HLTab);
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "registerBindings",
  1230. category: 'actions',
  1231. fn: function (){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. _st(_st(self)._widget())._registerBindings();
  1235. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTab)})},
  1236. args: [],
  1237. source: "registerBindings\x0a\x09self widget registerBindings",
  1238. messageSends: ["registerBindings", "widget"],
  1239. referencedClasses: []
  1240. }),
  1241. smalltalk.HLTab);
  1242. smalltalk.addMethod(
  1243. smalltalk.method({
  1244. selector: "remove",
  1245. category: 'actions',
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. var $1;
  1250. _st(_st(self)._widget())._unregister();
  1251. $1=self["@root"];
  1252. if(($receiver = $1) == nil || $receiver == undefined){
  1253. $1;
  1254. } else {
  1255. _st(_st(self["@root"])._asJQuery())._remove();
  1256. };
  1257. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)})},
  1258. args: [],
  1259. source: "remove\x0a\x09self widget unregister.\x0a\x09root ifNotNil: [ root asJQuery remove ]",
  1260. messageSends: ["unregister", "widget", "ifNotNil:", "remove", "asJQuery"],
  1261. referencedClasses: []
  1262. }),
  1263. smalltalk.HLTab);
  1264. smalltalk.addMethod(
  1265. smalltalk.method({
  1266. selector: "renderOn:",
  1267. category: 'rendering',
  1268. fn: function (html){
  1269. var self=this;
  1270. return smalltalk.withContext(function($ctx1) {
  1271. var $1,$2;
  1272. $1=_st(html)._div();
  1273. _st($1)._class_("tab");
  1274. $2=_st($1)._yourself();
  1275. self["@root"]=$2;
  1276. _st(self)._renderTab();
  1277. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTab)})},
  1278. args: ["html"],
  1279. source: "renderOn: html\x0a\x09root := html div\x0a\x09\x09class: 'tab';\x0a\x09\x09yourself.\x0a\x09self renderTab",
  1280. messageSends: ["class:", "div", "yourself", "renderTab"],
  1281. referencedClasses: []
  1282. }),
  1283. smalltalk.HLTab);
  1284. smalltalk.addMethod(
  1285. smalltalk.method({
  1286. selector: "renderTab",
  1287. category: 'rendering',
  1288. fn: function (){
  1289. var self=this;
  1290. return smalltalk.withContext(function($ctx1) {
  1291. var $1,$2;
  1292. _st(self["@root"])._contents_((function(html){
  1293. return smalltalk.withContext(function($ctx2) {
  1294. $1=_st(html)._div();
  1295. _st($1)._class_("amber_box");
  1296. $2=_st($1)._with_((function(){
  1297. return smalltalk.withContext(function($ctx3) {
  1298. return _st(_st(self)._widget())._renderOn_(html);
  1299. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1300. return $2;
  1301. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  1302. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTab)})},
  1303. args: [],
  1304. source: "renderTab\x0a\x09root contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'amber_box';\x0a\x09\x09\x09with: [ self widget renderOn: html ] ]",
  1305. messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"],
  1306. referencedClasses: []
  1307. }),
  1308. smalltalk.HLTab);
  1309. smalltalk.addMethod(
  1310. smalltalk.method({
  1311. selector: "show",
  1312. category: 'actions',
  1313. fn: function (){
  1314. var self=this;
  1315. return smalltalk.withContext(function($ctx1) {
  1316. var $1;
  1317. $1=self["@root"];
  1318. if(($receiver = $1) == nil || $receiver == undefined){
  1319. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1320. } else {
  1321. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","visible");
  1322. };
  1323. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTab)})},
  1324. args: [],
  1325. source: "show\x0a\x09root\x0a\x09\x09ifNil: [ self appendToJQuery: 'body' asJQuery ]\x0a\x09\x09ifNotNil: [ root asJQuery css: 'visibility' put: 'visible' ]",
  1326. messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "css:put:"],
  1327. referencedClasses: []
  1328. }),
  1329. smalltalk.HLTab);
  1330. smalltalk.addMethod(
  1331. smalltalk.method({
  1332. selector: "widget",
  1333. category: 'accessing',
  1334. fn: function (){
  1335. var self=this;
  1336. return smalltalk.withContext(function($ctx1) {
  1337. var $1;
  1338. $1=self["@widget"];
  1339. return $1;
  1340. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTab)})},
  1341. args: [],
  1342. source: "widget\x0a\x09^ widget",
  1343. messageSends: [],
  1344. referencedClasses: []
  1345. }),
  1346. smalltalk.HLTab);
  1347. smalltalk.addMethod(
  1348. smalltalk.method({
  1349. selector: "widget:",
  1350. category: 'accessing',
  1351. fn: function (aWidget){
  1352. var self=this;
  1353. return smalltalk.withContext(function($ctx1) {
  1354. self["@widget"]=aWidget;
  1355. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTab)})},
  1356. args: ["aWidget"],
  1357. source: "widget: aWidget\x0a\x09widget := aWidget",
  1358. messageSends: [],
  1359. referencedClasses: []
  1360. }),
  1361. smalltalk.HLTab);
  1362. smalltalk.addMethod(
  1363. smalltalk.method({
  1364. selector: "on:labelled:",
  1365. category: 'instance creation',
  1366. fn: function (aWidget,aString){
  1367. var self=this;
  1368. return smalltalk.withContext(function($ctx1) {
  1369. var $2,$3,$1;
  1370. $2=_st(self)._new();
  1371. _st($2)._widget_(aWidget);
  1372. _st($2)._label_(aString);
  1373. $3=_st($2)._yourself();
  1374. $1=$3;
  1375. return $1;
  1376. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTab.klass)})},
  1377. args: ["aWidget", "aString"],
  1378. source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
  1379. messageSends: ["widget:", "new", "label:", "yourself"],
  1380. referencedClasses: []
  1381. }),
  1382. smalltalk.HLTab.klass);
  1383. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  1384. smalltalk.addMethod(
  1385. smalltalk.method({
  1386. selector: "alert:",
  1387. category: 'actions',
  1388. fn: function (aString){
  1389. var self=this;
  1390. return smalltalk.withContext(function($ctx1) {
  1391. _st(window)._alert_(aString);
  1392. return self}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.HLWidget)})},
  1393. args: ["aString"],
  1394. source: "alert: aString\x0a\x09window alert: aString",
  1395. messageSends: ["alert:"],
  1396. referencedClasses: []
  1397. }),
  1398. smalltalk.HLWidget);
  1399. smalltalk.addMethod(
  1400. smalltalk.method({
  1401. selector: "canHaveFocus",
  1402. category: 'testing',
  1403. fn: function (){
  1404. var self=this;
  1405. return smalltalk.withContext(function($ctx1) {
  1406. return false;
  1407. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWidget)})},
  1408. args: [],
  1409. source: "canHaveFocus\x0a\x09^ false",
  1410. messageSends: [],
  1411. referencedClasses: []
  1412. }),
  1413. smalltalk.HLWidget);
  1414. smalltalk.addMethod(
  1415. smalltalk.method({
  1416. selector: "confirm:ifTrue:",
  1417. category: 'actions',
  1418. fn: function (aString,aBlock){
  1419. var self=this;
  1420. return smalltalk.withContext(function($ctx1) {
  1421. _st(_st(self)._manager())._confirm_ifTrue_(aString,aBlock);
  1422. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  1423. args: ["aString", "aBlock"],
  1424. source: "confirm: aString ifTrue: aBlock\x0a\x09self manager confirm: aString ifTrue: aBlock",
  1425. messageSends: ["confirm:ifTrue:", "manager"],
  1426. referencedClasses: []
  1427. }),
  1428. smalltalk.HLWidget);
  1429. smalltalk.addMethod(
  1430. smalltalk.method({
  1431. selector: "execute:",
  1432. category: 'actions',
  1433. fn: function (aCommand){
  1434. var self=this;
  1435. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1436. return smalltalk.withContext(function($ctx1) {
  1437. var $1,$2;
  1438. $1=_st(_st($HLManager())._current())._keyBinder();
  1439. _st($1)._activate();
  1440. $2=_st($1)._applyBinding_(_st(aCommand)._asBinding());
  1441. return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aCommand:aCommand},smalltalk.HLWidget)})},
  1442. args: ["aCommand"],
  1443. source: "execute: aCommand\x0a\x09HLManager current keyBinder\x0a\x09\x09activate;\x0a\x09\x09applyBinding: aCommand asBinding",
  1444. messageSends: ["activate", "keyBinder", "current", "applyBinding:", "asBinding"],
  1445. referencedClasses: ["HLManager"]
  1446. }),
  1447. smalltalk.HLWidget);
  1448. smalltalk.addMethod(
  1449. smalltalk.method({
  1450. selector: "manager",
  1451. category: 'accessing',
  1452. fn: function (){
  1453. var self=this;
  1454. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1455. return smalltalk.withContext(function($ctx1) {
  1456. var $1;
  1457. $1=_st($HLManager())._current();
  1458. return $1;
  1459. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLWidget)})},
  1460. args: [],
  1461. source: "manager\x0a\x09^ HLManager current",
  1462. messageSends: ["current"],
  1463. referencedClasses: ["HLManager"]
  1464. }),
  1465. smalltalk.HLWidget);
  1466. smalltalk.addMethod(
  1467. smalltalk.method({
  1468. selector: "refresh",
  1469. category: 'updating',
  1470. fn: function (){
  1471. var self=this;
  1472. return smalltalk.withContext(function($ctx1) {
  1473. var $1,$2;
  1474. $1=_st(self)._wrapper();
  1475. if(($receiver = $1) == nil || $receiver == undefined){
  1476. $2=self;
  1477. return $2;
  1478. } else {
  1479. $1;
  1480. };
  1481. _st(_st(_st(self)._wrapper())._asJQuery())._empty();
  1482. _st((function(html){
  1483. return smalltalk.withContext(function($ctx2) {
  1484. return _st(self)._renderContentOn_(html);
  1485. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self)._wrapper())._asJQuery());
  1486. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLWidget)})},
  1487. args: [],
  1488. source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
  1489. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
  1490. referencedClasses: []
  1491. }),
  1492. smalltalk.HLWidget);
  1493. smalltalk.addMethod(
  1494. smalltalk.method({
  1495. selector: "registerBindings",
  1496. category: 'keybindings',
  1497. fn: function (){
  1498. var self=this;
  1499. return smalltalk.withContext(function($ctx1) {
  1500. _st(self)._registerBindingsOn_(_st(_st(_st(self)._manager())._keyBinder())._bindings());
  1501. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLWidget)})},
  1502. args: [],
  1503. source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
  1504. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
  1505. referencedClasses: []
  1506. }),
  1507. smalltalk.HLWidget);
  1508. smalltalk.addMethod(
  1509. smalltalk.method({
  1510. selector: "registerBindingsOn:",
  1511. category: 'keybindings',
  1512. fn: function (aBindingGroup){
  1513. var self=this;
  1514. return smalltalk.withContext(function($ctx1) {
  1515. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLWidget)})},
  1516. args: ["aBindingGroup"],
  1517. source: "registerBindingsOn: aBindingGroup",
  1518. messageSends: [],
  1519. referencedClasses: []
  1520. }),
  1521. smalltalk.HLWidget);
  1522. smalltalk.addMethod(
  1523. smalltalk.method({
  1524. selector: "renderContentOn:",
  1525. category: 'rendering',
  1526. fn: function (html){
  1527. var self=this;
  1528. return smalltalk.withContext(function($ctx1) {
  1529. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWidget)})},
  1530. args: ["html"],
  1531. source: "renderContentOn: html",
  1532. messageSends: [],
  1533. referencedClasses: []
  1534. }),
  1535. smalltalk.HLWidget);
  1536. smalltalk.addMethod(
  1537. smalltalk.method({
  1538. selector: "renderOn:",
  1539. category: 'rendering',
  1540. fn: function (html){
  1541. var self=this;
  1542. return smalltalk.withContext(function($ctx1) {
  1543. self["@wrapper"]=_st(html)._div();
  1544. _st((function(renderer){
  1545. return smalltalk.withContext(function($ctx2) {
  1546. return _st(self)._renderContentOn_(renderer);
  1547. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  1548. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLWidget)})},
  1549. args: ["html"],
  1550. source: "renderOn: html\x0a\x09wrapper := html div.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
  1551. messageSends: ["div", "appendToJQuery:", "asJQuery", "renderContentOn:"],
  1552. referencedClasses: []
  1553. }),
  1554. smalltalk.HLWidget);
  1555. smalltalk.addMethod(
  1556. smalltalk.method({
  1557. selector: "unregister",
  1558. category: 'actions',
  1559. fn: function (){
  1560. var self=this;
  1561. return smalltalk.withContext(function($ctx1) {
  1562. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWidget)})},
  1563. args: [],
  1564. source: "unregister\x0a\x09\x22This method is called whenever the receiver is closed (as a tab).\x0a\x09Widgets subscribing to announcements should unregister there\x22",
  1565. messageSends: [],
  1566. referencedClasses: []
  1567. }),
  1568. smalltalk.HLWidget);
  1569. smalltalk.addMethod(
  1570. smalltalk.method({
  1571. selector: "wrapper",
  1572. category: 'accessing',
  1573. fn: function (){
  1574. var self=this;
  1575. return smalltalk.withContext(function($ctx1) {
  1576. var $1;
  1577. $1=self["@wrapper"];
  1578. return $1;
  1579. }, function($ctx1) {$ctx1.fill(self,"wrapper",{},smalltalk.HLWidget)})},
  1580. args: [],
  1581. source: "wrapper\x0a\x09^ wrapper",
  1582. messageSends: [],
  1583. referencedClasses: []
  1584. }),
  1585. smalltalk.HLWidget);
  1586. smalltalk.addMethod(
  1587. smalltalk.method({
  1588. selector: "canBeOpenAsTab",
  1589. category: 'testing',
  1590. fn: function (){
  1591. var self=this;
  1592. return smalltalk.withContext(function($ctx1) {
  1593. return false;
  1594. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWidget.klass)})},
  1595. args: [],
  1596. source: "canBeOpenAsTab\x0a\x09^ false",
  1597. messageSends: [],
  1598. referencedClasses: []
  1599. }),
  1600. smalltalk.HLWidget.klass);
  1601. smalltalk.addMethod(
  1602. smalltalk.method({
  1603. selector: "openAsTab",
  1604. category: 'accessing',
  1605. fn: function (){
  1606. var self=this;
  1607. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  1608. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1609. return smalltalk.withContext(function($ctx1) {
  1610. var $1,$2;
  1611. $1=_st(self)._canBeOpenAsTab();
  1612. if(! smalltalk.assert($1)){
  1613. $2=self;
  1614. return $2;
  1615. };
  1616. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  1617. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},smalltalk.HLWidget.klass)})},
  1618. args: [],
  1619. source: "openAsTab\x0a\x09self canBeOpenAsTab ifFalse: [ ^ self ].\x0a\x09HLManager current addTab: (HLTab on: self new labelled: self tabLabel)",
  1620. messageSends: ["ifFalse:", "canBeOpenAsTab", "addTab:", "on:labelled:", "new", "tabLabel", "current"],
  1621. referencedClasses: ["HLTab", "HLManager"]
  1622. }),
  1623. smalltalk.HLWidget.klass);
  1624. smalltalk.addMethod(
  1625. smalltalk.method({
  1626. selector: "tabLabel",
  1627. category: 'accessing',
  1628. fn: function (){
  1629. var self=this;
  1630. return smalltalk.withContext(function($ctx1) {
  1631. return "Tab";
  1632. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWidget.klass)})},
  1633. args: [],
  1634. source: "tabLabel\x0a\x09^ 'Tab'",
  1635. messageSends: [],
  1636. referencedClasses: []
  1637. }),
  1638. smalltalk.HLWidget.klass);
  1639. smalltalk.addMethod(
  1640. smalltalk.method({
  1641. selector: "tabPriority",
  1642. category: 'accessing',
  1643. fn: function (){
  1644. var self=this;
  1645. return smalltalk.withContext(function($ctx1) {
  1646. var $1;
  1647. $1=(500);
  1648. return $1;
  1649. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWidget.klass)})},
  1650. args: [],
  1651. source: "tabPriority\x0a\x09^ 500",
  1652. messageSends: [],
  1653. referencedClasses: []
  1654. }),
  1655. smalltalk.HLWidget.klass);
  1656. smalltalk.addClass('HLConfirmation', smalltalk.HLWidget, ['confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
  1657. smalltalk.addMethod(
  1658. smalltalk.method({
  1659. selector: "actionBlock",
  1660. category: 'accessing',
  1661. fn: function (){
  1662. var self=this;
  1663. return smalltalk.withContext(function($ctx1) {
  1664. var $2,$1;
  1665. $2=self["@actionBlock"];
  1666. if(($receiver = $2) == nil || $receiver == undefined){
  1667. $1=(function(){
  1668. return smalltalk.withContext(function($ctx2) {
  1669. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1670. } else {
  1671. $1=$2;
  1672. };
  1673. return $1;
  1674. }, function($ctx1) {$ctx1.fill(self,"actionBlock",{},smalltalk.HLConfirmation)})},
  1675. args: [],
  1676. source: "actionBlock\x0a\x09^ actionBlock ifNil: [ [] ]",
  1677. messageSends: ["ifNil:"],
  1678. referencedClasses: []
  1679. }),
  1680. smalltalk.HLConfirmation);
  1681. smalltalk.addMethod(
  1682. smalltalk.method({
  1683. selector: "actionBlock:",
  1684. category: 'accessing',
  1685. fn: function (aBlock){
  1686. var self=this;
  1687. return smalltalk.withContext(function($ctx1) {
  1688. self["@actionBlock"]=aBlock;
  1689. return self}, function($ctx1) {$ctx1.fill(self,"actionBlock:",{aBlock:aBlock},smalltalk.HLConfirmation)})},
  1690. args: ["aBlock"],
  1691. source: "actionBlock: aBlock\x0a\x09actionBlock := aBlock",
  1692. messageSends: [],
  1693. referencedClasses: []
  1694. }),
  1695. smalltalk.HLConfirmation);
  1696. smalltalk.addMethod(
  1697. smalltalk.method({
  1698. selector: "cancel",
  1699. category: 'actions',
  1700. fn: function (){
  1701. var self=this;
  1702. return smalltalk.withContext(function($ctx1) {
  1703. _st(_st(self)._cancelBlock())._value();
  1704. _st(self)._remove();
  1705. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLConfirmation)})},
  1706. args: [],
  1707. source: "cancel\x0a\x09self cancelBlock value.\x0a\x09self remove",
  1708. messageSends: ["value", "cancelBlock", "remove"],
  1709. referencedClasses: []
  1710. }),
  1711. smalltalk.HLConfirmation);
  1712. smalltalk.addMethod(
  1713. smalltalk.method({
  1714. selector: "cancelBlock",
  1715. category: 'accessing',
  1716. fn: function (){
  1717. var self=this;
  1718. return smalltalk.withContext(function($ctx1) {
  1719. var $2,$1;
  1720. $2=self["@cancelBlock"];
  1721. if(($receiver = $2) == nil || $receiver == undefined){
  1722. $1=(function(){
  1723. return smalltalk.withContext(function($ctx2) {
  1724. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1725. } else {
  1726. $1=$2;
  1727. };
  1728. return $1;
  1729. }, function($ctx1) {$ctx1.fill(self,"cancelBlock",{},smalltalk.HLConfirmation)})},
  1730. args: [],
  1731. source: "cancelBlock\x0a\x09^ cancelBlock ifNil: [ [] ]",
  1732. messageSends: ["ifNil:"],
  1733. referencedClasses: []
  1734. }),
  1735. smalltalk.HLConfirmation);
  1736. smalltalk.addMethod(
  1737. smalltalk.method({
  1738. selector: "cancelBlock:",
  1739. category: 'accessing',
  1740. fn: function (aBlock){
  1741. var self=this;
  1742. return smalltalk.withContext(function($ctx1) {
  1743. self["@cancelBlock"]=aBlock;
  1744. return self}, function($ctx1) {$ctx1.fill(self,"cancelBlock:",{aBlock:aBlock},smalltalk.HLConfirmation)})},
  1745. args: ["aBlock"],
  1746. source: "cancelBlock: aBlock\x0a\x09cancelBlock := aBlock",
  1747. messageSends: [],
  1748. referencedClasses: []
  1749. }),
  1750. smalltalk.HLConfirmation);
  1751. smalltalk.addMethod(
  1752. smalltalk.method({
  1753. selector: "confirm",
  1754. category: 'actions',
  1755. fn: function (){
  1756. var self=this;
  1757. return smalltalk.withContext(function($ctx1) {
  1758. _st(_st(self)._actionBlock())._value();
  1759. _st(self)._remove();
  1760. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLConfirmation)})},
  1761. args: [],
  1762. source: "confirm\x0a\x09self actionBlock value.\x0a\x09self remove",
  1763. messageSends: ["value", "actionBlock", "remove"],
  1764. referencedClasses: []
  1765. }),
  1766. smalltalk.HLConfirmation);
  1767. smalltalk.addMethod(
  1768. smalltalk.method({
  1769. selector: "confirmationString",
  1770. category: 'accessing',
  1771. fn: function (){
  1772. var self=this;
  1773. return smalltalk.withContext(function($ctx1) {
  1774. var $2,$1;
  1775. $2=self["@confirmationString"];
  1776. if(($receiver = $2) == nil || $receiver == undefined){
  1777. $1="Confirm";
  1778. } else {
  1779. $1=$2;
  1780. };
  1781. return $1;
  1782. }, function($ctx1) {$ctx1.fill(self,"confirmationString",{},smalltalk.HLConfirmation)})},
  1783. args: [],
  1784. source: "confirmationString\x0a\x09^ confirmationString ifNil: [ 'Confirm' ]",
  1785. messageSends: ["ifNil:"],
  1786. referencedClasses: []
  1787. }),
  1788. smalltalk.HLConfirmation);
  1789. smalltalk.addMethod(
  1790. smalltalk.method({
  1791. selector: "confirmationString:",
  1792. category: 'accessing',
  1793. fn: function (aString){
  1794. var self=this;
  1795. return smalltalk.withContext(function($ctx1) {
  1796. self["@confirmationString"]=aString;
  1797. return self}, function($ctx1) {$ctx1.fill(self,"confirmationString:",{aString:aString},smalltalk.HLConfirmation)})},
  1798. args: ["aString"],
  1799. source: "confirmationString: aString\x0a\x09confirmationString := aString",
  1800. messageSends: [],
  1801. referencedClasses: []
  1802. }),
  1803. smalltalk.HLConfirmation);
  1804. smalltalk.addMethod(
  1805. smalltalk.method({
  1806. selector: "remove",
  1807. category: 'actions',
  1808. fn: function (){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx1) {
  1811. _st(_st(window)._jQuery_(".confirmation"))._removeClass_("active");
  1812. _st((function(){
  1813. return smalltalk.withContext(function($ctx2) {
  1814. _st(_st(window)._jQuery_("#overlay"))._remove();
  1815. return _st(_st(window)._jQuery_(".confirmation"))._remove();
  1816. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1817. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLConfirmation)})},
  1818. args: [],
  1819. source: "remove\x0a\x09(window jQuery: '.confirmation') removeClass: 'active'.\x0a\x09[ \x0a\x09\x09(window jQuery: '#overlay') remove.\x0a\x09\x09(window jQuery: '.confirmation') remove\x0a\x09] valueWithTimeout: 300",
  1820. messageSends: ["removeClass:", "jQuery:", "valueWithTimeout:", "remove"],
  1821. referencedClasses: []
  1822. }),
  1823. smalltalk.HLConfirmation);
  1824. smalltalk.addMethod(
  1825. smalltalk.method({
  1826. selector: "renderContentOn:",
  1827. category: 'rendering',
  1828. fn: function (html){
  1829. var self=this;
  1830. var confirmButton;
  1831. return smalltalk.withContext(function($ctx1) {
  1832. var $1,$3,$5,$6,$7,$8,$4,$2;
  1833. _st(_st(html)._div())._id_("overlay");
  1834. $1=_st(html)._div();
  1835. _st($1)._class_("confirmation");
  1836. $2=_st($1)._with_((function(){
  1837. return smalltalk.withContext(function($ctx2) {
  1838. _st(_st(html)._span())._with_(_st(self)._confirmationString());
  1839. $3=_st(html)._div();
  1840. _st($3)._class_("buttons");
  1841. $4=_st($3)._with_((function(){
  1842. return smalltalk.withContext(function($ctx3) {
  1843. $5=_st(html)._button();
  1844. _st($5)._class_("button");
  1845. _st($5)._with_("Cancel");
  1846. $6=_st($5)._onClick_((function(){
  1847. return smalltalk.withContext(function($ctx4) {
  1848. return _st(self)._cancel();
  1849. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1850. $6;
  1851. $7=_st(html)._button();
  1852. _st($7)._class_("button default");
  1853. _st($7)._with_("Confirm");
  1854. $8=_st($7)._onClick_((function(){
  1855. return smalltalk.withContext(function($ctx4) {
  1856. return _st(self)._confirm();
  1857. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  1858. confirmButton=$8;
  1859. return confirmButton;
  1860. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1861. return $4;
  1862. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1863. _st(_st(confirmButton)._asJQuery())._focus();
  1864. _st(_st(window)._jQuery_(".confirmation"))._addClass_("active");
  1865. _st(self)._setupKeyBindings();
  1866. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html,confirmButton:confirmButton},smalltalk.HLConfirmation)})},
  1867. args: ["html"],
  1868. source: "renderContentOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div id: 'overlay'.\x0a\x09html div \x0a\x09\x09class: 'confirmation';\x0a\x09\x09with: [\x0a\x09\x09\x09html span with: self confirmationString.\x0a\x09\x09\x09html div \x0a\x09\x09\x09\x09class: 'buttons';\x0a\x09\x09\x09\x09with: [\x0a\x09\x09\x09\x09\x09html button\x0a\x09\x09\x09\x09\x09\x09class: 'button';\x0a\x09\x09\x09\x09\x09\x09with: 'Cancel';\x0a\x09\x09\x09\x09\x09\x09onClick: [ self cancel ].\x0a\x09\x09\x09\x09\x09confirmButton := html button\x0a\x09\x09\x09\x09\x09\x09class: 'button default';\x0a\x09\x09\x09\x09\x09\x09with: 'Confirm';\x0a\x09\x09\x09\x09\x09\x09onClick: [ self confirm ] ] ].\x0a\x0a\x09confirmButton asJQuery focus.\x0a\x09(window jQuery: '.confirmation') addClass: 'active'.\x0a\x09self setupKeyBindings",
  1869. messageSends: ["id:", "div", "class:", "with:", "confirmationString", "span", "button", "onClick:", "cancel", "confirm", "focus", "asJQuery", "addClass:", "jQuery:", "setupKeyBindings"],
  1870. referencedClasses: []
  1871. }),
  1872. smalltalk.HLConfirmation);
  1873. smalltalk.addMethod(
  1874. smalltalk.method({
  1875. selector: "setupKeyBindings",
  1876. category: 'rendering',
  1877. fn: function (){
  1878. var self=this;
  1879. return smalltalk.withContext(function($ctx1) {
  1880. var $1;
  1881. _st(_st(window)._jQuery_(".confirmation"))._keyup_((function(e){
  1882. return smalltalk.withContext(function($ctx2) {
  1883. $1=_st(_st(e)._keyCode()).__eq((27));
  1884. if(smalltalk.assert($1)){
  1885. return _st(self)._cancel();
  1886. };
  1887. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  1888. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLConfirmation)})},
  1889. args: [],
  1890. source: "setupKeyBindings\x0a\x09(window jQuery: '.confirmation') keyup: [ :e |\x0a\x09\x09e keyCode = 27 ifTrue: [ self cancel ] ]",
  1891. messageSends: ["keyup:", "ifTrue:", "cancel", "=", "keyCode", "jQuery:"],
  1892. referencedClasses: []
  1893. }),
  1894. smalltalk.HLConfirmation);
  1895. smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
  1896. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, [], 'Helios-Core');
  1897. smalltalk.addMethod(
  1898. smalltalk.method({
  1899. selector: "blur",
  1900. category: 'events',
  1901. fn: function (){
  1902. var self=this;
  1903. return smalltalk.withContext(function($ctx1) {
  1904. _st(_st(_st(self)._wrapper())._asJQuery())._blur();
  1905. return self}, function($ctx1) {$ctx1.fill(self,"blur",{},smalltalk.HLFocusableWidget)})},
  1906. args: [],
  1907. source: "blur\x0a\x09self wrapper asJQuery blur",
  1908. messageSends: ["blur", "asJQuery", "wrapper"],
  1909. referencedClasses: []
  1910. }),
  1911. smalltalk.HLFocusableWidget);
  1912. smalltalk.addMethod(
  1913. smalltalk.method({
  1914. selector: "canHaveFocus",
  1915. category: 'testing',
  1916. fn: function (){
  1917. var self=this;
  1918. return smalltalk.withContext(function($ctx1) {
  1919. return true;
  1920. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLFocusableWidget)})},
  1921. args: [],
  1922. source: "canHaveFocus\x0a\x09^ true",
  1923. messageSends: [],
  1924. referencedClasses: []
  1925. }),
  1926. smalltalk.HLFocusableWidget);
  1927. smalltalk.addMethod(
  1928. smalltalk.method({
  1929. selector: "focus",
  1930. category: 'events',
  1931. fn: function (){
  1932. var self=this;
  1933. return smalltalk.withContext(function($ctx1) {
  1934. _st(_st(_st(self)._wrapper())._asJQuery())._focus();
  1935. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLFocusableWidget)})},
  1936. args: [],
  1937. source: "focus\x0a\x09self wrapper asJQuery focus",
  1938. messageSends: ["focus", "asJQuery", "wrapper"],
  1939. referencedClasses: []
  1940. }),
  1941. smalltalk.HLFocusableWidget);
  1942. smalltalk.addMethod(
  1943. smalltalk.method({
  1944. selector: "focusClass",
  1945. category: 'accessing',
  1946. fn: function (){
  1947. var self=this;
  1948. return smalltalk.withContext(function($ctx1) {
  1949. return "focused";
  1950. }, function($ctx1) {$ctx1.fill(self,"focusClass",{},smalltalk.HLFocusableWidget)})},
  1951. args: [],
  1952. source: "focusClass\x0a\x09^ 'focused'",
  1953. messageSends: [],
  1954. referencedClasses: []
  1955. }),
  1956. smalltalk.HLFocusableWidget);
  1957. smalltalk.addMethod(
  1958. smalltalk.method({
  1959. selector: "hasFocus",
  1960. category: 'events',
  1961. fn: function (){
  1962. var self=this;
  1963. return smalltalk.withContext(function($ctx1) {
  1964. var $1;
  1965. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  1966. return smalltalk.withContext(function($ctx2) {
  1967. return _st(_st(_st(self)._wrapper())._asJQuery())._is_(":focus");
  1968. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1969. return $1;
  1970. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLFocusableWidget)})},
  1971. args: [],
  1972. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery is: ':focus' ]",
  1973. messageSends: ["and:", "is:", "asJQuery", "wrapper", "notNil"],
  1974. referencedClasses: []
  1975. }),
  1976. smalltalk.HLFocusableWidget);
  1977. smalltalk.addMethod(
  1978. smalltalk.method({
  1979. selector: "renderContentOn:",
  1980. category: 'rendering',
  1981. fn: function (html){
  1982. var self=this;
  1983. return smalltalk.withContext(function($ctx1) {
  1984. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLFocusableWidget)})},
  1985. args: ["html"],
  1986. source: "renderContentOn: html",
  1987. messageSends: [],
  1988. referencedClasses: []
  1989. }),
  1990. smalltalk.HLFocusableWidget);
  1991. smalltalk.addMethod(
  1992. smalltalk.method({
  1993. selector: "renderOn:",
  1994. category: 'rendering',
  1995. fn: function (html){
  1996. var self=this;
  1997. return smalltalk.withContext(function($ctx1) {
  1998. var $1,$2,$3,$4;
  1999. _st(self)._registerBindings();
  2000. $1=_st(html)._div();
  2001. _st($1)._class_("hl_widget");
  2002. $2=_st($1)._yourself();
  2003. self["@wrapper"]=$2;
  2004. _st(self["@wrapper"])._with_((function(){
  2005. return smalltalk.withContext(function($ctx2) {
  2006. return _st(self)._renderContentOn_(html);
  2007. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2008. $3=self["@wrapper"];
  2009. _st($3)._at_put_("tabindex","0");
  2010. _st($3)._onBlur_((function(){
  2011. return smalltalk.withContext(function($ctx2) {
  2012. return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  2013. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2014. $4=_st($3)._onFocus_((function(){
  2015. return smalltalk.withContext(function($ctx2) {
  2016. return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  2017. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2018. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLFocusableWidget)})},
  2019. args: ["html"],
  2020. source: "renderOn: html\x0a\x09self registerBindings.\x0a \x0a wrapper := html div \x0a \x09class: 'hl_widget';\x0a\x09\x09yourself.\x0a\x09\x09\x0a wrapper with: [ self renderContentOn: html ].\x0a\x09\x0a\x09wrapper\x0a\x09\x09at: 'tabindex' put: '0';\x0a\x09\x09onBlur: [ self wrapper asJQuery removeClass: self focusClass ];\x0a onFocus: [ self wrapper asJQuery addClass: self focusClass ]",
  2021. messageSends: ["registerBindings", "class:", "div", "yourself", "with:", "renderContentOn:", "at:put:", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"],
  2022. referencedClasses: []
  2023. }),
  2024. smalltalk.HLFocusableWidget);
  2025. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem', 'mapping'], 'Helios-Core');
  2026. smalltalk.addMethod(
  2027. smalltalk.method({
  2028. selector: "activateFirstListItem",
  2029. category: 'actions',
  2030. fn: function (){
  2031. var self=this;
  2032. return smalltalk.withContext(function($ctx1) {
  2033. _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li.inactive"))._get_((0))));
  2034. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{},smalltalk.HLListWidget)})},
  2035. args: [],
  2036. source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li.inactive') get: 0))",
  2037. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
  2038. referencedClasses: []
  2039. }),
  2040. smalltalk.HLListWidget);
  2041. smalltalk.addMethod(
  2042. smalltalk.method({
  2043. selector: "activateItem:",
  2044. category: 'actions',
  2045. fn: function (anObject){
  2046. var self=this;
  2047. return smalltalk.withContext(function($ctx1) {
  2048. var $1;
  2049. var $early={};
  2050. try {
  2051. _st(self)._activateListItem_(_st(_st(self["@mapping"])._at_ifAbsent_(anObject,(function(){
  2052. return smalltalk.withContext(function($ctx2) {
  2053. $1=self;
  2054. throw $early=[$1];
  2055. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  2056. return self}
  2057. catch(e) {if(e===$early)return e[0]; throw e}
  2058. }, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2059. args: ["anObject"],
  2060. source: "activateItem: anObject\x0a\x09self activateListItem: (mapping \x0a\x09\x09at: anObject\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  2061. messageSends: ["activateListItem:", "asJQuery", "at:ifAbsent:"],
  2062. referencedClasses: []
  2063. }),
  2064. smalltalk.HLListWidget);
  2065. smalltalk.addMethod(
  2066. smalltalk.method({
  2067. selector: "activateListItem:",
  2068. category: 'actions',
  2069. fn: function (aListItem){
  2070. var self=this;
  2071. var item;
  2072. return smalltalk.withContext(function($ctx1) {
  2073. var $1,$2,$3;
  2074. $1=_st(aListItem)._get_((0));
  2075. if(($receiver = $1) == nil || $receiver == undefined){
  2076. $2=self;
  2077. return $2;
  2078. } else {
  2079. $1;
  2080. };
  2081. _st(_st(_st(aListItem)._parent())._children())._removeClass_("active");
  2082. _st(aListItem)._addClass_("active");
  2083. _st(self)._ensureVisible_(aListItem);
  2084. item=_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber());
  2085. $3=_st(_st(self)._selectedItem()).__eq_eq(item);
  2086. if(! smalltalk.assert($3)){
  2087. _st(self)._selectItem_(item);
  2088. };
  2089. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.HLListWidget)})},
  2090. args: ["aListItem"],
  2091. source: "activateListItem: aListItem\x0a\x09| item |\x0a \x0a\x09(aListItem get: 0) ifNil: [ ^self ].\x0a\x09aListItem parent children removeClass: 'active'.\x0a\x09aListItem addClass: 'active'.\x0a \x0a\x09self ensureVisible: aListItem.\x0a \x0a \x22Activate the corresponding item\x22\x0a item := (self items at: (aListItem attr: 'list-data') asNumber).\x0a self selectedItem == item ifFalse: [\x0a\x09 self selectItem: item ]",
  2092. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "addClass:", "ensureVisible:", "at:", "asNumber", "attr:", "items", "ifFalse:", "selectItem:", "==", "selectedItem"],
  2093. referencedClasses: []
  2094. }),
  2095. smalltalk.HLListWidget);
  2096. smalltalk.addMethod(
  2097. smalltalk.method({
  2098. selector: "activateNextListItem",
  2099. category: 'actions',
  2100. fn: function (){
  2101. var self=this;
  2102. return smalltalk.withContext(function($ctx1) {
  2103. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._next());
  2104. _st(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._get())._ifEmpty_((function(){
  2105. return smalltalk.withContext(function($ctx2) {
  2106. return _st(self)._activateFirstListItem();
  2107. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2108. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)})},
  2109. args: [],
  2110. source: "activateNextListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') next.\x0a\x09\x0a\x09\x22select the first item if none is selected\x22\x0a\x09(window jQuery: '.focused .nav-pills .active') get ifEmpty: [\x0a\x09\x09self activateFirstListItem ]",
  2111. messageSends: ["activateListItem:", "next", "jQuery:", "ifEmpty:", "activateFirstListItem", "get"],
  2112. referencedClasses: []
  2113. }),
  2114. smalltalk.HLListWidget);
  2115. smalltalk.addMethod(
  2116. smalltalk.method({
  2117. selector: "activatePreviousListItem",
  2118. category: 'actions',
  2119. fn: function (){
  2120. var self=this;
  2121. return smalltalk.withContext(function($ctx1) {
  2122. _st(self)._activateListItem_(_st(_st(window)._jQuery_(".focused .nav-pills .active"))._prev());
  2123. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)})},
  2124. args: [],
  2125. source: "activatePreviousListItem\x0a\x09self activateListItem: (window jQuery: '.focused .nav-pills .active') prev",
  2126. messageSends: ["activateListItem:", "prev", "jQuery:"],
  2127. referencedClasses: []
  2128. }),
  2129. smalltalk.HLListWidget);
  2130. smalltalk.addMethod(
  2131. smalltalk.method({
  2132. selector: "cssClassForItem:",
  2133. category: 'accessing',
  2134. fn: function (anObject){
  2135. var self=this;
  2136. return smalltalk.withContext(function($ctx1) {
  2137. var $2,$1;
  2138. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  2139. if(smalltalk.assert($2)){
  2140. $1="active";
  2141. } else {
  2142. $1="inactive";
  2143. };
  2144. return $1;
  2145. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2146. args: ["anObject"],
  2147. source: "cssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09\x09ifFalse: [ 'inactive' ]",
  2148. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  2149. referencedClasses: []
  2150. }),
  2151. smalltalk.HLListWidget);
  2152. smalltalk.addMethod(
  2153. smalltalk.method({
  2154. selector: "defaultItems",
  2155. category: 'defaults',
  2156. fn: function (){
  2157. var self=this;
  2158. return smalltalk.withContext(function($ctx1) {
  2159. var $1;
  2160. $1=[];
  2161. return $1;
  2162. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLListWidget)})},
  2163. args: [],
  2164. source: "defaultItems\x0a\x09^ #()",
  2165. messageSends: [],
  2166. referencedClasses: []
  2167. }),
  2168. smalltalk.HLListWidget);
  2169. smalltalk.addMethod(
  2170. smalltalk.method({
  2171. selector: "ensureVisible:",
  2172. category: 'actions',
  2173. fn: function (aListItem){
  2174. var self=this;
  2175. var perent,position;
  2176. return smalltalk.withContext(function($ctx1) {
  2177. var $1,$2;
  2178. position=_st(self)._positionOf_(aListItem);
  2179. parent=_st(aListItem)._parent();
  2180. $1=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  2181. if(smalltalk.assert($1)){
  2182. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  2183. };
  2184. $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  2185. if(smalltalk.assert($2)){
  2186. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(aListItem)._height())).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()))).__plus((10)));
  2187. };
  2188. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
  2189. args: ["aListItem"],
  2190. source: "ensureVisible: aListItem\x09\x0a\x09\x22Move the scrollbar to show the active element\x22\x0a\x09\x0a\x09| perent position |\x0a\x09\x0a\x09position := self positionOf: aListItem.\x0a\x09parent := aListItem parent.\x0a\x09\x0a aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ]",
  2191. messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"],
  2192. referencedClasses: []
  2193. }),
  2194. smalltalk.HLListWidget);
  2195. smalltalk.addMethod(
  2196. smalltalk.method({
  2197. selector: "focus",
  2198. category: 'actions',
  2199. fn: function (){
  2200. var self=this;
  2201. return smalltalk.withContext(function($ctx1) {
  2202. var $1,$2;
  2203. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  2204. $1=_st(_st(self)._items())._isEmpty();
  2205. if(! smalltalk.assert($1)){
  2206. $2=_st(self)._selectedItem();
  2207. if(($receiver = $2) == nil || $receiver == undefined){
  2208. _st(self)._activateFirstListItem();
  2209. } else {
  2210. $2;
  2211. };
  2212. };
  2213. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLListWidget)})},
  2214. args: [],
  2215. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  2216. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  2217. referencedClasses: []
  2218. }),
  2219. smalltalk.HLListWidget);
  2220. smalltalk.addMethod(
  2221. smalltalk.method({
  2222. selector: "iconForItem:",
  2223. category: 'accessing',
  2224. fn: function (anObject){
  2225. var self=this;
  2226. return smalltalk.withContext(function($ctx1) {
  2227. return "";
  2228. }, function($ctx1) {$ctx1.fill(self,"iconForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2229. args: ["anObject"],
  2230. source: "iconForItem: anObject\x0a\x09^ ''",
  2231. messageSends: [],
  2232. referencedClasses: []
  2233. }),
  2234. smalltalk.HLListWidget);
  2235. smalltalk.addMethod(
  2236. smalltalk.method({
  2237. selector: "initialize",
  2238. category: 'initialization',
  2239. fn: function (){
  2240. var self=this;
  2241. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2242. return smalltalk.withContext(function($ctx1) {
  2243. smalltalk.HLFocusableWidget.fn.prototype._initialize.apply(_st(self), []);
  2244. self["@mapping"]=_st($Dictionary())._new();
  2245. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)})},
  2246. args: [],
  2247. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09mapping := Dictionary new.",
  2248. messageSends: ["initialize", "new"],
  2249. referencedClasses: ["Dictionary"]
  2250. }),
  2251. smalltalk.HLListWidget);
  2252. smalltalk.addMethod(
  2253. smalltalk.method({
  2254. selector: "items",
  2255. category: 'accessing',
  2256. fn: function (){
  2257. var self=this;
  2258. return smalltalk.withContext(function($ctx1) {
  2259. var $2,$1;
  2260. $2=self["@items"];
  2261. if(($receiver = $2) == nil || $receiver == undefined){
  2262. self["@items"]=_st(self)._defaultItems();
  2263. $1=self["@items"];
  2264. } else {
  2265. $1=$2;
  2266. };
  2267. return $1;
  2268. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLListWidget)})},
  2269. args: [],
  2270. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  2271. messageSends: ["ifNil:", "defaultItems"],
  2272. referencedClasses: []
  2273. }),
  2274. smalltalk.HLListWidget);
  2275. smalltalk.addMethod(
  2276. smalltalk.method({
  2277. selector: "items:",
  2278. category: 'accessing',
  2279. fn: function (aCollection){
  2280. var self=this;
  2281. return smalltalk.withContext(function($ctx1) {
  2282. self["@items"]=aCollection;
  2283. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection},smalltalk.HLListWidget)})},
  2284. args: ["aCollection"],
  2285. source: "items: aCollection\x0a\x09items := aCollection",
  2286. messageSends: [],
  2287. referencedClasses: []
  2288. }),
  2289. smalltalk.HLListWidget);
  2290. smalltalk.addMethod(
  2291. smalltalk.method({
  2292. selector: "positionOf:",
  2293. category: 'accessing',
  2294. fn: function (aListItem){
  2295. var self=this;
  2296. return smalltalk.withContext(function($ctx1) {
  2297. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  2298. ;
  2299. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.HLListWidget)})},
  2300. args: ["aListItem"],
  2301. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  2302. messageSends: [],
  2303. referencedClasses: []
  2304. }),
  2305. smalltalk.HLListWidget);
  2306. smalltalk.addMethod(
  2307. smalltalk.method({
  2308. selector: "refresh",
  2309. category: 'actions',
  2310. fn: function (){
  2311. var self=this;
  2312. return smalltalk.withContext(function($ctx1) {
  2313. var $1;
  2314. var $early={};
  2315. try {
  2316. smalltalk.HLFocusableWidget.fn.prototype._refresh.apply(_st(self), []);
  2317. _st(self)._ensureVisible_(_st(_st(self["@mapping"])._at_ifAbsent_(_st(self)._selectedItem(),(function(){
  2318. return smalltalk.withContext(function($ctx2) {
  2319. $1=self;
  2320. throw $early=[$1];
  2321. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  2322. return self}
  2323. catch(e) {if(e===$early)return e[0]; throw e}
  2324. }, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLListWidget)})},
  2325. args: [],
  2326. source: "refresh\x0a\x09super refresh.\x0a\x09\x0a\x09self ensureVisible: (mapping \x0a\x09\x09at: self selectedItem\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  2327. messageSends: ["refresh", "ensureVisible:", "asJQuery", "at:ifAbsent:", "selectedItem"],
  2328. referencedClasses: []
  2329. }),
  2330. smalltalk.HLListWidget);
  2331. smalltalk.addMethod(
  2332. smalltalk.method({
  2333. selector: "registerMappingFrom:to:",
  2334. category: 'private',
  2335. fn: function (anObject,aTag){
  2336. var self=this;
  2337. return smalltalk.withContext(function($ctx1) {
  2338. _st(self["@mapping"])._at_put_(anObject,aTag);
  2339. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)})},
  2340. args: ["anObject", "aTag"],
  2341. source: "registerMappingFrom: anObject to: aTag\x0a\x09mapping at: anObject put: aTag",
  2342. messageSends: ["at:put:"],
  2343. referencedClasses: []
  2344. }),
  2345. smalltalk.HLListWidget);
  2346. smalltalk.addMethod(
  2347. smalltalk.method({
  2348. selector: "renderButtonsOn:",
  2349. category: 'rendering',
  2350. fn: function (html){
  2351. var self=this;
  2352. return smalltalk.withContext(function($ctx1) {
  2353. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLListWidget)})},
  2354. args: ["html"],
  2355. source: "renderButtonsOn: html",
  2356. messageSends: [],
  2357. referencedClasses: []
  2358. }),
  2359. smalltalk.HLListWidget);
  2360. smalltalk.addMethod(
  2361. smalltalk.method({
  2362. selector: "renderContentOn:",
  2363. category: 'rendering',
  2364. fn: function (html){
  2365. var self=this;
  2366. return smalltalk.withContext(function($ctx1) {
  2367. var $1,$2,$3,$4;
  2368. $1=_st(html)._ul();
  2369. _st($1)._class_("nav nav-pills nav-stacked");
  2370. $2=_st($1)._with_((function(){
  2371. return smalltalk.withContext(function($ctx2) {
  2372. return _st(self)._renderListOn_(html);
  2373. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2374. $3=_st(html)._div();
  2375. _st($3)._class_("pane_actions form-actions");
  2376. $4=_st($3)._with_((function(){
  2377. return smalltalk.withContext(function($ctx2) {
  2378. return _st(self)._renderButtonsOn_(html);
  2379. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2380. _st(self)._setupKeyBindings();
  2381. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLListWidget)})},
  2382. args: ["html"],
  2383. source: "renderContentOn: html\x0a\x09html ul \x0a \x09class: 'nav nav-pills nav-stacked';\x0a with: [ self renderListOn: html ].\x0a html div class: 'pane_actions form-actions'; with: [\x0a \x09self renderButtonsOn: html ].\x0a \x0a self setupKeyBindings",
  2384. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  2385. referencedClasses: []
  2386. }),
  2387. smalltalk.HLListWidget);
  2388. smalltalk.addMethod(
  2389. smalltalk.method({
  2390. selector: "renderItem:on:",
  2391. category: 'rendering',
  2392. fn: function (anObject,html){
  2393. var self=this;
  2394. var li;
  2395. return smalltalk.withContext(function($ctx1) {
  2396. var $1,$3,$4,$2;
  2397. li=_st(html)._li();
  2398. _st(self)._registerMappingFrom_to_(anObject,li);
  2399. $1=li;
  2400. _st($1)._class_(_st(self)._cssClassForItem_(anObject));
  2401. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  2402. $2=_st($1)._with_((function(){
  2403. return smalltalk.withContext(function($ctx2) {
  2404. $3=_st(html)._a();
  2405. _st($3)._with_((function(){
  2406. return smalltalk.withContext(function($ctx3) {
  2407. _st(_st(html)._tag_("i"))._class_(_st(self)._iconForItem_(anObject));
  2408. return _st(self)._renderItemLabel_on_(anObject,html);
  2409. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2410. $4=_st($3)._onClick_((function(){
  2411. return smalltalk.withContext(function($ctx3) {
  2412. return _st(self)._activateListItem_(_st(li)._asJQuery());
  2413. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2414. return $4;
  2415. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2416. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)})},
  2417. args: ["anObject", "html"],
  2418. source: "renderItem: anObject on: html\x0a\x09| li |\x0a \x0a\x09li := html li.\x0a\x09self registerMappingFrom: anObject to: li.\x0a\x09\x0a li\x0a \x09class: (self cssClassForItem: anObject);\x0a at: 'list-data' put: (self items indexOf: anObject) asString;\x0a with: [ \x0a \x09html a\x0a \x09with: [ \x0a \x09\x09(html tag: 'i') class: (self iconForItem: anObject).\x0a \x09\x09\x09\x09\x09self renderItemLabel: anObject on: html ];\x0a\x09\x09\x09\x09onClick: [\x0a \x09self activateListItem: li asJQuery ] ]",
  2419. messageSends: ["li", "registerMappingFrom:to:", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  2420. referencedClasses: []
  2421. }),
  2422. smalltalk.HLListWidget);
  2423. smalltalk.addMethod(
  2424. smalltalk.method({
  2425. selector: "renderItemLabel:on:",
  2426. category: 'rendering',
  2427. fn: function (anObject,html){
  2428. var self=this;
  2429. return smalltalk.withContext(function($ctx1) {
  2430. _st(html)._with_(_st(anObject)._asString());
  2431. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},smalltalk.HLListWidget)})},
  2432. args: ["anObject", "html"],
  2433. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  2434. messageSends: ["with:", "asString"],
  2435. referencedClasses: []
  2436. }),
  2437. smalltalk.HLListWidget);
  2438. smalltalk.addMethod(
  2439. smalltalk.method({
  2440. selector: "renderListOn:",
  2441. category: 'rendering',
  2442. fn: function (html){
  2443. var self=this;
  2444. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2445. return smalltalk.withContext(function($ctx1) {
  2446. self["@mapping"]=_st($Dictionary())._new();
  2447. _st(_st(self)._items())._do_((function(each){
  2448. return smalltalk.withContext(function($ctx2) {
  2449. return _st(self)._renderItem_on_(each,html);
  2450. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2451. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)})},
  2452. args: ["html"],
  2453. source: "renderListOn: html\x0a\x09mapping := Dictionary new.\x0a\x09\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  2454. messageSends: ["new", "do:", "renderItem:on:", "items"],
  2455. referencedClasses: ["Dictionary"]
  2456. }),
  2457. smalltalk.HLListWidget);
  2458. smalltalk.addMethod(
  2459. smalltalk.method({
  2460. selector: "selectItem:",
  2461. category: 'actions',
  2462. fn: function (anObject){
  2463. var self=this;
  2464. return smalltalk.withContext(function($ctx1) {
  2465. _st(self)._selectedItem_(anObject);
  2466. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2467. args: ["anObject"],
  2468. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  2469. messageSends: ["selectedItem:"],
  2470. referencedClasses: []
  2471. }),
  2472. smalltalk.HLListWidget);
  2473. smalltalk.addMethod(
  2474. smalltalk.method({
  2475. selector: "selectedItem",
  2476. category: 'accessing',
  2477. fn: function (){
  2478. var self=this;
  2479. return smalltalk.withContext(function($ctx1) {
  2480. var $1;
  2481. $1=self["@selectedItem"];
  2482. return $1;
  2483. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLListWidget)})},
  2484. args: [],
  2485. source: "selectedItem\x0a\x09^ selectedItem",
  2486. messageSends: [],
  2487. referencedClasses: []
  2488. }),
  2489. smalltalk.HLListWidget);
  2490. smalltalk.addMethod(
  2491. smalltalk.method({
  2492. selector: "selectedItem:",
  2493. category: 'accessing',
  2494. fn: function (anObject){
  2495. var self=this;
  2496. return smalltalk.withContext(function($ctx1) {
  2497. self["@selectedItem"]=anObject;
  2498. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2499. args: ["anObject"],
  2500. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  2501. messageSends: [],
  2502. referencedClasses: []
  2503. }),
  2504. smalltalk.HLListWidget);
  2505. smalltalk.addMethod(
  2506. smalltalk.method({
  2507. selector: "setupKeyBindings",
  2508. category: 'events',
  2509. fn: function (){
  2510. var self=this;
  2511. var active,interval,delay,repeatInterval;
  2512. return smalltalk.withContext(function($ctx1) {
  2513. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11;
  2514. active=false;
  2515. repeatInterval=(70);
  2516. _st(_st(_st(self)._wrapper())._asJQuery())._unbind_("keydown");
  2517. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  2518. return smalltalk.withContext(function($ctx2) {
  2519. $1=_st(_st(_st(e)._which()).__eq((38)))._and_((function(){
  2520. return smalltalk.withContext(function($ctx3) {
  2521. return _st(active).__eq(false);
  2522. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2523. if(smalltalk.assert($1)){
  2524. active=true;
  2525. active;
  2526. _st(self)._activatePreviousListItem();
  2527. delay=_st((function(){
  2528. return smalltalk.withContext(function($ctx3) {
  2529. interval=_st((function(){
  2530. return smalltalk.withContext(function($ctx4) {
  2531. $2=_st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  2532. if(smalltalk.assert($2)){
  2533. return _st(self)._activatePreviousListItem();
  2534. } else {
  2535. active=false;
  2536. active;
  2537. $3=interval;
  2538. if(($receiver = $3) == nil || $receiver == undefined){
  2539. $3;
  2540. } else {
  2541. _st(interval)._clearInterval();
  2542. };
  2543. $4=delay;
  2544. if(($receiver = $4) == nil || $receiver == undefined){
  2545. return $4;
  2546. } else {
  2547. return _st(delay)._clearTimeout();
  2548. };
  2549. };
  2550. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  2551. return interval;
  2552. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  2553. delay;
  2554. };
  2555. $5=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
  2556. return smalltalk.withContext(function($ctx3) {
  2557. return _st(active).__eq(false);
  2558. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2559. if(smalltalk.assert($5)){
  2560. active=true;
  2561. active;
  2562. _st(self)._activateNextListItem();
  2563. delay=_st((function(){
  2564. return smalltalk.withContext(function($ctx3) {
  2565. interval=_st((function(){
  2566. return smalltalk.withContext(function($ctx4) {
  2567. $6=_st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  2568. if(smalltalk.assert($6)){
  2569. return _st(self)._activateNextListItem();
  2570. } else {
  2571. active=false;
  2572. active;
  2573. $7=interval;
  2574. if(($receiver = $7) == nil || $receiver == undefined){
  2575. $7;
  2576. } else {
  2577. _st(interval)._clearInterval();
  2578. };
  2579. $8=delay;
  2580. if(($receiver = $8) == nil || $receiver == undefined){
  2581. return $8;
  2582. } else {
  2583. return _st(delay)._clearTimeout();
  2584. };
  2585. };
  2586. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  2587. return interval;
  2588. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  2589. return delay;
  2590. };
  2591. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  2592. _st(_st(_st(self)._wrapper())._asJQuery())._keyup_((function(e){
  2593. return smalltalk.withContext(function($ctx2) {
  2594. $9=active;
  2595. if(smalltalk.assert($9)){
  2596. active=false;
  2597. active;
  2598. $10=interval;
  2599. if(($receiver = $10) == nil || $receiver == undefined){
  2600. $10;
  2601. } else {
  2602. _st(interval)._clearInterval();
  2603. };
  2604. $11=delay;
  2605. if(($receiver = $11) == nil || $receiver == undefined){
  2606. return $11;
  2607. } else {
  2608. return _st(delay)._clearTimeout();
  2609. };
  2610. };
  2611. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  2612. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,interval:interval,delay:delay,repeatInterval:repeatInterval},smalltalk.HLListWidget)})},
  2613. args: [],
  2614. source: "setupKeyBindings\x0a\x09\x22TODO: refactor this!\x22\x0a\x09\x0a\x09| active interval delay repeatInterval |\x0a\x09\x0a\x09active := false.\x0a\x09repeatInterval := 70.\x0a\x09self wrapper asJQuery unbind: 'keydown'.\x0a\x0a\x09self wrapper asJQuery keydown: [ :e |\x0a\x09\x09\x0a (e which = 38 and: [ active = false ]) ifTrue: [ \x0a\x09\x09\x09active := true.\x0a\x09\x09\x09self activatePreviousListItem.\x0a \x09delay := [\x0a\x09\x09\x09\x09interval := [\x0a\x09\x09\x09\x09\x09(self wrapper asJQuery hasClass: self focusClass)\x0a\x09\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09\x09self activatePreviousListItem ]\x0a\x09\x09\x09\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09\x09\x09\x09active := false.\x0a\x09\x09\x09\x09\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09\x09\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ]\x0a\x09\x09\x09\x09\x09\x09valueWithTimeout: 300 ].\x0a\x09\x09\x09\x0a \x09(e which = 40 and: [ active = false ]) ifTrue: [\x0a active := true.\x0a\x09\x09\x09self activateNextListItem.\x0a \x09delay := [\x0a\x09\x09\x09\x09interval := [ \x0a\x09\x09\x09\x09\x09(self wrapper asJQuery hasClass: self focusClass)\x0a\x09\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09\x09self activateNextListItem ]\x0a\x09\x09\x09\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09\x09\x09\x09active := false.\x0a\x09\x09\x09\x09\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09\x09\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ]\x0a\x09\x09\x09\x09\x09\x09valueWithTimeout: 300 ] ].\x0a\x09\x0a\x09self wrapper asJQuery keyup: [ :e |\x0a\x09\x09active ifTrue: [\x0a\x09\x09\x09active := false.\x0a\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]",
  2615. messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "ifTrue:ifFalse:", "ifNotNil:", "clearInterval", "clearTimeout", "hasClass:", "focusClass", "and:", "=", "which", "activateNextListItem", "keyup:"],
  2616. referencedClasses: []
  2617. }),
  2618. smalltalk.HLListWidget);
  2619. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  2620. smalltalk.addMethod(
  2621. smalltalk.method({
  2622. selector: "next",
  2623. category: 'accessing',
  2624. fn: function (){
  2625. var self=this;
  2626. return smalltalk.withContext(function($ctx1) {
  2627. var $1;
  2628. $1=self["@next"];
  2629. return $1;
  2630. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.HLNavigationListWidget)})},
  2631. args: [],
  2632. source: "next\x0a\x09^ next",
  2633. messageSends: [],
  2634. referencedClasses: []
  2635. }),
  2636. smalltalk.HLNavigationListWidget);
  2637. smalltalk.addMethod(
  2638. smalltalk.method({
  2639. selector: "next:",
  2640. category: 'accessing',
  2641. fn: function (aWidget){
  2642. var self=this;
  2643. return smalltalk.withContext(function($ctx1) {
  2644. var $1;
  2645. self["@next"]=aWidget;
  2646. $1=_st(_st(aWidget)._previous()).__eq(self);
  2647. if(! smalltalk.assert($1)){
  2648. _st(aWidget)._previous_(self);
  2649. };
  2650. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  2651. args: ["aWidget"],
  2652. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  2653. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  2654. referencedClasses: []
  2655. }),
  2656. smalltalk.HLNavigationListWidget);
  2657. smalltalk.addMethod(
  2658. smalltalk.method({
  2659. selector: "nextFocus",
  2660. category: 'actions',
  2661. fn: function (){
  2662. var self=this;
  2663. return smalltalk.withContext(function($ctx1) {
  2664. var $1;
  2665. $1=_st(self)._next();
  2666. if(($receiver = $1) == nil || $receiver == undefined){
  2667. $1;
  2668. } else {
  2669. _st(_st(self)._next())._focus();
  2670. };
  2671. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},smalltalk.HLNavigationListWidget)})},
  2672. args: [],
  2673. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  2674. messageSends: ["ifNotNil:", "focus", "next"],
  2675. referencedClasses: []
  2676. }),
  2677. smalltalk.HLNavigationListWidget);
  2678. smalltalk.addMethod(
  2679. smalltalk.method({
  2680. selector: "previous",
  2681. category: 'accessing',
  2682. fn: function (){
  2683. var self=this;
  2684. return smalltalk.withContext(function($ctx1) {
  2685. var $1;
  2686. $1=self["@previous"];
  2687. return $1;
  2688. }, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationListWidget)})},
  2689. args: [],
  2690. source: "previous\x0a\x09^ previous",
  2691. messageSends: [],
  2692. referencedClasses: []
  2693. }),
  2694. smalltalk.HLNavigationListWidget);
  2695. smalltalk.addMethod(
  2696. smalltalk.method({
  2697. selector: "previous:",
  2698. category: 'accessing',
  2699. fn: function (aWidget){
  2700. var self=this;
  2701. return smalltalk.withContext(function($ctx1) {
  2702. var $1;
  2703. self["@previous"]=aWidget;
  2704. $1=_st(_st(aWidget)._next()).__eq(self);
  2705. if(! smalltalk.assert($1)){
  2706. _st(aWidget)._next_(self);
  2707. };
  2708. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  2709. args: ["aWidget"],
  2710. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  2711. messageSends: ["ifFalse:", "next:", "=", "next"],
  2712. referencedClasses: []
  2713. }),
  2714. smalltalk.HLNavigationListWidget);
  2715. smalltalk.addMethod(
  2716. smalltalk.method({
  2717. selector: "previousFocus",
  2718. category: 'actions',
  2719. fn: function (){
  2720. var self=this;
  2721. return smalltalk.withContext(function($ctx1) {
  2722. var $1;
  2723. $1=_st(self)._previous();
  2724. if(($receiver = $1) == nil || $receiver == undefined){
  2725. $1;
  2726. } else {
  2727. _st(_st(self)._previous())._focus();
  2728. };
  2729. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},smalltalk.HLNavigationListWidget)})},
  2730. args: [],
  2731. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  2732. messageSends: ["ifNotNil:", "focus", "previous"],
  2733. referencedClasses: []
  2734. }),
  2735. smalltalk.HLNavigationListWidget);
  2736. smalltalk.addMethod(
  2737. smalltalk.method({
  2738. selector: "setupKeyBindings",
  2739. category: 'events',
  2740. fn: function (){
  2741. var self=this;
  2742. return smalltalk.withContext(function($ctx1) {
  2743. var $1,$2;
  2744. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  2745. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  2746. return smalltalk.withContext(function($ctx2) {
  2747. $1=_st(_st(e)._which()).__eq((39));
  2748. if(smalltalk.assert($1)){
  2749. _st(self)._nextFocus();
  2750. };
  2751. $2=_st(_st(e)._which()).__eq((37));
  2752. if(smalltalk.assert($2)){
  2753. return _st(self)._previousFocus();
  2754. };
  2755. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  2756. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLNavigationListWidget)})},
  2757. args: [],
  2758. source: "setupKeyBindings\x0a\x09super setupKeyBindings.\x0a\x0a\x09self wrapper asJQuery keydown: [ :e |\x0a e which = 39 ifTrue: [ \x0a \x09self nextFocus ].\x0a\x09\x09e which = 37 ifTrue: [ \x0a \x09self previousFocus ] ]",
  2759. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery", "wrapper"],
  2760. referencedClasses: []
  2761. }),
  2762. smalltalk.HLNavigationListWidget);
  2763. smalltalk.addClass('HLToolListWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Core');
  2764. smalltalk.addMethod(
  2765. smalltalk.method({
  2766. selector: "activateListItem:",
  2767. category: 'actions',
  2768. fn: function (anItem){
  2769. var self=this;
  2770. return smalltalk.withContext(function($ctx1) {
  2771. _st(_st(self)._model())._withChangesDo_((function(){
  2772. return smalltalk.withContext(function($ctx2) {
  2773. return smalltalk.HLNavigationListWidget.fn.prototype._activateListItem_.apply(_st(self), [anItem]);
  2774. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2775. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{anItem:anItem},smalltalk.HLToolListWidget)})},
  2776. args: ["anItem"],
  2777. source: "activateListItem: anItem\x0a\x09self model withChangesDo: [ super activateListItem: anItem ]",
  2778. messageSends: ["withChangesDo:", "activateListItem:", "model"],
  2779. referencedClasses: []
  2780. }),
  2781. smalltalk.HLToolListWidget);
  2782. smalltalk.addMethod(
  2783. smalltalk.method({
  2784. selector: "activateNextListItem",
  2785. category: 'actions',
  2786. fn: function (){
  2787. var self=this;
  2788. return smalltalk.withContext(function($ctx1) {
  2789. _st(_st(self)._model())._withChangesDo_((function(){
  2790. return smalltalk.withContext(function($ctx2) {
  2791. return smalltalk.HLNavigationListWidget.fn.prototype._activateNextListItem.apply(_st(self), []);
  2792. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2793. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLToolListWidget)})},
  2794. args: [],
  2795. source: "activateNextListItem\x0a\x09self model withChangesDo: [ super activateNextListItem ]",
  2796. messageSends: ["withChangesDo:", "activateNextListItem", "model"],
  2797. referencedClasses: []
  2798. }),
  2799. smalltalk.HLToolListWidget);
  2800. smalltalk.addMethod(
  2801. smalltalk.method({
  2802. selector: "activatePreviousListItem",
  2803. category: 'actions',
  2804. fn: function (){
  2805. var self=this;
  2806. return smalltalk.withContext(function($ctx1) {
  2807. _st(_st(self)._model())._withChangesDo_((function(){
  2808. return smalltalk.withContext(function($ctx2) {
  2809. return smalltalk.HLNavigationListWidget.fn.prototype._activatePreviousListItem.apply(_st(self), []);
  2810. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2811. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLToolListWidget)})},
  2812. args: [],
  2813. source: "activatePreviousListItem\x0a\x09self model withChangesDo: [ super activatePreviousListItem ]",
  2814. messageSends: ["withChangesDo:", "activatePreviousListItem", "model"],
  2815. referencedClasses: []
  2816. }),
  2817. smalltalk.HLToolListWidget);
  2818. smalltalk.addMethod(
  2819. smalltalk.method({
  2820. selector: "commandCategory",
  2821. category: 'accessing',
  2822. fn: function (){
  2823. var self=this;
  2824. return smalltalk.withContext(function($ctx1) {
  2825. var $1;
  2826. $1=_st(self)._label();
  2827. return $1;
  2828. }, function($ctx1) {$ctx1.fill(self,"commandCategory",{},smalltalk.HLToolListWidget)})},
  2829. args: [],
  2830. source: "commandCategory\x0a\x09^ self label",
  2831. messageSends: ["label"],
  2832. referencedClasses: []
  2833. }),
  2834. smalltalk.HLToolListWidget);
  2835. smalltalk.addMethod(
  2836. smalltalk.method({
  2837. selector: "label",
  2838. category: 'accessing',
  2839. fn: function (){
  2840. var self=this;
  2841. return smalltalk.withContext(function($ctx1) {
  2842. return "List";
  2843. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToolListWidget)})},
  2844. args: [],
  2845. source: "label\x0a\x09^ 'List'",
  2846. messageSends: [],
  2847. referencedClasses: []
  2848. }),
  2849. smalltalk.HLToolListWidget);
  2850. smalltalk.addMethod(
  2851. smalltalk.method({
  2852. selector: "menuCommands",
  2853. category: 'accessing',
  2854. fn: function (){
  2855. var self=this;
  2856. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  2857. return smalltalk.withContext(function($ctx1) {
  2858. var $1;
  2859. $1=_st(_st(_st(_st($HLToolCommand())._concreteClasses())._select_((function(each){
  2860. return smalltalk.withContext(function($ctx2) {
  2861. return _st(each)._isValidFor_(_st(self)._model());
  2862. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
  2863. return smalltalk.withContext(function($ctx2) {
  2864. return _st(each)._for_(_st(self)._model());
  2865. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._select_((function(each){
  2866. return smalltalk.withContext(function($ctx2) {
  2867. return _st(_st(_st(each)._category()).__eq(_st(self)._commandCategory()))._and_((function(){
  2868. return smalltalk.withContext(function($ctx3) {
  2869. return _st(_st(each)._isAction())._and_((function(){
  2870. return smalltalk.withContext(function($ctx4) {
  2871. return _st(each)._isActive();
  2872. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  2873. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2874. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2875. return $1;
  2876. }, function($ctx1) {$ctx1.fill(self,"menuCommands",{},smalltalk.HLToolListWidget)})},
  2877. args: [],
  2878. source: "menuCommands\x0a\x09\x22Answer a collection of commands to be put in the cog menu\x22\x0a\x09\x0a\x09^ ((HLToolCommand concreteClasses\x0a\x09\x09select: [ :each | each isValidFor: self model ])\x0a\x09\x09\x09collect: [ :each | each for: self model ])\x0a\x09\x09\x09select: [ :each | \x0a\x09\x09\x09\x09each category = self commandCategory and: [ \x0a\x09\x09\x09\x09\x09each isAction and: [ each isActive ] ] ]",
  2879. messageSends: ["select:", "and:", "isActive", "isAction", "=", "commandCategory", "category", "collect:", "for:", "model", "isValidFor:", "concreteClasses"],
  2880. referencedClasses: ["HLToolCommand"]
  2881. }),
  2882. smalltalk.HLToolListWidget);
  2883. smalltalk.addMethod(
  2884. smalltalk.method({
  2885. selector: "model",
  2886. category: 'accessing',
  2887. fn: function (){
  2888. var self=this;
  2889. return smalltalk.withContext(function($ctx1) {
  2890. var $1;
  2891. $1=self["@model"];
  2892. return $1;
  2893. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLToolListWidget)})},
  2894. args: [],
  2895. source: "model\x0a\x09^ model",
  2896. messageSends: [],
  2897. referencedClasses: []
  2898. }),
  2899. smalltalk.HLToolListWidget);
  2900. smalltalk.addMethod(
  2901. smalltalk.method({
  2902. selector: "model:",
  2903. category: 'accessing',
  2904. fn: function (aBrowserModel){
  2905. var self=this;
  2906. return smalltalk.withContext(function($ctx1) {
  2907. var $1,$2;
  2908. self["@model"]=aBrowserModel;
  2909. $1=self;
  2910. _st($1)._observeSystem();
  2911. $2=_st($1)._observeModel();
  2912. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aBrowserModel:aBrowserModel},smalltalk.HLToolListWidget)})},
  2913. args: ["aBrowserModel"],
  2914. source: "model: aBrowserModel\x0a\x09model := aBrowserModel.\x0a \x0a self \x0a\x09\x09observeSystem;\x0a\x09\x09observeModel",
  2915. messageSends: ["observeSystem", "observeModel"],
  2916. referencedClasses: []
  2917. }),
  2918. smalltalk.HLToolListWidget);
  2919. smalltalk.addMethod(
  2920. smalltalk.method({
  2921. selector: "observeModel",
  2922. category: 'actions',
  2923. fn: function (){
  2924. var self=this;
  2925. return smalltalk.withContext(function($ctx1) {
  2926. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLToolListWidget)})},
  2927. args: [],
  2928. source: "observeModel",
  2929. messageSends: [],
  2930. referencedClasses: []
  2931. }),
  2932. smalltalk.HLToolListWidget);
  2933. smalltalk.addMethod(
  2934. smalltalk.method({
  2935. selector: "observeSystem",
  2936. category: 'actions',
  2937. fn: function (){
  2938. var self=this;
  2939. return smalltalk.withContext(function($ctx1) {
  2940. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLToolListWidget)})},
  2941. args: [],
  2942. source: "observeSystem",
  2943. messageSends: [],
  2944. referencedClasses: []
  2945. }),
  2946. smalltalk.HLToolListWidget);
  2947. smalltalk.addMethod(
  2948. smalltalk.method({
  2949. selector: "renderContentOn:",
  2950. category: 'rendering',
  2951. fn: function (html){
  2952. var self=this;
  2953. return smalltalk.withContext(function($ctx1) {
  2954. _st(self)._renderHeadOn_(html);
  2955. smalltalk.HLNavigationListWidget.fn.prototype._renderContentOn_.apply(_st(self), [html]);
  2956. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLToolListWidget)})},
  2957. args: ["html"],
  2958. source: "renderContentOn: html\x0a\x09self renderHeadOn: html.\x09\x0a\x09super renderContentOn: html",
  2959. messageSends: ["renderHeadOn:", "renderContentOn:"],
  2960. referencedClasses: []
  2961. }),
  2962. smalltalk.HLToolListWidget);
  2963. smalltalk.addMethod(
  2964. smalltalk.method({
  2965. selector: "renderHeadOn:",
  2966. category: 'rendering',
  2967. fn: function (html){
  2968. var self=this;
  2969. return smalltalk.withContext(function($ctx1) {
  2970. var $1,$2;
  2971. $1=_st(html)._div();
  2972. _st($1)._class_("list-label");
  2973. $2=_st($1)._with_((function(){
  2974. return smalltalk.withContext(function($ctx2) {
  2975. _st(html)._with_(_st(self)._label());
  2976. return _st(self)._renderMenuOn_(html);
  2977. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2978. return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},smalltalk.HLToolListWidget)})},
  2979. args: ["html"],
  2980. source: "renderHeadOn: html\x0a\x09html div \x0a\x09\x09class: 'list-label';\x0a\x09\x09with: [\x0a\x09\x09\x09html with: self label.\x0a\x09\x09\x09self renderMenuOn: html ]",
  2981. messageSends: ["class:", "div", "with:", "label", "renderMenuOn:"],
  2982. referencedClasses: []
  2983. }),
  2984. smalltalk.HLToolListWidget);
  2985. smalltalk.addMethod(
  2986. smalltalk.method({
  2987. selector: "renderMenuOn:",
  2988. category: 'rendering',
  2989. fn: function (html){
  2990. var self=this;
  2991. var commands;
  2992. return smalltalk.withContext(function($ctx1) {
  2993. var $1,$2,$3,$5,$6,$7,$9,$10,$8,$4;
  2994. commands=_st(self)._menuCommands();
  2995. $1=_st(commands)._isEmpty();
  2996. if(smalltalk.assert($1)){
  2997. $2=self;
  2998. return $2;
  2999. };
  3000. $3=_st(html)._div();
  3001. _st($3)._class_("btn-group cog");
  3002. $4=_st($3)._with_((function(){
  3003. return smalltalk.withContext(function($ctx2) {
  3004. $5=_st(html)._a();
  3005. _st($5)._class_("btn dropdown-toggle");
  3006. _st($5)._at_put_("data-toggle","dropdown");
  3007. $6=_st($5)._with_((function(){
  3008. return smalltalk.withContext(function($ctx3) {
  3009. return _st(_st(html)._tag_("i"))._class_("icon-cog");
  3010. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3011. $6;
  3012. $7=_st(html)._ul();
  3013. _st($7)._class_("dropdown-menu pull-right");
  3014. $8=_st($7)._with_((function(){
  3015. return smalltalk.withContext(function($ctx3) {
  3016. return _st(_st(self)._menuCommands())._do_((function(each){
  3017. return smalltalk.withContext(function($ctx4) {
  3018. return _st(_st(html)._li())._with_((function(){
  3019. return smalltalk.withContext(function($ctx5) {
  3020. $9=_st(html)._a();
  3021. _st($9)._with_(_st(each)._menuLabel());
  3022. $10=_st($9)._onClick_((function(){
  3023. return smalltalk.withContext(function($ctx6) {
  3024. return _st(self)._execute_(each);
  3025. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  3026. return $10;
  3027. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  3028. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  3029. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3030. return $8;
  3031. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3032. return self}, function($ctx1) {$ctx1.fill(self,"renderMenuOn:",{html:html,commands:commands},smalltalk.HLToolListWidget)})},
  3033. args: ["html"],
  3034. source: "renderMenuOn: html\x0a\x09| commands |\x0a\x09\x0a\x09commands := self menuCommands.\x0a\x09commands isEmpty ifTrue: [ ^ self ].\x0a\x09\x0a\x09html div \x0a\x09\x09class: 'btn-group cog';\x0a\x09\x09with: [\x0a\x09\x09\x09html a\x0a\x09\x09\x09\x09class: 'btn dropdown-toggle';\x0a\x09\x09\x09\x09at: 'data-toggle' put: 'dropdown';\x0a\x09\x09\x09\x09with: [ (html tag: 'i') class: 'icon-cog' ].\x0a\x09\x09html ul \x0a\x09\x09\x09class: 'dropdown-menu pull-right';\x0a\x09\x09\x09with: [ \x0a\x09\x09\x09\x09self menuCommands do: [ :each | \x0a\x09\x09\x09\x09\x09html li with: [ html a \x0a\x09\x09\x09\x09\x09\x09with: each menuLabel;\x0a\x09\x09\x09\x09\x09\x09onClick: [ self execute: each ] ] ] ] ]",
  3035. messageSends: ["menuCommands", "ifTrue:", "isEmpty", "class:", "div", "with:", "a", "at:put:", "tag:", "ul", "do:", "menuLabel", "onClick:", "execute:", "li"],
  3036. referencedClasses: []
  3037. }),
  3038. smalltalk.HLToolListWidget);
  3039. smalltalk.addMethod(
  3040. smalltalk.method({
  3041. selector: "selectedItem:",
  3042. category: 'accessing',
  3043. fn: function (anItem){
  3044. var self=this;
  3045. return smalltalk.withContext(function($ctx1) {
  3046. smalltalk.HLNavigationListWidget.fn.prototype._selectedItem_.apply(_st(self), [anItem]);
  3047. _st(self)._updateMenu();
  3048. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anItem:anItem},smalltalk.HLToolListWidget)})},
  3049. args: ["anItem"],
  3050. source: "selectedItem: anItem\x0a\x09\x22Selection changed, update the cog menu\x22\x0a\x09\x0a\x09super selectedItem: anItem.\x0a\x09self updateMenu",
  3051. messageSends: ["selectedItem:", "updateMenu"],
  3052. referencedClasses: []
  3053. }),
  3054. smalltalk.HLToolListWidget);
  3055. smalltalk.addMethod(
  3056. smalltalk.method({
  3057. selector: "unregister",
  3058. category: 'actions',
  3059. fn: function (){
  3060. var self=this;
  3061. return smalltalk.withContext(function($ctx1) {
  3062. smalltalk.HLNavigationListWidget.fn.prototype._unregister.apply(_st(self), []);
  3063. _st(_st(_st(self)._model())._announcer())._unsubscribe_(self);
  3064. _st(_st(_st(self)._model())._systemAnnouncer())._unsubscribe_(self);
  3065. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLToolListWidget)})},
  3066. args: [],
  3067. source: "unregister\x0a\x09super unregister.\x0a\x09\x0a\x09self model announcer unsubscribe: self.\x0a\x09self model systemAnnouncer unsubscribe: self",
  3068. messageSends: ["unregister", "unsubscribe:", "announcer", "model", "systemAnnouncer"],
  3069. referencedClasses: []
  3070. }),
  3071. smalltalk.HLToolListWidget);
  3072. smalltalk.addMethod(
  3073. smalltalk.method({
  3074. selector: "updateMenu",
  3075. category: 'updating',
  3076. fn: function (){
  3077. var self=this;
  3078. return smalltalk.withContext(function($ctx1) {
  3079. _st(_st(_st(_st(self)._wrapper())._asJQuery())._find_(".cog"))._remove();
  3080. _st((function(html){
  3081. return smalltalk.withContext(function($ctx2) {
  3082. return _st(self)._renderMenuOn_(html);
  3083. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(_st(self)._wrapper())._asJQuery())._find_(".list-label"));
  3084. return self}, function($ctx1) {$ctx1.fill(self,"updateMenu",{},smalltalk.HLToolListWidget)})},
  3085. args: [],
  3086. source: "updateMenu\x0a\x09(self wrapper asJQuery find: '.cog') remove.\x0a\x09\x0a\x09[ :html | self renderMenuOn: html ] \x0a\x09\x09appendToJQuery: (self wrapper asJQuery find: '.list-label')",
  3087. messageSends: ["remove", "find:", "asJQuery", "wrapper", "appendToJQuery:", "renderMenuOn:"],
  3088. referencedClasses: []
  3089. }),
  3090. smalltalk.HLToolListWidget);
  3091. smalltalk.addMethod(
  3092. smalltalk.method({
  3093. selector: "on:",
  3094. category: 'instance creation',
  3095. fn: function (aModel){
  3096. var self=this;
  3097. return smalltalk.withContext(function($ctx1) {
  3098. var $2,$3,$1;
  3099. $2=_st(self)._new();
  3100. _st($2)._model_(aModel);
  3101. $3=_st($2)._yourself();
  3102. $1=$3;
  3103. return $1;
  3104. }, function($ctx1) {$ctx1.fill(self,"on:",{aModel:aModel},smalltalk.HLToolListWidget.klass)})},
  3105. args: ["aModel"],
  3106. source: "on: aModel\x0a\x09^ self new \x0a \x09model: aModel;\x0a yourself",
  3107. messageSends: ["model:", "new", "yourself"],
  3108. referencedClasses: []
  3109. }),
  3110. smalltalk.HLToolListWidget.klass);
  3111. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  3112. smalltalk.addMethod(
  3113. smalltalk.method({
  3114. selector: "activate:",
  3115. category: 'actions',
  3116. fn: function (aTab){
  3117. var self=this;
  3118. return smalltalk.withContext(function($ctx1) {
  3119. var $1,$2;
  3120. _st(_st(self)._keyBinder())._flushBindings();
  3121. _st(aTab)._registerBindings();
  3122. self["@activeTab"]=aTab;
  3123. $1=self;
  3124. _st($1)._refresh();
  3125. _st($1)._addToHistory_(aTab);
  3126. $2=_st($1)._show_(aTab);
  3127. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  3128. args: ["aTab"],
  3129. source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09aTab registerBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
  3130. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  3131. referencedClasses: []
  3132. }),
  3133. smalltalk.HLManager);
  3134. smalltalk.addMethod(
  3135. smalltalk.method({
  3136. selector: "activeTab",
  3137. category: 'accessing',
  3138. fn: function (){
  3139. var self=this;
  3140. return smalltalk.withContext(function($ctx1) {
  3141. var $1;
  3142. $1=self["@activeTab"];
  3143. return $1;
  3144. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},smalltalk.HLManager)})},
  3145. args: [],
  3146. source: "activeTab\x0a\x09^ activeTab",
  3147. messageSends: [],
  3148. referencedClasses: []
  3149. }),
  3150. smalltalk.HLManager);
  3151. smalltalk.addMethod(
  3152. smalltalk.method({
  3153. selector: "addTab:",
  3154. category: 'actions',
  3155. fn: function (aTab){
  3156. var self=this;
  3157. return smalltalk.withContext(function($ctx1) {
  3158. _st(_st(self)._tabs())._add_(aTab);
  3159. _st(self)._activate_(aTab);
  3160. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},smalltalk.HLManager)})},
  3161. args: ["aTab"],
  3162. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  3163. messageSends: ["add:", "tabs", "activate:"],
  3164. referencedClasses: []
  3165. }),
  3166. smalltalk.HLManager);
  3167. smalltalk.addMethod(
  3168. smalltalk.method({
  3169. selector: "addToHistory:",
  3170. category: 'actions',
  3171. fn: function (aTab){
  3172. var self=this;
  3173. return smalltalk.withContext(function($ctx1) {
  3174. _st(self)._removeFromHistory_(aTab);
  3175. _st(_st(self)._history())._add_(aTab);
  3176. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},smalltalk.HLManager)})},
  3177. args: ["aTab"],
  3178. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  3179. messageSends: ["removeFromHistory:", "add:", "history"],
  3180. referencedClasses: []
  3181. }),
  3182. smalltalk.HLManager);
  3183. smalltalk.addMethod(
  3184. smalltalk.method({
  3185. selector: "confirm:ifFalse:",
  3186. category: 'actions',
  3187. fn: function (aString,aBlock){
  3188. var self=this;
  3189. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  3190. return smalltalk.withContext(function($ctx1) {
  3191. var $1,$2;
  3192. $1=_st($HLConfirmation())._new();
  3193. _st($1)._confirmationString_(aString);
  3194. _st($1)._cancelBlock_(aBlock);
  3195. $2=_st($1)._yourself();
  3196. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  3197. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3198. args: ["aString", "aBlock"],
  3199. source: "confirm: aString ifFalse: aBlock\x0a\x09(HLConfirmation new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09cancelBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  3200. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "cancelBlock:", "yourself"],
  3201. referencedClasses: ["HLConfirmation"]
  3202. }),
  3203. smalltalk.HLManager);
  3204. smalltalk.addMethod(
  3205. smalltalk.method({
  3206. selector: "confirm:ifTrue:",
  3207. category: 'actions',
  3208. fn: function (aString,aBlock){
  3209. var self=this;
  3210. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  3211. return smalltalk.withContext(function($ctx1) {
  3212. var $1,$2;
  3213. $1=_st($HLConfirmation())._new();
  3214. _st($1)._confirmationString_(aString);
  3215. _st($1)._actionBlock_(aBlock);
  3216. $2=_st($1)._yourself();
  3217. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  3218. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3219. args: ["aString", "aBlock"],
  3220. source: "confirm: aString ifTrue: aBlock\x0a\x09(HLConfirmation new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  3221. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "yourself"],
  3222. referencedClasses: ["HLConfirmation"]
  3223. }),
  3224. smalltalk.HLManager);
  3225. smalltalk.addMethod(
  3226. smalltalk.method({
  3227. selector: "defaultEnvironment",
  3228. category: 'defaults',
  3229. fn: function (){
  3230. var self=this;
  3231. function $Environment(){return smalltalk.Environment||(typeof Environment=="undefined"?nil:Environment)}
  3232. return smalltalk.withContext(function($ctx1) {
  3233. var $1,$2,$3;
  3234. $1=_st(window)._parent();
  3235. if(($receiver = $1) == nil || $receiver == undefined){
  3236. $2=_st($Environment())._new();
  3237. return $2;
  3238. } else {
  3239. $1;
  3240. };
  3241. $3=_st(_st(_st(_st(window)._parent())._at_("smalltalk"))._at_("Environment"))._new();
  3242. return $3;
  3243. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{},smalltalk.HLManager)})},
  3244. args: [],
  3245. source: "defaultEnvironment\x0a\x09\x22If helios is loaded from within a frame, answer the parent window environment\x22\x0a\x09\x0a\x09window parent ifNil: [ ^ Environment new ].\x0a\x09\x0a\x09^ ((window parent at: 'smalltalk')\x0a\x09\x09at: 'Environment') new",
  3246. messageSends: ["ifNil:", "new", "parent", "at:"],
  3247. referencedClasses: ["Environment"]
  3248. }),
  3249. smalltalk.HLManager);
  3250. smalltalk.addMethod(
  3251. smalltalk.method({
  3252. selector: "environment",
  3253. category: 'accessing',
  3254. fn: function (){
  3255. var self=this;
  3256. return smalltalk.withContext(function($ctx1) {
  3257. var $2,$1;
  3258. $2=self["@environment"];
  3259. if(($receiver = $2) == nil || $receiver == undefined){
  3260. self["@environment"]=_st(self)._defaultEnvironment();
  3261. $1=self["@environment"];
  3262. } else {
  3263. $1=$2;
  3264. };
  3265. return $1;
  3266. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLManager)})},
  3267. args: [],
  3268. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  3269. messageSends: ["ifNil:", "defaultEnvironment"],
  3270. referencedClasses: []
  3271. }),
  3272. smalltalk.HLManager);
  3273. smalltalk.addMethod(
  3274. smalltalk.method({
  3275. selector: "environment:",
  3276. category: 'accessing',
  3277. fn: function (anEnvironment){
  3278. var self=this;
  3279. return smalltalk.withContext(function($ctx1) {
  3280. self["@environment"]=anEnvironment;
  3281. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLManager)})},
  3282. args: ["anEnvironment"],
  3283. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  3284. messageSends: [],
  3285. referencedClasses: []
  3286. }),
  3287. smalltalk.HLManager);
  3288. smalltalk.addMethod(
  3289. smalltalk.method({
  3290. selector: "history",
  3291. category: 'accessing',
  3292. fn: function (){
  3293. var self=this;
  3294. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3295. return smalltalk.withContext(function($ctx1) {
  3296. var $2,$1;
  3297. $2=self["@history"];
  3298. if(($receiver = $2) == nil || $receiver == undefined){
  3299. self["@history"]=_st($OrderedCollection())._new();
  3300. $1=self["@history"];
  3301. } else {
  3302. $1=$2;
  3303. };
  3304. return $1;
  3305. }, function($ctx1) {$ctx1.fill(self,"history",{},smalltalk.HLManager)})},
  3306. args: [],
  3307. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  3308. messageSends: ["ifNil:", "new"],
  3309. referencedClasses: ["OrderedCollection"]
  3310. }),
  3311. smalltalk.HLManager);
  3312. smalltalk.addMethod(
  3313. smalltalk.method({
  3314. selector: "history:",
  3315. category: 'accessing',
  3316. fn: function (aCollection){
  3317. var self=this;
  3318. return smalltalk.withContext(function($ctx1) {
  3319. self["@history"]=aCollection;
  3320. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection},smalltalk.HLManager)})},
  3321. args: ["aCollection"],
  3322. source: "history: aCollection\x0a\x09history := aCollection",
  3323. messageSends: [],
  3324. referencedClasses: []
  3325. }),
  3326. smalltalk.HLManager);
  3327. smalltalk.addMethod(
  3328. smalltalk.method({
  3329. selector: "initialize",
  3330. category: 'initialization',
  3331. fn: function (){
  3332. var self=this;
  3333. return smalltalk.withContext(function($ctx1) {
  3334. smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  3335. _st(_st(self)._keyBinder())._setupEvents();
  3336. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager)})},
  3337. args: [],
  3338. source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
  3339. messageSends: ["initialize", "setupEvents", "keyBinder"],
  3340. referencedClasses: []
  3341. }),
  3342. smalltalk.HLManager);
  3343. smalltalk.addMethod(
  3344. smalltalk.method({
  3345. selector: "keyBinder",
  3346. category: 'accessing',
  3347. fn: function (){
  3348. var self=this;
  3349. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  3350. return smalltalk.withContext(function($ctx1) {
  3351. var $2,$1;
  3352. $2=self["@keyBinder"];
  3353. if(($receiver = $2) == nil || $receiver == undefined){
  3354. self["@keyBinder"]=_st($HLKeyBinder())._new();
  3355. $1=self["@keyBinder"];
  3356. } else {
  3357. $1=$2;
  3358. };
  3359. return $1;
  3360. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLManager)})},
  3361. args: [],
  3362. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  3363. messageSends: ["ifNil:", "new"],
  3364. referencedClasses: ["HLKeyBinder"]
  3365. }),
  3366. smalltalk.HLManager);
  3367. smalltalk.addMethod(
  3368. smalltalk.method({
  3369. selector: "refresh",
  3370. category: 'rendering',
  3371. fn: function (){
  3372. var self=this;
  3373. return smalltalk.withContext(function($ctx1) {
  3374. _st(_st(window)._jQuery_(".navbar"))._remove();
  3375. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  3376. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  3377. args: [],
  3378. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  3379. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  3380. referencedClasses: []
  3381. }),
  3382. smalltalk.HLManager);
  3383. smalltalk.addMethod(
  3384. smalltalk.method({
  3385. selector: "removeActiveTab",
  3386. category: 'actions',
  3387. fn: function (){
  3388. var self=this;
  3389. return smalltalk.withContext(function($ctx1) {
  3390. _st(self)._removeTab_(_st(self)._activeTab());
  3391. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},smalltalk.HLManager)})},
  3392. args: [],
  3393. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  3394. messageSends: ["removeTab:", "activeTab"],
  3395. referencedClasses: []
  3396. }),
  3397. smalltalk.HLManager);
  3398. smalltalk.addMethod(
  3399. smalltalk.method({
  3400. selector: "removeFromHistory:",
  3401. category: 'actions',
  3402. fn: function (aTab){
  3403. var self=this;
  3404. return smalltalk.withContext(function($ctx1) {
  3405. _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  3406. return smalltalk.withContext(function($ctx2) {
  3407. return _st(each).__eq_eq(aTab);
  3408. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  3409. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},smalltalk.HLManager)})},
  3410. args: ["aTab"],
  3411. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  3412. messageSends: ["history:", "reject:", "==", "history"],
  3413. referencedClasses: []
  3414. }),
  3415. smalltalk.HLManager);
  3416. smalltalk.addMethod(
  3417. smalltalk.method({
  3418. selector: "removeTab:",
  3419. category: 'actions',
  3420. fn: function (aTab){
  3421. var self=this;
  3422. return smalltalk.withContext(function($ctx1) {
  3423. var $1,$2;
  3424. $1=_st(_st(self)._tabs())._includes_(aTab);
  3425. if(! smalltalk.assert($1)){
  3426. $2=self;
  3427. return $2;
  3428. };
  3429. _st(self)._removeFromHistory_(aTab);
  3430. _st(_st(self)._tabs())._remove_(aTab);
  3431. _st(_st(self)._keyBinder())._flushBindings();
  3432. _st(aTab)._remove();
  3433. _st(self)._refresh();
  3434. _st(_st(self)._history())._ifNotEmpty_((function(){
  3435. return smalltalk.withContext(function($ctx2) {
  3436. return _st(_st(_st(self)._history())._last())._activate();
  3437. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3438. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  3439. args: ["aTab"],
  3440. source: "removeTab: aTab\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self removeFromHistory: aTab.\x0a\x09self tabs remove: aTab.\x0a\x09self keyBinder flushBindings.\x0a\x09aTab remove.\x0a\x09self refresh.\x0a\x09self history ifNotEmpty: [\x0a\x09\x09self history last activate ]",
  3441. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  3442. referencedClasses: []
  3443. }),
  3444. smalltalk.HLManager);
  3445. smalltalk.addMethod(
  3446. smalltalk.method({
  3447. selector: "renderAddOn:",
  3448. category: 'rendering',
  3449. fn: function (html){
  3450. var self=this;
  3451. function $HLWidget(){return smalltalk.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  3452. return smalltalk.withContext(function($ctx1) {
  3453. var $1,$3,$4,$5,$7,$8,$6,$2;
  3454. $1=_st(html)._li();
  3455. _st($1)._class_("dropdown");
  3456. $2=_st($1)._with_((function(){
  3457. return smalltalk.withContext(function($ctx2) {
  3458. $3=_st(html)._a();
  3459. _st($3)._class_("dropdown-toggle");
  3460. _st($3)._at_put_("data-toggle","dropdown");
  3461. $4=_st($3)._with_((function(){
  3462. return smalltalk.withContext(function($ctx3) {
  3463. _st(html)._with_("Open...");
  3464. return _st(_st(html)._tag_("b"))._class_("caret");
  3465. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3466. $4;
  3467. $5=_st(html)._ul();
  3468. _st($5)._class_("dropdown-menu");
  3469. $6=_st($5)._with_((function(){
  3470. return smalltalk.withContext(function($ctx3) {
  3471. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  3472. return smalltalk.withContext(function($ctx4) {
  3473. return _st(each)._canBeOpenAsTab();
  3474. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  3475. return smalltalk.withContext(function($ctx4) {
  3476. return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  3477. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  3478. return smalltalk.withContext(function($ctx4) {
  3479. return _st(_st(html)._li())._with_((function(){
  3480. return smalltalk.withContext(function($ctx5) {
  3481. $7=_st(html)._a();
  3482. _st($7)._with_(_st(each)._tabLabel());
  3483. $8=_st($7)._onClick_((function(){
  3484. return smalltalk.withContext(function($ctx6) {
  3485. return _st(each)._openAsTab();
  3486. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  3487. return $8;
  3488. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  3489. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  3490. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3491. return $6;
  3492. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3493. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},smalltalk.HLManager)})},
  3494. args: ["html"],
  3495. source: "renderAddOn: html\x0a html li \x0a \x09class: 'dropdown';\x0a with: [ \x0a\x09\x09\x09html a \x0a \x09\x09class: 'dropdown-toggle';\x0a \x09 \x09at: 'data-toggle' put: 'dropdown';\x0a \x09with: [ \x0a \x09\x09html with: 'Open...'.\x0a \x09\x09\x09\x09\x09(html tag: 'b') class: 'caret' ].\x0a html ul \x0a \x09\x09class: 'dropdown-menu';\x0a with: [\x0a \x09((HLWidget withAllSubclasses\x0a \x09select: [ :each | each canBeOpenAsTab ])\x0a sorted: [ :a :b | a tabPriority < b tabPriority ])\x0a do: [ :each |\x0a \x09\x09\x09\x09\x09\x09\x09html li with: [\x0a \x09\x09\x09html a \x0a \x09with: each tabLabel;\x0a \x09\x09\x09\x09\x09\x09\x09\x09onClick: [ each openAsTab ] ] ] ] ]",
  3496. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  3497. referencedClasses: ["HLWidget"]
  3498. }),
  3499. smalltalk.HLManager);
  3500. smalltalk.addMethod(
  3501. smalltalk.method({
  3502. selector: "renderContentOn:",
  3503. category: 'rendering',
  3504. fn: function (html){
  3505. var self=this;
  3506. return smalltalk.withContext(function($ctx1) {
  3507. var $1,$3,$4,$2;
  3508. $1=_st(html)._div();
  3509. _st($1)._class_("navbar navbar-fixed-top");
  3510. $2=_st($1)._with_((function(){
  3511. return smalltalk.withContext(function($ctx2) {
  3512. $3=_st(html)._div();
  3513. _st($3)._class_("navbar-inner");
  3514. $4=_st($3)._with_((function(){
  3515. return smalltalk.withContext(function($ctx3) {
  3516. return _st(self)._renderTabsOn_(html);
  3517. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3518. return $4;
  3519. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3520. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  3521. args: ["html"],
  3522. source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'navbar navbar-fixed-top';\x0a\x09\x09with: [ html div \x0a\x09\x09\x09class: 'navbar-inner';\x0a\x09\x09\x09with: [ self renderTabsOn: html ] ]",
  3523. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  3524. referencedClasses: []
  3525. }),
  3526. smalltalk.HLManager);
  3527. smalltalk.addMethod(
  3528. smalltalk.method({
  3529. selector: "renderTabsOn:",
  3530. category: 'rendering',
  3531. fn: function (html){
  3532. var self=this;
  3533. return smalltalk.withContext(function($ctx1) {
  3534. var $1,$3,$4,$6,$5,$8,$9,$7,$2;
  3535. $1=_st(html)._ul();
  3536. _st($1)._class_("nav");
  3537. $2=_st($1)._with_((function(){
  3538. return smalltalk.withContext(function($ctx2) {
  3539. _st(_st(self)._tabs())._do_((function(each){
  3540. return smalltalk.withContext(function($ctx3) {
  3541. $3=_st(html)._li();
  3542. $4=$3;
  3543. $6=_st(each)._isActive();
  3544. if(smalltalk.assert($6)){
  3545. $5="active";
  3546. } else {
  3547. $5="inactive";
  3548. };
  3549. _st($4)._class_($5);
  3550. $7=_st($3)._with_((function(){
  3551. return smalltalk.withContext(function($ctx4) {
  3552. $8=_st(html)._a();
  3553. _st($8)._with_((function(){
  3554. return smalltalk.withContext(function($ctx5) {
  3555. _st(_st(_st(html)._tag_("i"))._class_("icon-remove"))._onClick_((function(){
  3556. return smalltalk.withContext(function($ctx6) {
  3557. return _st(self)._removeTab_(each);
  3558. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  3559. return _st(html)._with_(_st(each)._displayLabel());
  3560. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  3561. $9=_st($8)._onClick_((function(){
  3562. return smalltalk.withContext(function($ctx5) {
  3563. return _st(each)._activate();
  3564. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  3565. return $9;
  3566. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  3567. return $7;
  3568. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  3569. return _st(self)._renderAddOn_(html);
  3570. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3571. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  3572. args: ["html"],
  3573. source: "renderTabsOn: html\x0a\x09html ul \x0a\x09\x09class: 'nav';\x0a\x09\x09with: [ \x0a \x09self tabs do: [ :each |\x0a\x09\x09\x09\x09html li \x0a\x09\x09\x09\x09\x09class: (each isActive ifTrue: [ 'active' ] ifFalse: [ 'inactive' ]);\x0a\x09\x09\x09\x09\x09with: [\x0a\x09\x09\x09\x09\x09\x09html a\x0a\x09\x09\x09\x09\x09\x09\x09with: [\x0a \x09\x09\x09\x09\x09\x09\x09((html tag: 'i') class: 'icon-remove')\x0a \x09\x09\x09\x09\x09\x09\x09\x09\x09onClick: [ self removeTab: each ].\x0a \x09html with: each displayLabel ];\x0a\x09\x09\x09\x09\x09\x09\x09onClick: [ each activate ] ] ].\x0a\x09\x09\x09self renderAddOn: html ]",
  3574. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "displayLabel", "a", "activate", "tabs", "renderAddOn:"],
  3575. referencedClasses: []
  3576. }),
  3577. smalltalk.HLManager);
  3578. smalltalk.addMethod(
  3579. smalltalk.method({
  3580. selector: "show:",
  3581. category: 'rendering',
  3582. fn: function (aTab){
  3583. var self=this;
  3584. return smalltalk.withContext(function($ctx1) {
  3585. var $1,$2;
  3586. _st(_st(self)._tabs())._do_((function(each){
  3587. return smalltalk.withContext(function($ctx2) {
  3588. return _st(each)._hide();
  3589. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3590. $1=aTab;
  3591. _st($1)._show();
  3592. $2=_st($1)._focus();
  3593. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  3594. args: ["aTab"],
  3595. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  3596. messageSends: ["do:", "hide", "tabs", "show", "focus"],
  3597. referencedClasses: []
  3598. }),
  3599. smalltalk.HLManager);
  3600. smalltalk.addMethod(
  3601. smalltalk.method({
  3602. selector: "tabs",
  3603. category: 'accessing',
  3604. fn: function (){
  3605. var self=this;
  3606. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3607. return smalltalk.withContext(function($ctx1) {
  3608. var $2,$1;
  3609. $2=self["@tabs"];
  3610. if(($receiver = $2) == nil || $receiver == undefined){
  3611. self["@tabs"]=_st($OrderedCollection())._new();
  3612. $1=self["@tabs"];
  3613. } else {
  3614. $1=$2;
  3615. };
  3616. return $1;
  3617. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLManager)})},
  3618. args: [],
  3619. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  3620. messageSends: ["ifNil:", "new"],
  3621. referencedClasses: ["OrderedCollection"]
  3622. }),
  3623. smalltalk.HLManager);
  3624. smalltalk.HLManager.klass.iVarNames = ['current'];
  3625. smalltalk.addMethod(
  3626. smalltalk.method({
  3627. selector: "current",
  3628. category: 'accessing',
  3629. fn: function (){
  3630. var self=this;
  3631. return smalltalk.withContext(function($ctx1) {
  3632. var $2,$1;
  3633. $2=self["@current"];
  3634. if(($receiver = $2) == nil || $receiver == undefined){
  3635. self["@current"]=_st(_st(self)._basicNew())._initialize();
  3636. $1=self["@current"];
  3637. } else {
  3638. $1=$2;
  3639. };
  3640. return $1;
  3641. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLManager.klass)})},
  3642. args: [],
  3643. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  3644. messageSends: ["ifNil:", "initialize", "basicNew"],
  3645. referencedClasses: []
  3646. }),
  3647. smalltalk.HLManager.klass);
  3648. smalltalk.addMethod(
  3649. smalltalk.method({
  3650. selector: "initialize",
  3651. category: 'initialization',
  3652. fn: function (){
  3653. var self=this;
  3654. return smalltalk.withContext(function($ctx1) {
  3655. _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  3656. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager.klass)})},
  3657. args: [],
  3658. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  3659. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  3660. referencedClasses: []
  3661. }),
  3662. smalltalk.HLManager.klass);
  3663. smalltalk.addMethod(
  3664. smalltalk.method({
  3665. selector: "new",
  3666. category: 'instance creation',
  3667. fn: function (){
  3668. var self=this;
  3669. return smalltalk.withContext(function($ctx1) {
  3670. _st(self)._shouldNotImplement();
  3671. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLManager.klass)})},
  3672. args: [],
  3673. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  3674. messageSends: ["shouldNotImplement"],
  3675. referencedClasses: []
  3676. }),
  3677. smalltalk.HLManager.klass);
  3678. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  3679. smalltalk.addMethod(
  3680. smalltalk.method({
  3681. selector: "canBeOpenAsTab",
  3682. category: 'testing',
  3683. fn: function (){
  3684. var self=this;
  3685. return smalltalk.withContext(function($ctx1) {
  3686. return true;
  3687. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSUnit.klass)})},
  3688. args: [],
  3689. source: "canBeOpenAsTab\x0a\x09^ true",
  3690. messageSends: [],
  3691. referencedClasses: []
  3692. }),
  3693. smalltalk.HLSUnit.klass);
  3694. smalltalk.addMethod(
  3695. smalltalk.method({
  3696. selector: "tabLabel",
  3697. category: 'accessing',
  3698. fn: function (){
  3699. var self=this;
  3700. return smalltalk.withContext(function($ctx1) {
  3701. return "SUnit";
  3702. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLSUnit.klass)})},
  3703. args: [],
  3704. source: "tabLabel\x0a\x09^ 'SUnit'",
  3705. messageSends: [],
  3706. referencedClasses: []
  3707. }),
  3708. smalltalk.HLSUnit.klass);
  3709. smalltalk.addMethod(
  3710. smalltalk.method({
  3711. selector: "tabPriority",
  3712. category: 'accessing',
  3713. fn: function (){
  3714. var self=this;
  3715. return smalltalk.withContext(function($ctx1) {
  3716. var $1;
  3717. $1=(1000);
  3718. return $1;
  3719. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLSUnit.klass)})},
  3720. args: [],
  3721. source: "tabPriority\x0a\x09^ 1000",
  3722. messageSends: [],
  3723. referencedClasses: []
  3724. }),
  3725. smalltalk.HLSUnit.klass);
  3726. smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
  3727. smalltalk.addMethod(
  3728. smalltalk.method({
  3729. selector: "canBeOpenAsTab",
  3730. category: 'testing',
  3731. fn: function (){
  3732. var self=this;
  3733. return smalltalk.withContext(function($ctx1) {
  3734. return true;
  3735. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLTranscript.klass)})},
  3736. args: [],
  3737. source: "canBeOpenAsTab\x0a\x09^ true",
  3738. messageSends: [],
  3739. referencedClasses: []
  3740. }),
  3741. smalltalk.HLTranscript.klass);
  3742. smalltalk.addMethod(
  3743. smalltalk.method({
  3744. selector: "tabLabel",
  3745. category: 'accessing',
  3746. fn: function (){
  3747. var self=this;
  3748. return smalltalk.withContext(function($ctx1) {
  3749. return "Transcript";
  3750. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLTranscript.klass)})},
  3751. args: [],
  3752. source: "tabLabel\x0a\x09^ 'Transcript'",
  3753. messageSends: [],
  3754. referencedClasses: []
  3755. }),
  3756. smalltalk.HLTranscript.klass);
  3757. smalltalk.addMethod(
  3758. smalltalk.method({
  3759. selector: "tabPriority",
  3760. category: 'accessing',
  3761. fn: function (){
  3762. var self=this;
  3763. return smalltalk.withContext(function($ctx1) {
  3764. var $1;
  3765. $1=(600);
  3766. return $1;
  3767. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLTranscript.klass)})},
  3768. args: [],
  3769. source: "tabPriority\x0a\x09^ 600",
  3770. messageSends: [],
  3771. referencedClasses: []
  3772. }),
  3773. smalltalk.HLTranscript.klass);