2
0

Helios-Core.js 176 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
  3. smalltalk.HLModel.comment="I am the abstract superclass of all models of Helios.\x0aI am the \x22Model\x22 part of the MVC pattern implementation in Helios.\x0a\x0aI provide access to an `Environment` object and both a local (model-specific) and global (system-specific) announcer.\x0a\x0aThe `#withChangesDo:` method is handy for performing model changes ensuring that all widgets are aware of the change and can prevent it from happening.\x0a\x0aModifications of the system should be done via commands (see `HLCommand` and subclasses).\x0a\x0a";
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "announcer",
  7. category: 'accessing',
  8. fn: function (){
  9. var self=this;
  10. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  11. return smalltalk.withContext(function($ctx1) {
  12. var $2,$1;
  13. $2=self["@announcer"];
  14. if(($receiver = $2) == nil || $receiver == undefined){
  15. self["@announcer"]=_st($Announcer())._new();
  16. $1=self["@announcer"];
  17. } else {
  18. $1=$2;
  19. };
  20. return $1;
  21. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLModel)})},
  22. args: [],
  23. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  24. messageSends: ["ifNil:", "new"],
  25. referencedClasses: ["Announcer"]
  26. }),
  27. smalltalk.HLModel);
  28. smalltalk.addMethod(
  29. smalltalk.method({
  30. selector: "environment",
  31. category: 'accessing',
  32. fn: function (){
  33. var self=this;
  34. return smalltalk.withContext(function($ctx1) {
  35. var $2,$1;
  36. $2=self["@environment"];
  37. if(($receiver = $2) == nil || $receiver == undefined){
  38. $1=_st(self._manager())._environment();
  39. } else {
  40. $1=$2;
  41. };
  42. return $1;
  43. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLModel)})},
  44. args: [],
  45. source: "environment\x0a\x09^ environment ifNil: [ self manager environment ]",
  46. messageSends: ["ifNil:", "environment", "manager"],
  47. referencedClasses: []
  48. }),
  49. smalltalk.HLModel);
  50. smalltalk.addMethod(
  51. smalltalk.method({
  52. selector: "environment:",
  53. category: 'accessing',
  54. fn: function (anEnvironment){
  55. var self=this;
  56. return smalltalk.withContext(function($ctx1) {
  57. self["@environment"]=anEnvironment;
  58. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLModel)})},
  59. args: ["anEnvironment"],
  60. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  61. messageSends: [],
  62. referencedClasses: []
  63. }),
  64. smalltalk.HLModel);
  65. smalltalk.addMethod(
  66. smalltalk.method({
  67. selector: "isBrowserModel",
  68. category: 'testing',
  69. fn: function (){
  70. var self=this;
  71. return smalltalk.withContext(function($ctx1) {
  72. return false;
  73. }, function($ctx1) {$ctx1.fill(self,"isBrowserModel",{},smalltalk.HLModel)})},
  74. args: [],
  75. source: "isBrowserModel\x0a\x09^ false",
  76. messageSends: [],
  77. referencedClasses: []
  78. }),
  79. smalltalk.HLModel);
  80. smalltalk.addMethod(
  81. smalltalk.method({
  82. selector: "isReferencesModel",
  83. category: 'testing',
  84. fn: function (){
  85. var self=this;
  86. return smalltalk.withContext(function($ctx1) {
  87. return false;
  88. }, function($ctx1) {$ctx1.fill(self,"isReferencesModel",{},smalltalk.HLModel)})},
  89. args: [],
  90. source: "isReferencesModel\x0a\x09^ false",
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. smalltalk.HLModel);
  95. smalltalk.addMethod(
  96. smalltalk.method({
  97. selector: "isToolModel",
  98. category: 'testing',
  99. fn: function (){
  100. var self=this;
  101. return smalltalk.withContext(function($ctx1) {
  102. return false;
  103. }, function($ctx1) {$ctx1.fill(self,"isToolModel",{},smalltalk.HLModel)})},
  104. args: [],
  105. source: "isToolModel\x0a\x09^ false",
  106. messageSends: [],
  107. referencedClasses: []
  108. }),
  109. smalltalk.HLModel);
  110. smalltalk.addMethod(
  111. smalltalk.method({
  112. selector: "manager",
  113. category: 'accessing',
  114. fn: function (){
  115. var self=this;
  116. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  117. return smalltalk.withContext(function($ctx1) {
  118. var $1;
  119. $1=_st($HLManager())._current();
  120. return $1;
  121. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLModel)})},
  122. args: [],
  123. source: "manager\x0a\x09^ HLManager current",
  124. messageSends: ["current"],
  125. referencedClasses: ["HLManager"]
  126. }),
  127. smalltalk.HLModel);
  128. smalltalk.addMethod(
  129. smalltalk.method({
  130. selector: "systemAnnouncer",
  131. category: 'accessing',
  132. fn: function (){
  133. var self=this;
  134. return smalltalk.withContext(function($ctx1) {
  135. var $1;
  136. $1=_st(self._environment())._systemAnnouncer();
  137. return $1;
  138. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLModel)})},
  139. args: [],
  140. source: "systemAnnouncer\x0a\x09^ self environment systemAnnouncer",
  141. messageSends: ["systemAnnouncer", "environment"],
  142. referencedClasses: []
  143. }),
  144. smalltalk.HLModel);
  145. smalltalk.addMethod(
  146. smalltalk.method({
  147. selector: "withChangesDo:",
  148. category: 'error handling',
  149. fn: function (aBlock){
  150. var self=this;
  151. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  152. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  153. return smalltalk.withContext(function($ctx1) {
  154. _st((function(){
  155. return smalltalk.withContext(function($ctx2) {
  156. _st(self._announcer())._announce_(_st(_st($HLAboutToChange())._new())._actionBlock_(aBlock));
  157. return _st(aBlock)._value();
  158. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($HLChangeForbidden(),(function(ex){
  159. return smalltalk.withContext(function($ctx2) {
  160. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  161. return self}, function($ctx1) {$ctx1.fill(self,"withChangesDo:",{aBlock:aBlock},smalltalk.HLModel)})},
  162. args: ["aBlock"],
  163. 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 | ]",
  164. messageSends: ["on:do:", "announce:", "actionBlock:", "new", "announcer", "value"],
  165. referencedClasses: ["HLChangeForbidden", "HLAboutToChange"]
  166. }),
  167. smalltalk.HLModel);
  168. smalltalk.addClass('HLToolModel', smalltalk.HLModel, ['selectedClass', 'selectedPackage', 'selectedProtocol', 'selectedSelector'], 'Helios-Core');
  169. smalltalk.HLToolModel.comment="I am a model specific to package and class manipulation. All browsers should either use me or a subclass as their model.\x0a\x0aI provide methods for package, class, protocol and method manipulation and access, forwarding to my environment.\x0a\x0aI also handle compilation of classes and methods as well as compilation and parsing errors.";
  170. smalltalk.addMethod(
  171. smalltalk.method({
  172. selector: "addInstVarNamed:",
  173. category: 'actions',
  174. fn: function (aString){
  175. var self=this;
  176. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  177. return smalltalk.withContext(function($ctx1) {
  178. var $1,$2;
  179. _st(self._environment())._addInstVarNamed_to_(aString,self._selectedClass());
  180. $1=_st($HLInstVarAdded())._new();
  181. _st($1)._theClass_(self._selectedClass());
  182. _st($1)._variableName_(aString);
  183. $2=_st($1)._yourself();
  184. _st(self._announcer())._announce_($2);
  185. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:",{aString:aString},smalltalk.HLToolModel)})},
  186. args: ["aString"],
  187. 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)",
  188. messageSends: ["addInstVarNamed:to:", "selectedClass", "environment", "announce:", "theClass:", "new", "variableName:", "yourself", "announcer"],
  189. referencedClasses: ["HLInstVarAdded"]
  190. }),
  191. smalltalk.HLToolModel);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "allProtocol",
  195. category: 'defaults',
  196. fn: function (){
  197. var self=this;
  198. return smalltalk.withContext(function($ctx1) {
  199. return "-- all --";
  200. }, function($ctx1) {$ctx1.fill(self,"allProtocol",{},smalltalk.HLToolModel)})},
  201. args: [],
  202. source: "allProtocol\x0a\x09^ '-- all --'",
  203. messageSends: [],
  204. referencedClasses: []
  205. }),
  206. smalltalk.HLToolModel);
  207. smalltalk.addMethod(
  208. smalltalk.method({
  209. selector: "allSelectors",
  210. category: 'accessing',
  211. fn: function (){
  212. var self=this;
  213. return smalltalk.withContext(function($ctx1) {
  214. var $1;
  215. $1=_st(self._environment())._allSelectors();
  216. return $1;
  217. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.HLToolModel)})},
  218. args: [],
  219. source: "allSelectors\x0a\x09^ self environment allSelectors",
  220. messageSends: ["allSelectors", "environment"],
  221. referencedClasses: []
  222. }),
  223. smalltalk.HLToolModel);
  224. smalltalk.addMethod(
  225. smalltalk.method({
  226. selector: "availableClassNames",
  227. category: 'accessing',
  228. fn: function (){
  229. var self=this;
  230. return smalltalk.withContext(function($ctx1) {
  231. var $1;
  232. $1=_st(self._environment())._availableClassNames();
  233. return $1;
  234. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLToolModel)})},
  235. args: [],
  236. source: "availableClassNames\x0a\x09^ self environment availableClassNames",
  237. messageSends: ["availableClassNames", "environment"],
  238. referencedClasses: []
  239. }),
  240. smalltalk.HLToolModel);
  241. smalltalk.addMethod(
  242. smalltalk.method({
  243. selector: "availablePackageNames",
  244. category: 'accessing',
  245. fn: function (){
  246. var self=this;
  247. return smalltalk.withContext(function($ctx1) {
  248. var $1;
  249. $1=_st(self._environment())._availablePackageNames();
  250. return $1;
  251. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.HLToolModel)})},
  252. args: [],
  253. source: "availablePackageNames\x0a\x09^ self environment availablePackageNames",
  254. messageSends: ["availablePackageNames", "environment"],
  255. referencedClasses: []
  256. }),
  257. smalltalk.HLToolModel);
  258. smalltalk.addMethod(
  259. smalltalk.method({
  260. selector: "availablePackages",
  261. category: 'accessing',
  262. fn: function (){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx1) {
  265. var $1;
  266. $1=_st(self._environment())._availablePackageNames();
  267. return $1;
  268. }, function($ctx1) {$ctx1.fill(self,"availablePackages",{},smalltalk.HLToolModel)})},
  269. args: [],
  270. source: "availablePackages\x0a\x09^ self environment availablePackageNames",
  271. messageSends: ["availablePackageNames", "environment"],
  272. referencedClasses: []
  273. }),
  274. smalltalk.HLToolModel);
  275. smalltalk.addMethod(
  276. smalltalk.method({
  277. selector: "availableProtocols",
  278. category: 'accessing',
  279. fn: function (){
  280. var self=this;
  281. return smalltalk.withContext(function($ctx1) {
  282. var $1;
  283. $1=_st(self._environment())._availableProtocolsFor_(self._selectedClass());
  284. return $1;
  285. }, function($ctx1) {$ctx1.fill(self,"availableProtocols",{},smalltalk.HLToolModel)})},
  286. args: [],
  287. source: "availableProtocols\x0a\x09^ self environment availableProtocolsFor: self selectedClass",
  288. messageSends: ["availableProtocolsFor:", "selectedClass", "environment"],
  289. referencedClasses: []
  290. }),
  291. smalltalk.HLToolModel);
  292. smalltalk.addMethod(
  293. smalltalk.method({
  294. selector: "commitPackage",
  295. category: 'commands actions',
  296. fn: function (){
  297. var self=this;
  298. return smalltalk.withContext(function($ctx1) {
  299. _st(self._environment())._commitPackage_(self._selectedPackage());
  300. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage",{},smalltalk.HLToolModel)})},
  301. args: [],
  302. source: "commitPackage\x0a\x09\x22self \x0a\x09\x09withHelperLabelled: 'Committing package ', self selectedPackage name, '...'\x0a\x09\x09do: [ \x22self environment commitPackage: self selectedPackage\x22 ]\x22",
  303. messageSends: ["commitPackage:", "selectedPackage", "environment"],
  304. referencedClasses: []
  305. }),
  306. smalltalk.HLToolModel);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "compilationProtocol",
  310. category: 'private',
  311. fn: function (){
  312. var self=this;
  313. var currentProtocol;
  314. return smalltalk.withContext(function($ctx1) {
  315. var $1,$2,$4,$3;
  316. currentProtocol=self._selectedProtocol();
  317. $1=currentProtocol;
  318. if(($receiver = $1) == nil || $receiver == undefined){
  319. currentProtocol=self._unclassifiedProtocol();
  320. currentProtocol;
  321. } else {
  322. $1;
  323. };
  324. $2=self._selectedMethod();
  325. if(($receiver = $2) == nil || $receiver == undefined){
  326. $2;
  327. } else {
  328. currentProtocol=_st(self._selectedMethod())._protocol();
  329. currentProtocol;
  330. };
  331. $4=_st(currentProtocol).__eq(self._allProtocol());
  332. if(smalltalk.assert($4)){
  333. $3=self._unclassifiedProtocol();
  334. } else {
  335. $3=currentProtocol;
  336. };
  337. return $3;
  338. }, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol},smalltalk.HLToolModel)})},
  339. args: [],
  340. 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 ]",
  341. messageSends: ["selectedProtocol", "ifNil:", "unclassifiedProtocol", "ifNotNil:", "protocol", "selectedMethod", "ifTrue:ifFalse:", "=", "allProtocol"],
  342. referencedClasses: []
  343. }),
  344. smalltalk.HLToolModel);
  345. smalltalk.addMethod(
  346. smalltalk.method({
  347. selector: "compileClassComment:",
  348. category: 'compiling',
  349. fn: function (aString){
  350. var self=this;
  351. return smalltalk.withContext(function($ctx1) {
  352. _st(self._environment())._compileClassComment_for_(aString,self._selectedClass());
  353. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:",{aString:aString},smalltalk.HLToolModel)})},
  354. args: ["aString"],
  355. source: "compileClassComment: aString\x0a\x09self environment \x0a\x09\x09compileClassComment: aString \x0a\x09\x09for: self selectedClass",
  356. messageSends: ["compileClassComment:for:", "selectedClass", "environment"],
  357. referencedClasses: []
  358. }),
  359. smalltalk.HLToolModel);
  360. smalltalk.addMethod(
  361. smalltalk.method({
  362. selector: "compileClassDefinition:",
  363. category: 'compiling',
  364. fn: function (aString){
  365. var self=this;
  366. return smalltalk.withContext(function($ctx1) {
  367. _st(self._environment())._compileClassDefinition_(aString);
  368. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.HLToolModel)})},
  369. args: ["aString"],
  370. source: "compileClassDefinition: aString\x0a\x09self environment compileClassDefinition: aString",
  371. messageSends: ["compileClassDefinition:", "environment"],
  372. referencedClasses: []
  373. }),
  374. smalltalk.HLToolModel);
  375. smalltalk.addMethod(
  376. smalltalk.method({
  377. selector: "compileMethod:",
  378. category: 'compiling',
  379. fn: function (aString){
  380. var self=this;
  381. var method;
  382. return smalltalk.withContext(function($ctx1) {
  383. self._withCompileErrorHandling_((function(){
  384. return smalltalk.withContext(function($ctx2) {
  385. method=_st(self._environment())._compileMethod_for_protocol_(aString,self._selectedClass(),self._compilationProtocol());
  386. method;
  387. return self._selectedMethod_(method);
  388. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  389. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString,method:method},smalltalk.HLToolModel)})},
  390. args: ["aString"],
  391. 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 ]",
  392. messageSends: ["withCompileErrorHandling:", "compileMethod:for:protocol:", "selectedClass", "compilationProtocol", "environment", "selectedMethod:"],
  393. referencedClasses: []
  394. }),
  395. smalltalk.HLToolModel);
  396. smalltalk.addMethod(
  397. smalltalk.method({
  398. selector: "copyClassTo:",
  399. category: 'commands actions',
  400. fn: function (aClassName){
  401. var self=this;
  402. return smalltalk.withContext(function($ctx1) {
  403. self._withChangesDo_((function(){
  404. return smalltalk.withContext(function($ctx2) {
  405. return _st(self._environment())._copyClass_to_(_st(self._selectedClass())._theNonMetaClass(),aClassName);
  406. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  407. return self}, function($ctx1) {$ctx1.fill(self,"copyClassTo:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  408. args: ["aClassName"],
  409. source: "copyClassTo: aClassName\x0a\x09self withChangesDo: [ \x0a\x09\x09self environment \x0a\x09\x09\x09copyClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  410. messageSends: ["withChangesDo:", "copyClass:to:", "theNonMetaClass", "selectedClass", "environment"],
  411. referencedClasses: []
  412. }),
  413. smalltalk.HLToolModel);
  414. smalltalk.addMethod(
  415. smalltalk.method({
  416. selector: "handleCompileError:",
  417. category: 'error handling',
  418. fn: function (anError){
  419. var self=this;
  420. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  421. return smalltalk.withContext(function($ctx1) {
  422. var $1,$2;
  423. $1=_st($HLCompileErrorRaised())._new();
  424. _st($1)._error_(anError);
  425. $2=_st($1)._yourself();
  426. _st(self._announcer())._announce_($2);
  427. return self}, function($ctx1) {$ctx1.fill(self,"handleCompileError:",{anError:anError},smalltalk.HLToolModel)})},
  428. args: ["anError"],
  429. source: "handleCompileError: anError\x0a\x09self announcer announce: (HLCompileErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  430. messageSends: ["announce:", "error:", "new", "yourself", "announcer"],
  431. referencedClasses: ["HLCompileErrorRaised"]
  432. }),
  433. smalltalk.HLToolModel);
  434. smalltalk.addMethod(
  435. smalltalk.method({
  436. selector: "handleParseError:",
  437. category: 'error handling',
  438. fn: function (anError){
  439. var self=this;
  440. var split,line,column,messageToInsert;
  441. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  442. return smalltalk.withContext(function($ctx1) {
  443. var $1,$2;
  444. split=_st(_st(anError)._messageText())._tokenize_(" : ");
  445. messageToInsert=_st(split)._second();
  446. split=_st(_st(split)._first())._copyFrom_to_((21),_st(_st(split)._first())._size());
  447. split=_st(split)._tokenize_(" column ");
  448. line=_st(split)._first();
  449. column=_st(split)._second();
  450. $1=_st($HLParseErrorRaised())._new();
  451. _st($1)._line_(_st(line)._asNumber());
  452. _st($1)._column_(_st(column)._asNumber());
  453. _st($1)._message_(messageToInsert);
  454. _st($1)._error_(anError);
  455. $2=_st($1)._yourself();
  456. _st(self._announcer())._announce_($2);
  457. return self}, function($ctx1) {$ctx1.fill(self,"handleParseError:",{anError:anError,split:split,line:line,column:column,messageToInsert:messageToInsert},smalltalk.HLToolModel)})},
  458. args: ["anError"],
  459. 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)",
  460. messageSends: ["tokenize:", "messageText", "second", "copyFrom:to:", "size", "first", "announce:", "line:", "asNumber", "new", "column:", "message:", "error:", "yourself", "announcer"],
  461. referencedClasses: ["HLParseErrorRaised"]
  462. }),
  463. smalltalk.HLToolModel);
  464. smalltalk.addMethod(
  465. smalltalk.method({
  466. selector: "handleUnkownVariableError:",
  467. category: 'error handling',
  468. fn: function (anError){
  469. var self=this;
  470. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  471. return smalltalk.withContext(function($ctx1) {
  472. var $1,$2;
  473. $1=_st($HLUnknownVariableErrorRaised())._new();
  474. _st($1)._error_(anError);
  475. $2=_st($1)._yourself();
  476. _st(self._announcer())._announce_($2);
  477. return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anError:anError},smalltalk.HLToolModel)})},
  478. args: ["anError"],
  479. source: "handleUnkownVariableError: anError\x0a\x09self announcer announce: (HLUnknownVariableErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  480. messageSends: ["announce:", "error:", "new", "yourself", "announcer"],
  481. referencedClasses: ["HLUnknownVariableErrorRaised"]
  482. }),
  483. smalltalk.HLToolModel);
  484. smalltalk.addMethod(
  485. smalltalk.method({
  486. selector: "isToolModel",
  487. category: 'testing',
  488. fn: function (){
  489. var self=this;
  490. return smalltalk.withContext(function($ctx1) {
  491. return true;
  492. }, function($ctx1) {$ctx1.fill(self,"isToolModel",{},smalltalk.HLToolModel)})},
  493. args: [],
  494. source: "isToolModel\x0a\x09^ true",
  495. messageSends: [],
  496. referencedClasses: []
  497. }),
  498. smalltalk.HLToolModel);
  499. smalltalk.addMethod(
  500. smalltalk.method({
  501. selector: "moveClassToPackage:",
  502. category: 'commands actions',
  503. fn: function (aPackageName){
  504. var self=this;
  505. return smalltalk.withContext(function($ctx1) {
  506. self._withChangesDo_((function(){
  507. return smalltalk.withContext(function($ctx2) {
  508. return _st(self._environment())._moveClass_toPackage_(_st(self._selectedClass())._theNonMetaClass(),aPackageName);
  509. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  510. return self}, function($ctx1) {$ctx1.fill(self,"moveClassToPackage:",{aPackageName:aPackageName},smalltalk.HLToolModel)})},
  511. args: ["aPackageName"],
  512. source: "moveClassToPackage: aPackageName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09toPackage: aPackageName ]",
  513. messageSends: ["withChangesDo:", "moveClass:toPackage:", "theNonMetaClass", "selectedClass", "environment"],
  514. referencedClasses: []
  515. }),
  516. smalltalk.HLToolModel);
  517. smalltalk.addMethod(
  518. smalltalk.method({
  519. selector: "moveMethodToClass:",
  520. category: 'commands actions',
  521. fn: function (aClassName){
  522. var self=this;
  523. return smalltalk.withContext(function($ctx1) {
  524. self._withChangesDo_((function(){
  525. return smalltalk.withContext(function($ctx2) {
  526. return _st(self._environment())._moveMethod_toClass_(self._selectedMethod(),aClassName);
  527. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  528. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  529. args: ["aClassName"],
  530. source: "moveMethodToClass: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toClass: aClassName ]",
  531. messageSends: ["withChangesDo:", "moveMethod:toClass:", "selectedMethod", "environment"],
  532. referencedClasses: []
  533. }),
  534. smalltalk.HLToolModel);
  535. smalltalk.addMethod(
  536. smalltalk.method({
  537. selector: "moveMethodToProtocol:",
  538. category: 'commands actions',
  539. fn: function (aProtocol){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx1) {
  542. self._withChangesDo_((function(){
  543. return smalltalk.withContext(function($ctx2) {
  544. return _st(self._environment())._moveMethod_toProtocol_(self._selectedMethod(),aProtocol);
  545. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  546. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToProtocol:",{aProtocol:aProtocol},smalltalk.HLToolModel)})},
  547. args: ["aProtocol"],
  548. source: "moveMethodToProtocol: aProtocol\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toProtocol: aProtocol ]",
  549. messageSends: ["withChangesDo:", "moveMethod:toProtocol:", "selectedMethod", "environment"],
  550. referencedClasses: []
  551. }),
  552. smalltalk.HLToolModel);
  553. smalltalk.addMethod(
  554. smalltalk.method({
  555. selector: "openClassNamed:",
  556. category: 'commands actions',
  557. fn: function (aString){
  558. var self=this;
  559. var class_;
  560. return smalltalk.withContext(function($ctx1) {
  561. self._withChangesDo_((function(){
  562. return smalltalk.withContext(function($ctx2) {
  563. class_=_st(self._environment())._classNamed_(aString);
  564. class_;
  565. self._selectedPackage_(_st(class_)._package());
  566. return self._selectedClass_(class_);
  567. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  568. return self}, function($ctx1) {$ctx1.fill(self,"openClassNamed:",{aString:aString,class_:class_},smalltalk.HLToolModel)})},
  569. args: ["aString"],
  570. 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 ]",
  571. messageSends: ["withChangesDo:", "classNamed:", "environment", "selectedPackage:", "package", "selectedClass:"],
  572. referencedClasses: []
  573. }),
  574. smalltalk.HLToolModel);
  575. smalltalk.addMethod(
  576. smalltalk.method({
  577. selector: "packages",
  578. category: 'accessing',
  579. fn: function (){
  580. var self=this;
  581. return smalltalk.withContext(function($ctx1) {
  582. var $1;
  583. $1=_st(self._environment())._packages();
  584. return $1;
  585. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLToolModel)})},
  586. args: [],
  587. source: "packages\x0a\x09^ self environment packages",
  588. messageSends: ["packages", "environment"],
  589. referencedClasses: []
  590. }),
  591. smalltalk.HLToolModel);
  592. smalltalk.addMethod(
  593. smalltalk.method({
  594. selector: "removeClass",
  595. category: 'commands actions',
  596. fn: function (){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) {
  599. self._withChangesDo_((function(){
  600. return smalltalk.withContext(function($ctx2) {
  601. return _st(self._manager())._confirm_ifTrue_("Do you REALLY want to remove class ".__comma(_st(self._selectedClass())._name()),(function(){
  602. return smalltalk.withContext(function($ctx3) {
  603. return _st(self._environment())._removeClass_(self._selectedClass());
  604. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  605. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  606. return self}, function($ctx1) {$ctx1.fill(self,"removeClass",{},smalltalk.HLToolModel)})},
  607. args: [],
  608. 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 ] ]",
  609. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "name", "selectedClass", "removeClass:", "environment", "manager"],
  610. referencedClasses: []
  611. }),
  612. smalltalk.HLToolModel);
  613. smalltalk.addMethod(
  614. smalltalk.method({
  615. selector: "removeMethod",
  616. category: 'commands actions',
  617. fn: function (){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) {
  620. self._withChangesDo_((function(){
  621. return smalltalk.withContext(function($ctx2) {
  622. return _st(self._manager())._confirm_ifTrue_(_st(_st("Do you REALLY want to remove method ".__comma(_st(_st(self._selectedMethod())._methodClass())._name())).__comma(" >> #")).__comma(_st(self._selectedMethod())._selector()),(function(){
  623. return smalltalk.withContext(function($ctx3) {
  624. return _st(self._environment())._removeMethod_(self._selectedMethod());
  625. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  626. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  627. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},smalltalk.HLToolModel)})},
  628. args: [],
  629. 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 ] ]",
  630. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "selector", "selectedMethod", "name", "methodClass", "removeMethod:", "environment", "manager"],
  631. referencedClasses: []
  632. }),
  633. smalltalk.HLToolModel);
  634. smalltalk.addMethod(
  635. smalltalk.method({
  636. selector: "removeProtocol",
  637. category: 'commands actions',
  638. fn: function (){
  639. var self=this;
  640. return smalltalk.withContext(function($ctx1) {
  641. self._withChangesDo_((function(){
  642. return smalltalk.withContext(function($ctx2) {
  643. return _st(self._manager())._confirm_ifTrue_("Do you REALLY want to remove protocol ".__comma(self._selectedProtocol()),(function(){
  644. return smalltalk.withContext(function($ctx3) {
  645. return _st(self._environment())._removeProtocol_from_(self._selectedProtocol(),self._selectedClass());
  646. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  647. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  648. return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol",{},smalltalk.HLToolModel)})},
  649. args: [],
  650. 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 ] ]",
  651. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "selectedProtocol", "removeProtocol:from:", "selectedClass", "environment", "manager"],
  652. referencedClasses: []
  653. }),
  654. smalltalk.HLToolModel);
  655. smalltalk.addMethod(
  656. smalltalk.method({
  657. selector: "renameClassTo:",
  658. category: 'commands actions',
  659. fn: function (aClassName){
  660. var self=this;
  661. return smalltalk.withContext(function($ctx1) {
  662. self._withChangesDo_((function(){
  663. return smalltalk.withContext(function($ctx2) {
  664. return _st(self._environment())._renameClass_to_(_st(self._selectedClass())._theNonMetaClass(),aClassName);
  665. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  666. return self}, function($ctx1) {$ctx1.fill(self,"renameClassTo:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  667. args: ["aClassName"],
  668. source: "renameClassTo: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09renameClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  669. messageSends: ["withChangesDo:", "renameClass:to:", "theNonMetaClass", "selectedClass", "environment"],
  670. referencedClasses: []
  671. }),
  672. smalltalk.HLToolModel);
  673. smalltalk.addMethod(
  674. smalltalk.method({
  675. selector: "renameProtocolTo:",
  676. category: 'commands actions',
  677. fn: function (aString){
  678. var self=this;
  679. return smalltalk.withContext(function($ctx1) {
  680. self._withChangesDo_((function(){
  681. return smalltalk.withContext(function($ctx2) {
  682. return _st(self._environment())._renameProtocol_to_in_(self._selectedProtocol(),aString,self._selectedClass());
  683. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  684. return self}, function($ctx1) {$ctx1.fill(self,"renameProtocolTo:",{aString:aString},smalltalk.HLToolModel)})},
  685. args: ["aString"],
  686. 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 ]",
  687. messageSends: ["withChangesDo:", "renameProtocol:to:in:", "selectedProtocol", "selectedClass", "environment"],
  688. referencedClasses: []
  689. }),
  690. smalltalk.HLToolModel);
  691. smalltalk.addMethod(
  692. smalltalk.method({
  693. selector: "save:",
  694. category: 'actions',
  695. fn: function (aString){
  696. var self=this;
  697. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  698. return smalltalk.withContext(function($ctx1) {
  699. var $1;
  700. _st(self._announcer())._announce_(_st($HLSourceCodeSaved())._new());
  701. $1=self._shouldCompileClassDefinition_(aString);
  702. if(smalltalk.assert($1)){
  703. self._compileClassDefinition_(aString);
  704. } else {
  705. self._compileMethod_(aString);
  706. };
  707. return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString},smalltalk.HLToolModel)})},
  708. args: ["aString"],
  709. 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 ]",
  710. messageSends: ["announce:", "new", "announcer", "ifTrue:ifFalse:", "compileClassDefinition:", "compileMethod:", "shouldCompileClassDefinition:"],
  711. referencedClasses: ["HLSourceCodeSaved"]
  712. }),
  713. smalltalk.HLToolModel);
  714. smalltalk.addMethod(
  715. smalltalk.method({
  716. selector: "saveSourceCode",
  717. category: 'actions',
  718. fn: function (){
  719. var self=this;
  720. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  721. return smalltalk.withContext(function($ctx1) {
  722. _st(self._announcer())._announce_(_st($HLSaveSourceCode())._new());
  723. return self}, function($ctx1) {$ctx1.fill(self,"saveSourceCode",{},smalltalk.HLToolModel)})},
  724. args: [],
  725. source: "saveSourceCode\x0a\x09self announcer announce: HLSaveSourceCode new",
  726. messageSends: ["announce:", "new", "announcer"],
  727. referencedClasses: ["HLSaveSourceCode"]
  728. }),
  729. smalltalk.HLToolModel);
  730. smalltalk.addMethod(
  731. smalltalk.method({
  732. selector: "selectedClass",
  733. category: 'accessing',
  734. fn: function (){
  735. var self=this;
  736. return smalltalk.withContext(function($ctx1) {
  737. var $1;
  738. $1=self["@selectedClass"];
  739. return $1;
  740. }, function($ctx1) {$ctx1.fill(self,"selectedClass",{},smalltalk.HLToolModel)})},
  741. args: [],
  742. source: "selectedClass\x0a\x09^ selectedClass",
  743. messageSends: [],
  744. referencedClasses: []
  745. }),
  746. smalltalk.HLToolModel);
  747. smalltalk.addMethod(
  748. smalltalk.method({
  749. selector: "selectedClass:",
  750. category: 'accessing',
  751. fn: function (aClass){
  752. var self=this;
  753. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  754. return smalltalk.withContext(function($ctx1) {
  755. var $1,$2,$3,$4,$5;
  756. $1=_st(_st(self._selectedClass()).__eq(aClass))._and_((function(){
  757. return smalltalk.withContext(function($ctx2) {
  758. return _st(aClass)._isNil();
  759. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  760. if(smalltalk.assert($1)){
  761. $2=self;
  762. return $2;
  763. };
  764. self._withChangesDo_((function(){
  765. return smalltalk.withContext(function($ctx2) {
  766. $3=_st(self["@selectedClass"]).__eq(aClass);
  767. if(smalltalk.assert($3)){
  768. self._selectedProtocol_(nil);
  769. };
  770. $4=aClass;
  771. if(($receiver = $4) == nil || $receiver == undefined){
  772. self["@selectedClass"]=nil;
  773. self["@selectedClass"];
  774. } else {
  775. self._selectedPackage_(_st(_st(aClass)._theNonMetaClass())._package());
  776. $5=self._showInstance();
  777. if(smalltalk.assert($5)){
  778. self["@selectedClass"]=_st(aClass)._theNonMetaClass();
  779. self["@selectedClass"];
  780. } else {
  781. self["@selectedClass"]=_st(aClass)._theMetaClass();
  782. self["@selectedClass"];
  783. };
  784. };
  785. self._selectedProtocol_(nil);
  786. return _st(self._announcer())._announce_(_st($HLClassSelected())._on_(self._selectedClass()));
  787. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  788. return self}, function($ctx1) {$ctx1.fill(self,"selectedClass:",{aClass:aClass},smalltalk.HLToolModel)})},
  789. args: ["aClass"],
  790. 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) ]",
  791. messageSends: ["ifTrue:", "and:", "isNil", "=", "selectedClass", "withChangesDo:", "selectedProtocol:", "ifNil:ifNotNil:", "selectedPackage:", "package", "theNonMetaClass", "ifTrue:ifFalse:", "theMetaClass", "showInstance", "announce:", "on:", "announcer"],
  792. referencedClasses: ["HLClassSelected"]
  793. }),
  794. smalltalk.HLToolModel);
  795. smalltalk.addMethod(
  796. smalltalk.method({
  797. selector: "selectedMethod",
  798. category: 'accessing',
  799. fn: function (){
  800. var self=this;
  801. return smalltalk.withContext(function($ctx1) {
  802. var $2,$1;
  803. $2=self._selectedClass();
  804. if(($receiver = $2) == nil || $receiver == undefined){
  805. $1=$2;
  806. } else {
  807. $1=_st(_st(self._selectedClass())._methodDictionary())._at_ifAbsent_(self["@selectedSelector"],(function(){
  808. return smalltalk.withContext(function($ctx2) {
  809. return nil;
  810. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  811. };
  812. return $1;
  813. }, function($ctx1) {$ctx1.fill(self,"selectedMethod",{},smalltalk.HLToolModel)})},
  814. args: [],
  815. source: "selectedMethod\x0a\x09^ self selectedClass ifNotNil: [ \x0a\x09\x09self selectedClass methodDictionary \x0a\x09\x09\x09at: selectedSelector \x0a\x09\x09\x09ifAbsent: [ nil ] ]",
  816. messageSends: ["ifNotNil:", "at:ifAbsent:", "methodDictionary", "selectedClass"],
  817. referencedClasses: []
  818. }),
  819. smalltalk.HLToolModel);
  820. smalltalk.addMethod(
  821. smalltalk.method({
  822. selector: "selectedMethod:",
  823. category: 'accessing',
  824. fn: function (aCompiledMethod){
  825. var self=this;
  826. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  827. return smalltalk.withContext(function($ctx1) {
  828. var $1,$2,$3;
  829. $1=_st(self["@selectedSelector"]).__eq(aCompiledMethod);
  830. if(smalltalk.assert($1)){
  831. $2=self;
  832. return $2;
  833. };
  834. self._withChangesDo_((function(){
  835. return smalltalk.withContext(function($ctx2) {
  836. $3=aCompiledMethod;
  837. if(($receiver = $3) == nil || $receiver == undefined){
  838. self["@selectedSelector"]=nil;
  839. self["@selectedSelector"];
  840. } else {
  841. self["@selectedClass"]=_st(aCompiledMethod)._methodClass();
  842. self["@selectedClass"];
  843. self["@selectedPackage"]=_st(_st(self["@selectedClass"])._theNonMetaClass())._package();
  844. self["@selectedPackage"];
  845. self["@selectedSelector"]=_st(aCompiledMethod)._selector();
  846. self["@selectedSelector"];
  847. };
  848. return _st(self._announcer())._announce_(_st($HLMethodSelected())._on_(aCompiledMethod));
  849. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  850. return self}, function($ctx1) {$ctx1.fill(self,"selectedMethod:",{aCompiledMethod:aCompiledMethod},smalltalk.HLToolModel)})},
  851. args: ["aCompiledMethod"],
  852. 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\x09selectedPackage := selectedClass theNonMetaClass package.\x0a\x09\x09\x09\x09selectedSelector := aCompiledMethod selector ].\x0a\x0a\x09\x09self announcer announce: (HLMethodSelected on: aCompiledMethod) ]",
  853. messageSends: ["ifTrue:", "=", "withChangesDo:", "ifNil:ifNotNil:", "methodClass", "package", "theNonMetaClass", "selector", "announce:", "on:", "announcer"],
  854. referencedClasses: ["HLMethodSelected"]
  855. }),
  856. smalltalk.HLToolModel);
  857. smalltalk.addMethod(
  858. smalltalk.method({
  859. selector: "selectedPackage",
  860. category: 'accessing',
  861. fn: function (){
  862. var self=this;
  863. return smalltalk.withContext(function($ctx1) {
  864. var $1;
  865. $1=self["@selectedPackage"];
  866. return $1;
  867. }, function($ctx1) {$ctx1.fill(self,"selectedPackage",{},smalltalk.HLToolModel)})},
  868. args: [],
  869. source: "selectedPackage\x0a\x09^ selectedPackage",
  870. messageSends: [],
  871. referencedClasses: []
  872. }),
  873. smalltalk.HLToolModel);
  874. smalltalk.addMethod(
  875. smalltalk.method({
  876. selector: "selectedPackage:",
  877. category: 'accessing',
  878. fn: function (aPackage){
  879. var self=this;
  880. function $HLPackageSelected(){return smalltalk.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  881. return smalltalk.withContext(function($ctx1) {
  882. var $1,$2;
  883. $1=_st(self["@selectedPackage"]).__eq(aPackage);
  884. if(smalltalk.assert($1)){
  885. $2=self;
  886. return $2;
  887. };
  888. self._withChangesDo_((function(){
  889. return smalltalk.withContext(function($ctx2) {
  890. self["@selectedPackage"]=aPackage;
  891. self["@selectedPackage"];
  892. self._selectedClass_(nil);
  893. return _st(self._announcer())._announce_(_st($HLPackageSelected())._on_(aPackage));
  894. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  895. return self}, function($ctx1) {$ctx1.fill(self,"selectedPackage:",{aPackage:aPackage},smalltalk.HLToolModel)})},
  896. args: ["aPackage"],
  897. 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) ]",
  898. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedClass:", "announce:", "on:", "announcer"],
  899. referencedClasses: ["HLPackageSelected"]
  900. }),
  901. smalltalk.HLToolModel);
  902. smalltalk.addMethod(
  903. smalltalk.method({
  904. selector: "selectedProtocol",
  905. category: 'accessing',
  906. fn: function (){
  907. var self=this;
  908. return smalltalk.withContext(function($ctx1) {
  909. var $1;
  910. $1=self["@selectedProtocol"];
  911. return $1;
  912. }, function($ctx1) {$ctx1.fill(self,"selectedProtocol",{},smalltalk.HLToolModel)})},
  913. args: [],
  914. source: "selectedProtocol\x0a\x09^ selectedProtocol",
  915. messageSends: [],
  916. referencedClasses: []
  917. }),
  918. smalltalk.HLToolModel);
  919. smalltalk.addMethod(
  920. smalltalk.method({
  921. selector: "selectedProtocol:",
  922. category: 'accessing',
  923. fn: function (aString){
  924. var self=this;
  925. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  926. return smalltalk.withContext(function($ctx1) {
  927. var $1,$2;
  928. $1=_st(self["@selectedProtocol"]).__eq(aString);
  929. if(smalltalk.assert($1)){
  930. $2=self;
  931. return $2;
  932. };
  933. self._withChangesDo_((function(){
  934. return smalltalk.withContext(function($ctx2) {
  935. self["@selectedProtocol"]=aString;
  936. self["@selectedProtocol"];
  937. self._selectedMethod_(nil);
  938. return _st(self._announcer())._announce_(_st($HLProtocolSelected())._on_(aString));
  939. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  940. return self}, function($ctx1) {$ctx1.fill(self,"selectedProtocol:",{aString:aString},smalltalk.HLToolModel)})},
  941. args: ["aString"],
  942. 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) ]",
  943. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedMethod:", "announce:", "on:", "announcer"],
  944. referencedClasses: ["HLProtocolSelected"]
  945. }),
  946. smalltalk.HLToolModel);
  947. smalltalk.addMethod(
  948. smalltalk.method({
  949. selector: "shouldCompileClassDefinition:",
  950. category: 'testing',
  951. fn: function (aString){
  952. var self=this;
  953. return smalltalk.withContext(function($ctx1) {
  954. var $1;
  955. $1=_st(_st(self._selectedClass())._isNil())._or_((function(){
  956. return smalltalk.withContext(function($ctx2) {
  957. return _st(aString)._match_("^[A-Z]");
  958. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  959. return $1;
  960. }, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition:",{aString:aString},smalltalk.HLToolModel)})},
  961. args: ["aString"],
  962. source: "shouldCompileClassDefinition: aString\x0a\x09^ self selectedClass isNil or: [\x0a\x09\x09aString match: '^[A-Z]' ]",
  963. messageSends: ["or:", "match:", "isNil", "selectedClass"],
  964. referencedClasses: []
  965. }),
  966. smalltalk.HLToolModel);
  967. smalltalk.addMethod(
  968. smalltalk.method({
  969. selector: "unclassifiedProtocol",
  970. category: 'defaults',
  971. fn: function (){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx1) {
  974. return "as yet unclassified";
  975. }, function($ctx1) {$ctx1.fill(self,"unclassifiedProtocol",{},smalltalk.HLToolModel)})},
  976. args: [],
  977. source: "unclassifiedProtocol\x0a\x09^ 'as yet unclassified'",
  978. messageSends: [],
  979. referencedClasses: []
  980. }),
  981. smalltalk.HLToolModel);
  982. smalltalk.addMethod(
  983. smalltalk.method({
  984. selector: "withCompileErrorHandling:",
  985. category: 'error handling',
  986. fn: function (aBlock){
  987. var self=this;
  988. function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  989. function $UnknownVariableError(){return smalltalk.UnknownVariableError||(typeof UnknownVariableError=="undefined"?nil:UnknownVariableError)}
  990. function $CompilerError(){return smalltalk.CompilerError||(typeof CompilerError=="undefined"?nil:CompilerError)}
  991. return smalltalk.withContext(function($ctx1) {
  992. _st(self._environment())._evaluate_on_do_((function(){
  993. return smalltalk.withContext(function($ctx2) {
  994. return _st(self._environment())._evaluate_on_do_((function(){
  995. return smalltalk.withContext(function($ctx3) {
  996. return _st(self._environment())._evaluate_on_do_(aBlock,$ParseError(),(function(ex){
  997. return smalltalk.withContext(function($ctx4) {
  998. return self._handleParseError_(ex);
  999. }, function($ctx4) {$ctx4.fillBlock({ex:ex},$ctx3)})}));
  1000. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}),$UnknownVariableError(),(function(ex){
  1001. return smalltalk.withContext(function($ctx3) {
  1002. return self._handleUnkownVariableError_(ex);
  1003. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2)})}));
  1004. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$CompilerError(),(function(ex){
  1005. return smalltalk.withContext(function($ctx2) {
  1006. return self._handleCompileError_(ex);
  1007. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  1008. return self}, function($ctx1) {$ctx1.fill(self,"withCompileErrorHandling:",{aBlock:aBlock},smalltalk.HLToolModel)})},
  1009. args: ["aBlock"],
  1010. source: "withCompileErrorHandling: aBlock\x0a\x09self environment\x0a\x09\x09evaluate: [\x0a\x09\x09\x09self environment \x0a\x09\x09\x09evaluate: [\x0a\x09\x09\x09\x09self environment \x0a\x09\x09\x09\x09\x09evaluate: aBlock\x0a\x09\x09\x09\x09\x09on: ParseError\x0a\x09\x09\x09\x09\x09do: [:ex | self handleParseError: ex ] ]\x0a\x09\x09\x09on: UnknownVariableError\x0a\x09\x09\x09do: [ :ex | self handleUnkownVariableError: ex ] ]\x0a\x09\x09on: CompilerError\x0a\x09\x09do: [ :ex | self handleCompileError: ex ]",
  1011. messageSends: ["evaluate:on:do:", "handleParseError:", "environment", "handleUnkownVariableError:", "handleCompileError:"],
  1012. referencedClasses: ["ParseError", "UnknownVariableError", "CompilerError"]
  1013. }),
  1014. smalltalk.HLToolModel);
  1015. smalltalk.addMethod(
  1016. smalltalk.method({
  1017. selector: "withHelperLabelled:do:",
  1018. category: 'private',
  1019. fn: function (aString,aBlock){
  1020. var self=this;
  1021. return smalltalk.withContext(function($ctx1) {
  1022. var $1,$2;
  1023. _st(_st(window)._jQuery_("#helper"))._remove();
  1024. _st((function(html){
  1025. return smalltalk.withContext(function($ctx2) {
  1026. $1=_st(html)._div();
  1027. _st($1)._id_("helper");
  1028. $2=_st($1)._with_(aString);
  1029. return $2;
  1030. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_("body"._asJQuery());
  1031. _st((function(){
  1032. return smalltalk.withContext(function($ctx2) {
  1033. _st(aBlock)._value();
  1034. return _st(_st(window)._jQuery_("#helper"))._remove();
  1035. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((10));
  1036. return self}, function($ctx1) {$ctx1.fill(self,"withHelperLabelled:do:",{aString:aString,aBlock:aBlock},smalltalk.HLToolModel)})},
  1037. args: ["aString", "aBlock"],
  1038. 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",
  1039. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery", "id:", "div", "with:", "valueWithTimeout:", "value"],
  1040. referencedClasses: []
  1041. }),
  1042. smalltalk.HLToolModel);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "on:",
  1046. category: 'actions',
  1047. fn: function (anEnvironment){
  1048. var self=this;
  1049. return smalltalk.withContext(function($ctx1) {
  1050. var $2,$3,$1;
  1051. $2=self._new();
  1052. _st($2)._environment_(anEnvironment);
  1053. $3=_st($2)._yourself();
  1054. $1=$3;
  1055. return $1;
  1056. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLToolModel.klass)})},
  1057. args: ["anEnvironment"],
  1058. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  1059. messageSends: ["environment:", "new", "yourself"],
  1060. referencedClasses: []
  1061. }),
  1062. smalltalk.HLToolModel.klass);
  1063. smalltalk.addClass('HLProgressHandler', smalltalk.ProgressHandler, [], 'Helios-Core');
  1064. smalltalk.HLProgressHandler.comment="I am a specific progress handler for Helios, displaying progresses in a modal window.";
  1065. smalltalk.addMethod(
  1066. smalltalk.method({
  1067. selector: "do:on:displaying:",
  1068. category: 'progress handling',
  1069. fn: function (aBlock,aCollection,aString){
  1070. var self=this;
  1071. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  1072. return smalltalk.withContext(function($ctx1) {
  1073. _st(_st($HLProgressWidget())._default())._do_on_displaying_(aBlock,aCollection,aString);
  1074. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},smalltalk.HLProgressHandler)})},
  1075. args: ["aBlock", "aCollection", "aString"],
  1076. source: "do: aBlock on: aCollection displaying: aString\x0a\x09HLProgressWidget default\x0a\x09\x09do: aBlock \x0a\x09\x09on: aCollection \x0a\x09\x09displaying: aString",
  1077. messageSends: ["do:on:displaying:", "default"],
  1078. referencedClasses: ["HLProgressWidget"]
  1079. }),
  1080. smalltalk.HLProgressHandler);
  1081. smalltalk.addClass('HLTabWidget', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
  1082. smalltalk.HLTabWidget.comment="I am a widget specialized into building another widget as an Helios tab.\x0a\x0aI should not be used directly, `HLWidget class >> #openAsTab` should be used instead.\x0a\x0a## Example\x0a\x0a HLWorkspace openAsTab";
  1083. smalltalk.addMethod(
  1084. smalltalk.method({
  1085. selector: "activate",
  1086. category: 'accessing',
  1087. fn: function (){
  1088. var self=this;
  1089. return smalltalk.withContext(function($ctx1) {
  1090. _st(self._manager())._activate_(self);
  1091. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTabWidget)})},
  1092. args: [],
  1093. source: "activate\x0a\x09self manager activate: self",
  1094. messageSends: ["activate:", "manager"],
  1095. referencedClasses: []
  1096. }),
  1097. smalltalk.HLTabWidget);
  1098. smalltalk.addMethod(
  1099. smalltalk.method({
  1100. selector: "add",
  1101. category: 'accessing',
  1102. fn: function (){
  1103. var self=this;
  1104. return smalltalk.withContext(function($ctx1) {
  1105. _st(self._manager())._addTab_(self);
  1106. return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTabWidget)})},
  1107. args: [],
  1108. source: "add\x0a\x09self manager addTab: self",
  1109. messageSends: ["addTab:", "manager"],
  1110. referencedClasses: []
  1111. }),
  1112. smalltalk.HLTabWidget);
  1113. smalltalk.addMethod(
  1114. smalltalk.method({
  1115. selector: "cssClass",
  1116. category: 'accessing',
  1117. fn: function (){
  1118. var self=this;
  1119. return smalltalk.withContext(function($ctx1) {
  1120. var $1;
  1121. $1=_st(self._widget())._tabClass();
  1122. return $1;
  1123. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLTabWidget)})},
  1124. args: [],
  1125. source: "cssClass\x0a\x09^ self widget tabClass",
  1126. messageSends: ["tabClass", "widget"],
  1127. referencedClasses: []
  1128. }),
  1129. smalltalk.HLTabWidget);
  1130. smalltalk.addMethod(
  1131. smalltalk.method({
  1132. selector: "displayLabel",
  1133. category: 'accessing',
  1134. fn: function (){
  1135. var self=this;
  1136. return smalltalk.withContext(function($ctx1) {
  1137. var $2,$1;
  1138. $2=_st(_st(self._label())._size()).__gt((20));
  1139. if(smalltalk.assert($2)){
  1140. $1=_st(_st(self._label())._first_((20))).__comma("...");
  1141. } else {
  1142. $1=self._label();
  1143. };
  1144. return $1;
  1145. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLTabWidget)})},
  1146. args: [],
  1147. source: "displayLabel\x0a\x09^ self label size > 20 \x0a\x09\x09ifTrue: [ (self label first: 20), '...' ]\x0a\x09\x09ifFalse: [ self label ]",
  1148. messageSends: ["ifTrue:ifFalse:", ",", "first:", "label", ">", "size"],
  1149. referencedClasses: []
  1150. }),
  1151. smalltalk.HLTabWidget);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "focus",
  1155. category: 'accessing',
  1156. fn: function (){
  1157. var self=this;
  1158. return smalltalk.withContext(function($ctx1) {
  1159. var $1;
  1160. $1=_st(self._widget())._canHaveFocus();
  1161. if(smalltalk.assert($1)){
  1162. _st(self._widget())._focus();
  1163. };
  1164. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTabWidget)})},
  1165. args: [],
  1166. source: "focus\x0a\x09self widget canHaveFocus ifTrue: [\x0a\x09\x09self widget focus ]",
  1167. messageSends: ["ifTrue:", "focus", "widget", "canHaveFocus"],
  1168. referencedClasses: []
  1169. }),
  1170. smalltalk.HLTabWidget);
  1171. smalltalk.addMethod(
  1172. smalltalk.method({
  1173. selector: "hide",
  1174. category: 'actions',
  1175. fn: function (){
  1176. var self=this;
  1177. return smalltalk.withContext(function($ctx1) {
  1178. var $1;
  1179. $1=self["@root"];
  1180. if(($receiver = $1) == nil || $receiver == undefined){
  1181. $1;
  1182. } else {
  1183. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","hidden");
  1184. };
  1185. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTabWidget)})},
  1186. args: [],
  1187. source: "hide\x0a\x09root ifNotNil: [ root asJQuery css: 'visibility' put: 'hidden' ]",
  1188. messageSends: ["ifNotNil:", "css:put:", "asJQuery"],
  1189. referencedClasses: []
  1190. }),
  1191. smalltalk.HLTabWidget);
  1192. smalltalk.addMethod(
  1193. smalltalk.method({
  1194. selector: "isActive",
  1195. category: 'testing',
  1196. fn: function (){
  1197. var self=this;
  1198. return smalltalk.withContext(function($ctx1) {
  1199. var $1;
  1200. $1=_st(_st(self._manager())._activeTab()).__eq(self);
  1201. return $1;
  1202. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTabWidget)})},
  1203. args: [],
  1204. source: "isActive\x0a\x09^ self manager activeTab = self",
  1205. messageSends: ["=", "activeTab", "manager"],
  1206. referencedClasses: []
  1207. }),
  1208. smalltalk.HLTabWidget);
  1209. smalltalk.addMethod(
  1210. smalltalk.method({
  1211. selector: "label",
  1212. category: 'accessing',
  1213. fn: function (){
  1214. var self=this;
  1215. return smalltalk.withContext(function($ctx1) {
  1216. var $2,$1;
  1217. $2=self["@label"];
  1218. if(($receiver = $2) == nil || $receiver == undefined){
  1219. $1="";
  1220. } else {
  1221. $1=$2;
  1222. };
  1223. return $1;
  1224. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTabWidget)})},
  1225. args: [],
  1226. source: "label\x0a\x09^ label ifNil: [ '' ]",
  1227. messageSends: ["ifNil:"],
  1228. referencedClasses: []
  1229. }),
  1230. smalltalk.HLTabWidget);
  1231. smalltalk.addMethod(
  1232. smalltalk.method({
  1233. selector: "label:",
  1234. category: 'accessing',
  1235. fn: function (aString){
  1236. var self=this;
  1237. return smalltalk.withContext(function($ctx1) {
  1238. self["@label"]=aString;
  1239. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTabWidget)})},
  1240. args: ["aString"],
  1241. source: "label: aString\x0a\x09label := aString",
  1242. messageSends: [],
  1243. referencedClasses: []
  1244. }),
  1245. smalltalk.HLTabWidget);
  1246. smalltalk.addMethod(
  1247. smalltalk.method({
  1248. selector: "manager",
  1249. category: 'accessing',
  1250. fn: function (){
  1251. var self=this;
  1252. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1253. return smalltalk.withContext(function($ctx1) {
  1254. var $1;
  1255. $1=_st($HLManager())._current();
  1256. return $1;
  1257. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTabWidget)})},
  1258. args: [],
  1259. source: "manager\x0a\x09^ HLManager current",
  1260. messageSends: ["current"],
  1261. referencedClasses: ["HLManager"]
  1262. }),
  1263. smalltalk.HLTabWidget);
  1264. smalltalk.addMethod(
  1265. smalltalk.method({
  1266. selector: "registerBindings",
  1267. category: 'actions',
  1268. fn: function (){
  1269. var self=this;
  1270. return smalltalk.withContext(function($ctx1) {
  1271. _st(self._widget())._registerBindings();
  1272. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTabWidget)})},
  1273. args: [],
  1274. source: "registerBindings\x0a\x09self widget registerBindings",
  1275. messageSends: ["registerBindings", "widget"],
  1276. referencedClasses: []
  1277. }),
  1278. smalltalk.HLTabWidget);
  1279. smalltalk.addMethod(
  1280. smalltalk.method({
  1281. selector: "remove",
  1282. category: 'actions',
  1283. fn: function (){
  1284. var self=this;
  1285. return smalltalk.withContext(function($ctx1) {
  1286. var $1;
  1287. _st(self._widget())._unregister();
  1288. $1=self["@root"];
  1289. if(($receiver = $1) == nil || $receiver == undefined){
  1290. $1;
  1291. } else {
  1292. _st(_st(self["@root"])._asJQuery())._remove();
  1293. };
  1294. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTabWidget)})},
  1295. args: [],
  1296. source: "remove\x0a\x09self widget unregister.\x0a\x09root ifNotNil: [ root asJQuery remove ]",
  1297. messageSends: ["unregister", "widget", "ifNotNil:", "remove", "asJQuery"],
  1298. referencedClasses: []
  1299. }),
  1300. smalltalk.HLTabWidget);
  1301. smalltalk.addMethod(
  1302. smalltalk.method({
  1303. selector: "renderOn:",
  1304. category: 'rendering',
  1305. fn: function (html){
  1306. var self=this;
  1307. return smalltalk.withContext(function($ctx1) {
  1308. var $1,$2;
  1309. $1=_st(html)._div();
  1310. _st($1)._class_("tab");
  1311. $2=_st($1)._yourself();
  1312. self["@root"]=$2;
  1313. self._renderTab();
  1314. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTabWidget)})},
  1315. args: ["html"],
  1316. source: "renderOn: html\x0a\x09root := html div\x0a\x09\x09class: 'tab';\x0a\x09\x09yourself.\x0a\x09self renderTab",
  1317. messageSends: ["class:", "div", "yourself", "renderTab"],
  1318. referencedClasses: []
  1319. }),
  1320. smalltalk.HLTabWidget);
  1321. smalltalk.addMethod(
  1322. smalltalk.method({
  1323. selector: "renderTab",
  1324. category: 'rendering',
  1325. fn: function (){
  1326. var self=this;
  1327. return smalltalk.withContext(function($ctx1) {
  1328. var $1,$2;
  1329. _st(self["@root"])._contents_((function(html){
  1330. return smalltalk.withContext(function($ctx2) {
  1331. $1=_st(html)._div();
  1332. _st($1)._class_("amber_box");
  1333. $2=_st($1)._with_((function(){
  1334. return smalltalk.withContext(function($ctx3) {
  1335. return _st(self._widget())._renderOn_(html);
  1336. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  1337. return $2;
  1338. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  1339. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTabWidget)})},
  1340. args: [],
  1341. source: "renderTab\x0a\x09root contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'amber_box';\x0a\x09\x09\x09with: [ self widget renderOn: html ] ]",
  1342. messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"],
  1343. referencedClasses: []
  1344. }),
  1345. smalltalk.HLTabWidget);
  1346. smalltalk.addMethod(
  1347. smalltalk.method({
  1348. selector: "show",
  1349. category: 'actions',
  1350. fn: function (){
  1351. var self=this;
  1352. return smalltalk.withContext(function($ctx1) {
  1353. var $1;
  1354. $1=self["@root"];
  1355. if(($receiver = $1) == nil || $receiver == undefined){
  1356. self._appendToJQuery_("body"._asJQuery());
  1357. } else {
  1358. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","visible");
  1359. };
  1360. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTabWidget)})},
  1361. args: [],
  1362. source: "show\x0a\x09root\x0a\x09\x09ifNil: [ self appendToJQuery: 'body' asJQuery ]\x0a\x09\x09ifNotNil: [ root asJQuery css: 'visibility' put: 'visible' ]",
  1363. messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "css:put:"],
  1364. referencedClasses: []
  1365. }),
  1366. smalltalk.HLTabWidget);
  1367. smalltalk.addMethod(
  1368. smalltalk.method({
  1369. selector: "widget",
  1370. category: 'accessing',
  1371. fn: function (){
  1372. var self=this;
  1373. return smalltalk.withContext(function($ctx1) {
  1374. var $1;
  1375. $1=self["@widget"];
  1376. return $1;
  1377. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTabWidget)})},
  1378. args: [],
  1379. source: "widget\x0a\x09^ widget",
  1380. messageSends: [],
  1381. referencedClasses: []
  1382. }),
  1383. smalltalk.HLTabWidget);
  1384. smalltalk.addMethod(
  1385. smalltalk.method({
  1386. selector: "widget:",
  1387. category: 'accessing',
  1388. fn: function (aWidget){
  1389. var self=this;
  1390. return smalltalk.withContext(function($ctx1) {
  1391. self["@widget"]=aWidget;
  1392. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTabWidget)})},
  1393. args: ["aWidget"],
  1394. source: "widget: aWidget\x0a\x09widget := aWidget",
  1395. messageSends: [],
  1396. referencedClasses: []
  1397. }),
  1398. smalltalk.HLTabWidget);
  1399. smalltalk.addMethod(
  1400. smalltalk.method({
  1401. selector: "on:labelled:",
  1402. category: 'instance creation',
  1403. fn: function (aWidget,aString){
  1404. var self=this;
  1405. return smalltalk.withContext(function($ctx1) {
  1406. var $2,$3,$1;
  1407. $2=self._new();
  1408. _st($2)._widget_(aWidget);
  1409. _st($2)._label_(aString);
  1410. $3=_st($2)._yourself();
  1411. $1=$3;
  1412. return $1;
  1413. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTabWidget.klass)})},
  1414. args: ["aWidget", "aString"],
  1415. source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
  1416. messageSends: ["widget:", "new", "label:", "yourself"],
  1417. referencedClasses: []
  1418. }),
  1419. smalltalk.HLTabWidget.klass);
  1420. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  1421. smalltalk.HLWidget.comment="I am the abstract superclass of all Helios widgets.\x0a\x0aI provide common methods, additional behavior to widgets useful for Helios, like dialog creation, command execution and tab creation.\x0a\x0a## API\x0a\x0a1. Rendering\x0a\x0a Instead of overriding `#renderOn:` as with other Widget subclasses, my subclasses should override `#renderContentOn:`.\x0a\x0a2. Refreshing\x0a\x0a To re-render a widget, use `#refresh`.\x0a\x0a3. Key bindings registration and tabs\x0a\x0a When displayed as a tab, the widget has a chance to register keybindings with the `#registerBindingsOn:` hook method.\x0a \x0a4. Unregistration\x0a\x0a When a widget has subscribed to announcements or other actions that need to be cleared when closing the tab, the hook method `#unregister` will be called by helios.\x0a\x0a5. Tabs\x0a\x0a To enable a widget class to be open as a tab, override the class-side `#canBeOpenAsTab` method to answer `true`. `#tabClass` and `#tabPriority` can be overridden too to respectively change the css class of the tab and the order of tabs in the main menu.\x0a\x0a6. Command execution\x0a\x0a An helios command (instance of `HLCommand` or one of its subclass) can be executed with `#execute:`.";
  1422. smalltalk.addMethod(
  1423. smalltalk.method({
  1424. selector: "alert:",
  1425. category: 'actions',
  1426. fn: function (aString){
  1427. var self=this;
  1428. return smalltalk.withContext(function($ctx1) {
  1429. _st(window)._alert_(aString);
  1430. return self}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.HLWidget)})},
  1431. args: ["aString"],
  1432. source: "alert: aString\x0a\x09window alert: aString",
  1433. messageSends: ["alert:"],
  1434. referencedClasses: []
  1435. }),
  1436. smalltalk.HLWidget);
  1437. smalltalk.addMethod(
  1438. smalltalk.method({
  1439. selector: "bindKeyDown:up:",
  1440. category: 'keybindings',
  1441. fn: function (keyDownBlock,keyUpBlock){
  1442. var self=this;
  1443. return smalltalk.withContext(function($ctx1) {
  1444. var $1,$2;
  1445. $1=_st(self._wrapper())._asJQuery();
  1446. _st($1)._keydown_(keyDownBlock);
  1447. $2=_st($1)._keyup_(keyUpBlock);
  1448. return self}, function($ctx1) {$ctx1.fill(self,"bindKeyDown:up:",{keyDownBlock:keyDownBlock,keyUpBlock:keyUpBlock},smalltalk.HLWidget)})},
  1449. args: ["keyDownBlock", "keyUpBlock"],
  1450. source: "bindKeyDown: keyDownBlock up: keyUpBlock\x0a\x09self wrapper asJQuery\x0a\x09\x09keydown: keyDownBlock;\x0a\x09\x09keyup: keyUpBlock ",
  1451. messageSends: ["keydown:", "asJQuery", "wrapper", "keyup:"],
  1452. referencedClasses: []
  1453. }),
  1454. smalltalk.HLWidget);
  1455. smalltalk.addMethod(
  1456. smalltalk.method({
  1457. selector: "canHaveFocus",
  1458. category: 'testing',
  1459. fn: function (){
  1460. var self=this;
  1461. return smalltalk.withContext(function($ctx1) {
  1462. return false;
  1463. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWidget)})},
  1464. args: [],
  1465. source: "canHaveFocus\x0a\x09^ false",
  1466. messageSends: [],
  1467. referencedClasses: []
  1468. }),
  1469. smalltalk.HLWidget);
  1470. smalltalk.addMethod(
  1471. smalltalk.method({
  1472. selector: "confirm:ifTrue:",
  1473. category: 'actions',
  1474. fn: function (aString,aBlock){
  1475. var self=this;
  1476. return smalltalk.withContext(function($ctx1) {
  1477. _st(self._manager())._confirm_ifTrue_(aString,aBlock);
  1478. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  1479. args: ["aString", "aBlock"],
  1480. source: "confirm: aString ifTrue: aBlock\x0a\x09self manager confirm: aString ifTrue: aBlock",
  1481. messageSends: ["confirm:ifTrue:", "manager"],
  1482. referencedClasses: []
  1483. }),
  1484. smalltalk.HLWidget);
  1485. smalltalk.addMethod(
  1486. smalltalk.method({
  1487. selector: "execute:",
  1488. category: 'actions',
  1489. fn: function (aCommand){
  1490. var self=this;
  1491. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1492. return smalltalk.withContext(function($ctx1) {
  1493. var $1,$2;
  1494. $1=_st(_st($HLManager())._current())._keyBinder();
  1495. _st($1)._activate();
  1496. $2=_st($1)._applyBinding_(_st(aCommand)._asBinding());
  1497. return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aCommand:aCommand},smalltalk.HLWidget)})},
  1498. args: ["aCommand"],
  1499. source: "execute: aCommand\x0a\x09HLManager current keyBinder\x0a\x09\x09activate;\x0a\x09\x09applyBinding: aCommand asBinding",
  1500. messageSends: ["activate", "keyBinder", "current", "applyBinding:", "asBinding"],
  1501. referencedClasses: ["HLManager"]
  1502. }),
  1503. smalltalk.HLWidget);
  1504. smalltalk.addMethod(
  1505. smalltalk.method({
  1506. selector: "manager",
  1507. category: 'accessing',
  1508. fn: function (){
  1509. var self=this;
  1510. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1511. return smalltalk.withContext(function($ctx1) {
  1512. var $1;
  1513. $1=_st($HLManager())._current();
  1514. return $1;
  1515. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLWidget)})},
  1516. args: [],
  1517. source: "manager\x0a\x09^ HLManager current",
  1518. messageSends: ["current"],
  1519. referencedClasses: ["HLManager"]
  1520. }),
  1521. smalltalk.HLWidget);
  1522. smalltalk.addMethod(
  1523. smalltalk.method({
  1524. selector: "openAsTab",
  1525. category: 'actions',
  1526. fn: function (){
  1527. var self=this;
  1528. function $HLTabWidget(){return smalltalk.HLTabWidget||(typeof HLTabWidget=="undefined"?nil:HLTabWidget)}
  1529. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1530. return smalltalk.withContext(function($ctx1) {
  1531. _st(_st($HLManager())._current())._addTab_(_st($HLTabWidget())._on_labelled_(self,_st(self._class())._tabLabel()));
  1532. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},smalltalk.HLWidget)})},
  1533. args: [],
  1534. source: "openAsTab\x0a\x09HLManager current addTab: (HLTabWidget on: self labelled: self class tabLabel)",
  1535. messageSends: ["addTab:", "on:labelled:", "tabLabel", "class", "current"],
  1536. referencedClasses: ["HLTabWidget", "HLManager"]
  1537. }),
  1538. smalltalk.HLWidget);
  1539. smalltalk.addMethod(
  1540. smalltalk.method({
  1541. selector: "refresh",
  1542. category: 'updating',
  1543. fn: function (){
  1544. var self=this;
  1545. return smalltalk.withContext(function($ctx1) {
  1546. var $1,$2;
  1547. $1=self._wrapper();
  1548. if(($receiver = $1) == nil || $receiver == undefined){
  1549. $2=self;
  1550. return $2;
  1551. } else {
  1552. $1;
  1553. };
  1554. _st(_st(self._wrapper())._asJQuery())._empty();
  1555. _st((function(html){
  1556. return smalltalk.withContext(function($ctx2) {
  1557. return self._renderContentOn_(html);
  1558. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(self._wrapper())._asJQuery());
  1559. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLWidget)})},
  1560. args: [],
  1561. source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
  1562. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
  1563. referencedClasses: []
  1564. }),
  1565. smalltalk.HLWidget);
  1566. smalltalk.addMethod(
  1567. smalltalk.method({
  1568. selector: "registerBindings",
  1569. category: 'keybindings',
  1570. fn: function (){
  1571. var self=this;
  1572. return smalltalk.withContext(function($ctx1) {
  1573. self._registerBindingsOn_(_st(_st(self._manager())._keyBinder())._bindings());
  1574. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLWidget)})},
  1575. args: [],
  1576. source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
  1577. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
  1578. referencedClasses: []
  1579. }),
  1580. smalltalk.HLWidget);
  1581. smalltalk.addMethod(
  1582. smalltalk.method({
  1583. selector: "registerBindingsOn:",
  1584. category: 'keybindings',
  1585. fn: function (aBindingGroup){
  1586. var self=this;
  1587. return smalltalk.withContext(function($ctx1) {
  1588. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLWidget)})},
  1589. args: ["aBindingGroup"],
  1590. source: "registerBindingsOn: aBindingGroup",
  1591. messageSends: [],
  1592. referencedClasses: []
  1593. }),
  1594. smalltalk.HLWidget);
  1595. smalltalk.addMethod(
  1596. smalltalk.method({
  1597. selector: "renderContentOn:",
  1598. category: 'rendering',
  1599. fn: function (html){
  1600. var self=this;
  1601. return smalltalk.withContext(function($ctx1) {
  1602. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWidget)})},
  1603. args: ["html"],
  1604. source: "renderContentOn: html",
  1605. messageSends: [],
  1606. referencedClasses: []
  1607. }),
  1608. smalltalk.HLWidget);
  1609. smalltalk.addMethod(
  1610. smalltalk.method({
  1611. selector: "renderOn:",
  1612. category: 'rendering',
  1613. fn: function (html){
  1614. var self=this;
  1615. return smalltalk.withContext(function($ctx1) {
  1616. self["@wrapper"]=_st(html)._div();
  1617. _st((function(renderer){
  1618. return smalltalk.withContext(function($ctx2) {
  1619. return self._renderContentOn_(renderer);
  1620. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  1621. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLWidget)})},
  1622. args: ["html"],
  1623. source: "renderOn: html\x0a\x09wrapper := html div.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
  1624. messageSends: ["div", "appendToJQuery:", "asJQuery", "renderContentOn:"],
  1625. referencedClasses: []
  1626. }),
  1627. smalltalk.HLWidget);
  1628. smalltalk.addMethod(
  1629. smalltalk.method({
  1630. selector: "request:do:",
  1631. category: 'actions',
  1632. fn: function (aString,aBlock){
  1633. var self=this;
  1634. return smalltalk.withContext(function($ctx1) {
  1635. _st(self._manager())._request_do_(aString,aBlock);
  1636. return self}, function($ctx1) {$ctx1.fill(self,"request:do:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  1637. args: ["aString", "aBlock"],
  1638. source: "request: aString do: aBlock\x0a\x09self manager request: aString do: aBlock",
  1639. messageSends: ["request:do:", "manager"],
  1640. referencedClasses: []
  1641. }),
  1642. smalltalk.HLWidget);
  1643. smalltalk.addMethod(
  1644. smalltalk.method({
  1645. selector: "request:value:do:",
  1646. category: 'actions',
  1647. fn: function (aString,valueString,aBlock){
  1648. var self=this;
  1649. return smalltalk.withContext(function($ctx1) {
  1650. _st(self._manager())._request_value_do_(aString,valueString,aBlock);
  1651. return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},smalltalk.HLWidget)})},
  1652. args: ["aString", "valueString", "aBlock"],
  1653. source: "request: aString value: valueString do: aBlock\x0a\x09self manager \x0a\x09\x09request: aString \x0a\x09\x09value: valueString\x0a\x09\x09do: aBlock",
  1654. messageSends: ["request:value:do:", "manager"],
  1655. referencedClasses: []
  1656. }),
  1657. smalltalk.HLWidget);
  1658. smalltalk.addMethod(
  1659. smalltalk.method({
  1660. selector: "tabClass",
  1661. category: 'accessing',
  1662. fn: function (){
  1663. var self=this;
  1664. return smalltalk.withContext(function($ctx1) {
  1665. var $1;
  1666. $1=_st(self._class())._tabClass();
  1667. return $1;
  1668. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWidget)})},
  1669. args: [],
  1670. source: "tabClass\x0a\x09^ self class tabClass",
  1671. messageSends: ["tabClass", "class"],
  1672. referencedClasses: []
  1673. }),
  1674. smalltalk.HLWidget);
  1675. smalltalk.addMethod(
  1676. smalltalk.method({
  1677. selector: "unbindKeyDownUp",
  1678. category: 'keybindings',
  1679. fn: function (){
  1680. var self=this;
  1681. return smalltalk.withContext(function($ctx1) {
  1682. var $1,$2;
  1683. $1=_st(self._wrapper())._asJQuery();
  1684. _st($1)._unbind_("keydown");
  1685. $2=_st($1)._unbind_("keyup");
  1686. return self}, function($ctx1) {$ctx1.fill(self,"unbindKeyDownUp",{},smalltalk.HLWidget)})},
  1687. args: [],
  1688. source: "unbindKeyDownUp\x0a\x09self wrapper asJQuery\x0a\x09\x09unbind: 'keydown';\x0a\x09\x09unbind: 'keyup'",
  1689. messageSends: ["unbind:", "asJQuery", "wrapper"],
  1690. referencedClasses: []
  1691. }),
  1692. smalltalk.HLWidget);
  1693. smalltalk.addMethod(
  1694. smalltalk.method({
  1695. selector: "unregister",
  1696. category: 'actions',
  1697. fn: function (){
  1698. var self=this;
  1699. return smalltalk.withContext(function($ctx1) {
  1700. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWidget)})},
  1701. args: [],
  1702. 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",
  1703. messageSends: [],
  1704. referencedClasses: []
  1705. }),
  1706. smalltalk.HLWidget);
  1707. smalltalk.addMethod(
  1708. smalltalk.method({
  1709. selector: "wrapper",
  1710. category: 'accessing',
  1711. fn: function (){
  1712. var self=this;
  1713. return smalltalk.withContext(function($ctx1) {
  1714. var $1;
  1715. $1=self["@wrapper"];
  1716. return $1;
  1717. }, function($ctx1) {$ctx1.fill(self,"wrapper",{},smalltalk.HLWidget)})},
  1718. args: [],
  1719. source: "wrapper\x0a\x09^ wrapper",
  1720. messageSends: [],
  1721. referencedClasses: []
  1722. }),
  1723. smalltalk.HLWidget);
  1724. smalltalk.addMethod(
  1725. smalltalk.method({
  1726. selector: "canBeOpenAsTab",
  1727. category: 'testing',
  1728. fn: function (){
  1729. var self=this;
  1730. return smalltalk.withContext(function($ctx1) {
  1731. return false;
  1732. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWidget.klass)})},
  1733. args: [],
  1734. source: "canBeOpenAsTab\x0a\x09^ false",
  1735. messageSends: [],
  1736. referencedClasses: []
  1737. }),
  1738. smalltalk.HLWidget.klass);
  1739. smalltalk.addMethod(
  1740. smalltalk.method({
  1741. selector: "openAsTab",
  1742. category: 'accessing',
  1743. fn: function (){
  1744. var self=this;
  1745. function $HLTabWidget(){return smalltalk.HLTabWidget||(typeof HLTabWidget=="undefined"?nil:HLTabWidget)}
  1746. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1747. return smalltalk.withContext(function($ctx1) {
  1748. _st(_st($HLManager())._current())._addTab_(_st($HLTabWidget())._on_labelled_(self._new(),self._tabLabel()));
  1749. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},smalltalk.HLWidget.klass)})},
  1750. args: [],
  1751. source: "openAsTab\x0a\x09HLManager current addTab: (HLTabWidget on: self new labelled: self tabLabel)",
  1752. messageSends: ["addTab:", "on:labelled:", "new", "tabLabel", "current"],
  1753. referencedClasses: ["HLTabWidget", "HLManager"]
  1754. }),
  1755. smalltalk.HLWidget.klass);
  1756. smalltalk.addMethod(
  1757. smalltalk.method({
  1758. selector: "tabClass",
  1759. category: 'accessing',
  1760. fn: function (){
  1761. var self=this;
  1762. return smalltalk.withContext(function($ctx1) {
  1763. return "";
  1764. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWidget.klass)})},
  1765. args: [],
  1766. source: "tabClass\x0a\x09^ ''",
  1767. messageSends: [],
  1768. referencedClasses: []
  1769. }),
  1770. smalltalk.HLWidget.klass);
  1771. smalltalk.addMethod(
  1772. smalltalk.method({
  1773. selector: "tabLabel",
  1774. category: 'accessing',
  1775. fn: function (){
  1776. var self=this;
  1777. return smalltalk.withContext(function($ctx1) {
  1778. return "Tab";
  1779. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWidget.klass)})},
  1780. args: [],
  1781. source: "tabLabel\x0a\x09^ 'Tab'",
  1782. messageSends: [],
  1783. referencedClasses: []
  1784. }),
  1785. smalltalk.HLWidget.klass);
  1786. smalltalk.addMethod(
  1787. smalltalk.method({
  1788. selector: "tabPriority",
  1789. category: 'accessing',
  1790. fn: function (){
  1791. var self=this;
  1792. return smalltalk.withContext(function($ctx1) {
  1793. return (500);
  1794. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWidget.klass)})},
  1795. args: [],
  1796. source: "tabPriority\x0a\x09^ 500",
  1797. messageSends: [],
  1798. referencedClasses: []
  1799. }),
  1800. smalltalk.HLWidget.klass);
  1801. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, [], 'Helios-Core');
  1802. smalltalk.HLFocusableWidget.comment="I am a widget that can be focused.\x0a\x0a## API \x0a\x0aInstead of overriding `#renderOn:` as with other `Widget` subclasses, my subclasses should override `#renderContentOn:`.\x0a\x0aTo bring the focus to the widget, use the `#focus` method.";
  1803. smalltalk.addMethod(
  1804. smalltalk.method({
  1805. selector: "blur",
  1806. category: 'events',
  1807. fn: function (){
  1808. var self=this;
  1809. return smalltalk.withContext(function($ctx1) {
  1810. _st(_st(self._wrapper())._asJQuery())._blur();
  1811. return self}, function($ctx1) {$ctx1.fill(self,"blur",{},smalltalk.HLFocusableWidget)})},
  1812. args: [],
  1813. source: "blur\x0a\x09self wrapper asJQuery blur",
  1814. messageSends: ["blur", "asJQuery", "wrapper"],
  1815. referencedClasses: []
  1816. }),
  1817. smalltalk.HLFocusableWidget);
  1818. smalltalk.addMethod(
  1819. smalltalk.method({
  1820. selector: "canHaveFocus",
  1821. category: 'testing',
  1822. fn: function (){
  1823. var self=this;
  1824. return smalltalk.withContext(function($ctx1) {
  1825. return true;
  1826. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLFocusableWidget)})},
  1827. args: [],
  1828. source: "canHaveFocus\x0a\x09^ true",
  1829. messageSends: [],
  1830. referencedClasses: []
  1831. }),
  1832. smalltalk.HLFocusableWidget);
  1833. smalltalk.addMethod(
  1834. smalltalk.method({
  1835. selector: "focus",
  1836. category: 'events',
  1837. fn: function (){
  1838. var self=this;
  1839. return smalltalk.withContext(function($ctx1) {
  1840. _st(_st(self._wrapper())._asJQuery())._focus();
  1841. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLFocusableWidget)})},
  1842. args: [],
  1843. source: "focus\x0a\x09self wrapper asJQuery focus",
  1844. messageSends: ["focus", "asJQuery", "wrapper"],
  1845. referencedClasses: []
  1846. }),
  1847. smalltalk.HLFocusableWidget);
  1848. smalltalk.addMethod(
  1849. smalltalk.method({
  1850. selector: "focusClass",
  1851. category: 'accessing',
  1852. fn: function (){
  1853. var self=this;
  1854. return smalltalk.withContext(function($ctx1) {
  1855. return "focused";
  1856. }, function($ctx1) {$ctx1.fill(self,"focusClass",{},smalltalk.HLFocusableWidget)})},
  1857. args: [],
  1858. source: "focusClass\x0a\x09^ 'focused'",
  1859. messageSends: [],
  1860. referencedClasses: []
  1861. }),
  1862. smalltalk.HLFocusableWidget);
  1863. smalltalk.addMethod(
  1864. smalltalk.method({
  1865. selector: "hasFocus",
  1866. category: 'testing',
  1867. fn: function (){
  1868. var self=this;
  1869. return smalltalk.withContext(function($ctx1) {
  1870. var $1;
  1871. $1=_st(_st(self._wrapper())._notNil())._and_((function(){
  1872. return smalltalk.withContext(function($ctx2) {
  1873. return _st(_st(self._wrapper())._asJQuery())._hasClass_(self._focusClass());
  1874. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1875. return $1;
  1876. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLFocusableWidget)})},
  1877. args: [],
  1878. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery hasClass: self focusClass ]",
  1879. messageSends: ["and:", "hasClass:", "focusClass", "asJQuery", "wrapper", "notNil"],
  1880. referencedClasses: []
  1881. }),
  1882. smalltalk.HLFocusableWidget);
  1883. smalltalk.addMethod(
  1884. smalltalk.method({
  1885. selector: "renderContentOn:",
  1886. category: 'rendering',
  1887. fn: function (html){
  1888. var self=this;
  1889. return smalltalk.withContext(function($ctx1) {
  1890. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLFocusableWidget)})},
  1891. args: ["html"],
  1892. source: "renderContentOn: html",
  1893. messageSends: [],
  1894. referencedClasses: []
  1895. }),
  1896. smalltalk.HLFocusableWidget);
  1897. smalltalk.addMethod(
  1898. smalltalk.method({
  1899. selector: "renderOn:",
  1900. category: 'rendering',
  1901. fn: function (html){
  1902. var self=this;
  1903. return smalltalk.withContext(function($ctx1) {
  1904. var $1,$2,$3,$4;
  1905. $1=_st(html)._div();
  1906. _st($1)._class_("hl_widget");
  1907. $2=_st($1)._yourself();
  1908. self["@wrapper"]=$2;
  1909. _st(self["@wrapper"])._with_((function(){
  1910. return smalltalk.withContext(function($ctx2) {
  1911. return self._renderContentOn_(html);
  1912. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1913. $3=self["@wrapper"];
  1914. _st($3)._at_put_("tabindex","0");
  1915. _st($3)._onBlur_((function(){
  1916. return smalltalk.withContext(function($ctx2) {
  1917. return _st(_st(self._wrapper())._asJQuery())._removeClass_(self._focusClass());
  1918. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1919. $4=_st($3)._onFocus_((function(){
  1920. return smalltalk.withContext(function($ctx2) {
  1921. return _st(_st(self._wrapper())._asJQuery())._addClass_(self._focusClass());
  1922. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1923. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLFocusableWidget)})},
  1924. args: ["html"],
  1925. source: "renderOn: html\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 ]",
  1926. messageSends: ["class:", "div", "yourself", "with:", "renderContentOn:", "at:put:", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"],
  1927. referencedClasses: []
  1928. }),
  1929. smalltalk.HLFocusableWidget);
  1930. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem', 'mapping'], 'Helios-Core');
  1931. smalltalk.addMethod(
  1932. smalltalk.method({
  1933. selector: "activateFirstListItem",
  1934. category: 'actions',
  1935. fn: function (){
  1936. var self=this;
  1937. return smalltalk.withContext(function($ctx1) {
  1938. self._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li.inactive"))._get_((0))));
  1939. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{},smalltalk.HLListWidget)})},
  1940. args: [],
  1941. source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li.inactive') get: 0))",
  1942. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
  1943. referencedClasses: []
  1944. }),
  1945. smalltalk.HLListWidget);
  1946. smalltalk.addMethod(
  1947. smalltalk.method({
  1948. selector: "activateItem:",
  1949. category: 'actions',
  1950. fn: function (anObject){
  1951. var self=this;
  1952. return smalltalk.withContext(function($ctx1) {
  1953. var $1;
  1954. var $early={};
  1955. try {
  1956. self._activateListItem_(_st(_st(self["@mapping"])._at_ifAbsent_(anObject,(function(){
  1957. return smalltalk.withContext(function($ctx2) {
  1958. $1=self;
  1959. throw $early=[$1];
  1960. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  1961. return self}
  1962. catch(e) {if(e===$early)return e[0]; throw e}
  1963. }, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  1964. args: ["anObject"],
  1965. source: "activateItem: anObject\x0a\x09self activateListItem: (mapping \x0a\x09\x09at: anObject\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  1966. messageSends: ["activateListItem:", "asJQuery", "at:ifAbsent:"],
  1967. referencedClasses: []
  1968. }),
  1969. smalltalk.HLListWidget);
  1970. smalltalk.addMethod(
  1971. smalltalk.method({
  1972. selector: "activateListItem:",
  1973. category: 'actions',
  1974. fn: function (aListItem){
  1975. var self=this;
  1976. var item;
  1977. return smalltalk.withContext(function($ctx1) {
  1978. var $1,$2,$3;
  1979. $1=_st(aListItem)._get_((0));
  1980. if(($receiver = $1) == nil || $receiver == undefined){
  1981. $2=self;
  1982. return $2;
  1983. } else {
  1984. $1;
  1985. };
  1986. _st(_st(_st(aListItem)._parent())._children())._removeClass_("active");
  1987. _st(aListItem)._addClass_("active");
  1988. self._ensureVisible_(aListItem);
  1989. item=_st(self._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber());
  1990. $3=_st(self._selectedItem()).__eq_eq(item);
  1991. if(! smalltalk.assert($3)){
  1992. self._selectItem_(item);
  1993. };
  1994. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.HLListWidget)})},
  1995. args: ["aListItem"],
  1996. source: "activateListItem: aListItem\x0a\x09| item |\x0a\x09\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 ]",
  1997. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "addClass:", "ensureVisible:", "at:", "asNumber", "attr:", "items", "ifFalse:", "selectItem:", "==", "selectedItem"],
  1998. referencedClasses: []
  1999. }),
  2000. smalltalk.HLListWidget);
  2001. smalltalk.addMethod(
  2002. smalltalk.method({
  2003. selector: "activateNextListItem",
  2004. category: 'actions',
  2005. fn: function (){
  2006. var self=this;
  2007. return smalltalk.withContext(function($ctx1) {
  2008. self._activateListItem_(_st(_st(_st(self._wrapper())._asJQuery())._find_("li.active"))._next());
  2009. _st(_st(_st(_st(self._wrapper())._asJQuery())._find_(" .active"))._get())._ifEmpty_((function(){
  2010. return smalltalk.withContext(function($ctx2) {
  2011. return self._activateFirstListItem();
  2012. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2013. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)})},
  2014. args: [],
  2015. source: "activateNextListItem\x0a\x09self activateListItem: (self wrapper asJQuery find: 'li.active') next.\x0a\x09\x0a\x09\x22select the first item if none is selected\x22\x0a\x09(self wrapper asJQuery find: ' .active') get ifEmpty: [\x0a\x09\x09self activateFirstListItem ]",
  2016. messageSends: ["activateListItem:", "next", "find:", "asJQuery", "wrapper", "ifEmpty:", "activateFirstListItem", "get"],
  2017. referencedClasses: []
  2018. }),
  2019. smalltalk.HLListWidget);
  2020. smalltalk.addMethod(
  2021. smalltalk.method({
  2022. selector: "activatePreviousListItem",
  2023. category: 'actions',
  2024. fn: function (){
  2025. var self=this;
  2026. return smalltalk.withContext(function($ctx1) {
  2027. self._activateListItem_(_st(_st(_st(self._wrapper())._asJQuery())._find_("li.active"))._prev());
  2028. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)})},
  2029. args: [],
  2030. source: "activatePreviousListItem\x0a\x09self activateListItem: (self wrapper asJQuery find: 'li.active') prev",
  2031. messageSends: ["activateListItem:", "prev", "find:", "asJQuery", "wrapper"],
  2032. referencedClasses: []
  2033. }),
  2034. smalltalk.HLListWidget);
  2035. smalltalk.addMethod(
  2036. smalltalk.method({
  2037. selector: "cssClassForItem:",
  2038. category: 'accessing',
  2039. fn: function (anObject){
  2040. var self=this;
  2041. return smalltalk.withContext(function($ctx1) {
  2042. return "";
  2043. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2044. args: ["anObject"],
  2045. source: "cssClassForItem: anObject\x0a\x09^ ''",
  2046. messageSends: [],
  2047. referencedClasses: []
  2048. }),
  2049. smalltalk.HLListWidget);
  2050. smalltalk.addMethod(
  2051. smalltalk.method({
  2052. selector: "defaultItems",
  2053. category: 'defaults',
  2054. fn: function (){
  2055. var self=this;
  2056. return smalltalk.withContext(function($ctx1) {
  2057. var $1;
  2058. $1=[];
  2059. return $1;
  2060. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLListWidget)})},
  2061. args: [],
  2062. source: "defaultItems\x0a\x09^ #()",
  2063. messageSends: [],
  2064. referencedClasses: []
  2065. }),
  2066. smalltalk.HLListWidget);
  2067. smalltalk.addMethod(
  2068. smalltalk.method({
  2069. selector: "ensureVisible:",
  2070. category: 'actions',
  2071. fn: function (aListItem){
  2072. var self=this;
  2073. var perent,position;
  2074. return smalltalk.withContext(function($ctx1) {
  2075. var $1,$2;
  2076. position=self._positionOf_(aListItem);
  2077. parent=_st(aListItem)._parent();
  2078. $1=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  2079. if(smalltalk.assert($1)){
  2080. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  2081. };
  2082. $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  2083. if(smalltalk.assert($2)){
  2084. _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)));
  2085. };
  2086. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
  2087. args: ["aListItem"],
  2088. 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 ]",
  2089. messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"],
  2090. referencedClasses: []
  2091. }),
  2092. smalltalk.HLListWidget);
  2093. smalltalk.addMethod(
  2094. smalltalk.method({
  2095. selector: "focus",
  2096. category: 'actions',
  2097. fn: function (){
  2098. var self=this;
  2099. return smalltalk.withContext(function($ctx1) {
  2100. var $1,$2;
  2101. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  2102. $1=_st(self._items())._isEmpty();
  2103. if(! smalltalk.assert($1)){
  2104. $2=self._selectedItem();
  2105. if(($receiver = $2) == nil || $receiver == undefined){
  2106. self._activateFirstListItem();
  2107. } else {
  2108. $2;
  2109. };
  2110. };
  2111. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLListWidget)})},
  2112. args: [],
  2113. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  2114. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  2115. referencedClasses: []
  2116. }),
  2117. smalltalk.HLListWidget);
  2118. smalltalk.addMethod(
  2119. smalltalk.method({
  2120. selector: "initialize",
  2121. category: 'initialization',
  2122. fn: function (){
  2123. var self=this;
  2124. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2125. return smalltalk.withContext(function($ctx1) {
  2126. smalltalk.HLFocusableWidget.fn.prototype._initialize.apply(_st(self), []);
  2127. self["@mapping"]=_st($Dictionary())._new();
  2128. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)})},
  2129. args: [],
  2130. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09mapping := Dictionary new.",
  2131. messageSends: ["initialize", "new"],
  2132. referencedClasses: ["Dictionary"]
  2133. }),
  2134. smalltalk.HLListWidget);
  2135. smalltalk.addMethod(
  2136. smalltalk.method({
  2137. selector: "items",
  2138. category: 'accessing',
  2139. fn: function (){
  2140. var self=this;
  2141. return smalltalk.withContext(function($ctx1) {
  2142. var $2,$1;
  2143. $2=self["@items"];
  2144. if(($receiver = $2) == nil || $receiver == undefined){
  2145. self["@items"]=self._defaultItems();
  2146. $1=self["@items"];
  2147. } else {
  2148. $1=$2;
  2149. };
  2150. return $1;
  2151. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLListWidget)})},
  2152. args: [],
  2153. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  2154. messageSends: ["ifNil:", "defaultItems"],
  2155. referencedClasses: []
  2156. }),
  2157. smalltalk.HLListWidget);
  2158. smalltalk.addMethod(
  2159. smalltalk.method({
  2160. selector: "items:",
  2161. category: 'accessing',
  2162. fn: function (aCollection){
  2163. var self=this;
  2164. return smalltalk.withContext(function($ctx1) {
  2165. self["@items"]=aCollection;
  2166. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection},smalltalk.HLListWidget)})},
  2167. args: ["aCollection"],
  2168. source: "items: aCollection\x0a\x09items := aCollection",
  2169. messageSends: [],
  2170. referencedClasses: []
  2171. }),
  2172. smalltalk.HLListWidget);
  2173. smalltalk.addMethod(
  2174. smalltalk.method({
  2175. selector: "listCssClassForItem:",
  2176. category: 'accessing',
  2177. fn: function (anObject){
  2178. var self=this;
  2179. return smalltalk.withContext(function($ctx1) {
  2180. var $2,$1;
  2181. $2=_st(self._selectedItem()).__eq(anObject);
  2182. if(smalltalk.assert($2)){
  2183. $1="active";
  2184. } else {
  2185. $1="inactive";
  2186. };
  2187. return $1;
  2188. }, function($ctx1) {$ctx1.fill(self,"listCssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2189. args: ["anObject"],
  2190. source: "listCssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09ifFalse: [ 'inactive' ]",
  2191. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  2192. referencedClasses: []
  2193. }),
  2194. smalltalk.HLListWidget);
  2195. smalltalk.addMethod(
  2196. smalltalk.method({
  2197. selector: "positionOf:",
  2198. category: 'accessing',
  2199. fn: function (aListItem){
  2200. var self=this;
  2201. return smalltalk.withContext(function($ctx1) {
  2202. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  2203. ;
  2204. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.HLListWidget)})},
  2205. args: ["aListItem"],
  2206. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  2207. messageSends: [],
  2208. referencedClasses: []
  2209. }),
  2210. smalltalk.HLListWidget);
  2211. smalltalk.addMethod(
  2212. smalltalk.method({
  2213. selector: "refresh",
  2214. category: 'actions',
  2215. fn: function (){
  2216. var self=this;
  2217. return smalltalk.withContext(function($ctx1) {
  2218. var $1;
  2219. var $early={};
  2220. try {
  2221. smalltalk.HLFocusableWidget.fn.prototype._refresh.apply(_st(self), []);
  2222. self._ensureVisible_(_st(_st(self["@mapping"])._at_ifAbsent_(self._selectedItem(),(function(){
  2223. return smalltalk.withContext(function($ctx2) {
  2224. $1=self;
  2225. throw $early=[$1];
  2226. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  2227. return self}
  2228. catch(e) {if(e===$early)return e[0]; throw e}
  2229. }, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLListWidget)})},
  2230. args: [],
  2231. source: "refresh\x0a\x09super refresh.\x0a\x09\x0a\x09self ensureVisible: (mapping \x0a\x09\x09at: self selectedItem\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  2232. messageSends: ["refresh", "ensureVisible:", "asJQuery", "at:ifAbsent:", "selectedItem"],
  2233. referencedClasses: []
  2234. }),
  2235. smalltalk.HLListWidget);
  2236. smalltalk.addMethod(
  2237. smalltalk.method({
  2238. selector: "registerMappingFrom:to:",
  2239. category: 'private',
  2240. fn: function (anObject,aTag){
  2241. var self=this;
  2242. return smalltalk.withContext(function($ctx1) {
  2243. _st(self["@mapping"])._at_put_(anObject,aTag);
  2244. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)})},
  2245. args: ["anObject", "aTag"],
  2246. source: "registerMappingFrom: anObject to: aTag\x0a\x09mapping at: anObject put: aTag",
  2247. messageSends: ["at:put:"],
  2248. referencedClasses: []
  2249. }),
  2250. smalltalk.HLListWidget);
  2251. smalltalk.addMethod(
  2252. smalltalk.method({
  2253. selector: "renderButtonsOn:",
  2254. category: 'rendering',
  2255. fn: function (html){
  2256. var self=this;
  2257. return smalltalk.withContext(function($ctx1) {
  2258. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLListWidget)})},
  2259. args: ["html"],
  2260. source: "renderButtonsOn: html",
  2261. messageSends: [],
  2262. referencedClasses: []
  2263. }),
  2264. smalltalk.HLListWidget);
  2265. smalltalk.addMethod(
  2266. smalltalk.method({
  2267. selector: "renderContentOn:",
  2268. category: 'rendering',
  2269. fn: function (html){
  2270. var self=this;
  2271. return smalltalk.withContext(function($ctx1) {
  2272. var $1,$2,$3,$4;
  2273. $1=_st(html)._ul();
  2274. _st($1)._class_("nav nav-pills nav-stacked");
  2275. $2=_st($1)._with_((function(){
  2276. return smalltalk.withContext(function($ctx2) {
  2277. return self._renderListOn_(html);
  2278. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2279. $3=_st(html)._div();
  2280. _st($3)._class_("pane_actions form-actions");
  2281. $4=_st($3)._with_((function(){
  2282. return smalltalk.withContext(function($ctx2) {
  2283. return self._renderButtonsOn_(html);
  2284. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2285. self._setupKeyBindings();
  2286. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLListWidget)})},
  2287. args: ["html"],
  2288. 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",
  2289. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  2290. referencedClasses: []
  2291. }),
  2292. smalltalk.HLListWidget);
  2293. smalltalk.addMethod(
  2294. smalltalk.method({
  2295. selector: "renderItem:on:",
  2296. category: 'rendering',
  2297. fn: function (anObject,html){
  2298. var self=this;
  2299. var li;
  2300. return smalltalk.withContext(function($ctx1) {
  2301. var $1,$3,$4,$2;
  2302. li=_st(html)._li();
  2303. self._registerMappingFrom_to_(anObject,li);
  2304. $1=li;
  2305. _st($1)._at_put_("list-data",_st(_st(self._items())._indexOf_(anObject))._asString());
  2306. _st($1)._class_(self._listCssClassForItem_(anObject));
  2307. $2=_st($1)._with_((function(){
  2308. return smalltalk.withContext(function($ctx2) {
  2309. $3=_st(html)._a();
  2310. _st($3)._with_((function(){
  2311. return smalltalk.withContext(function($ctx3) {
  2312. _st(_st(html)._tag_("i"))._class_(self._cssClassForItem_(anObject));
  2313. return self._renderItemLabel_on_(anObject,html);
  2314. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2315. $4=_st($3)._onClick_((function(){
  2316. return smalltalk.withContext(function($ctx3) {
  2317. return self._activateListItem_(_st(li)._asJQuery());
  2318. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2319. return $4;
  2320. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2321. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)})},
  2322. args: ["anObject", "html"],
  2323. source: "renderItem: anObject on: html\x0a\x09| li |\x0a \x0a\x09li := html li.\x0a\x09self registerMappingFrom: anObject to: li.\x0a\x09\x0a li\x0a at: 'list-data' put: (self items indexOf: anObject) asString;\x0a\x09\x09class: (self listCssClassForItem: anObject);\x0a with: [ \x0a \x09html a\x0a \x09with: [ \x0a \x09\x09(html tag: 'i') class: (self cssClassForItem: anObject).\x0a \x09\x09\x09\x09\x09self renderItemLabel: anObject on: html ];\x0a\x09\x09\x09\x09onClick: [\x0a \x09self activateListItem: li asJQuery ] ]",
  2324. messageSends: ["li", "registerMappingFrom:to:", "at:put:", "asString", "indexOf:", "items", "class:", "listCssClassForItem:", "with:", "cssClassForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  2325. referencedClasses: []
  2326. }),
  2327. smalltalk.HLListWidget);
  2328. smalltalk.addMethod(
  2329. smalltalk.method({
  2330. selector: "renderItemLabel:on:",
  2331. category: 'rendering',
  2332. fn: function (anObject,html){
  2333. var self=this;
  2334. return smalltalk.withContext(function($ctx1) {
  2335. _st(html)._with_(_st(anObject)._asString());
  2336. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},smalltalk.HLListWidget)})},
  2337. args: ["anObject", "html"],
  2338. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  2339. messageSends: ["with:", "asString"],
  2340. referencedClasses: []
  2341. }),
  2342. smalltalk.HLListWidget);
  2343. smalltalk.addMethod(
  2344. smalltalk.method({
  2345. selector: "renderListOn:",
  2346. category: 'rendering',
  2347. fn: function (html){
  2348. var self=this;
  2349. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2350. return smalltalk.withContext(function($ctx1) {
  2351. self["@mapping"]=_st($Dictionary())._new();
  2352. _st(self._items())._do_((function(each){
  2353. return smalltalk.withContext(function($ctx2) {
  2354. return self._renderItem_on_(each,html);
  2355. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2356. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)})},
  2357. args: ["html"],
  2358. source: "renderListOn: html\x0a\x09mapping := Dictionary new.\x0a\x09\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  2359. messageSends: ["new", "do:", "renderItem:on:", "items"],
  2360. referencedClasses: ["Dictionary"]
  2361. }),
  2362. smalltalk.HLListWidget);
  2363. smalltalk.addMethod(
  2364. smalltalk.method({
  2365. selector: "selectItem:",
  2366. category: 'actions',
  2367. fn: function (anObject){
  2368. var self=this;
  2369. return smalltalk.withContext(function($ctx1) {
  2370. self._selectedItem_(anObject);
  2371. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2372. args: ["anObject"],
  2373. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  2374. messageSends: ["selectedItem:"],
  2375. referencedClasses: []
  2376. }),
  2377. smalltalk.HLListWidget);
  2378. smalltalk.addMethod(
  2379. smalltalk.method({
  2380. selector: "selectedItem",
  2381. category: 'accessing',
  2382. fn: function (){
  2383. var self=this;
  2384. return smalltalk.withContext(function($ctx1) {
  2385. var $1;
  2386. $1=self["@selectedItem"];
  2387. return $1;
  2388. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLListWidget)})},
  2389. args: [],
  2390. source: "selectedItem\x0a\x09^ selectedItem",
  2391. messageSends: [],
  2392. referencedClasses: []
  2393. }),
  2394. smalltalk.HLListWidget);
  2395. smalltalk.addMethod(
  2396. smalltalk.method({
  2397. selector: "selectedItem:",
  2398. category: 'accessing',
  2399. fn: function (anObject){
  2400. var self=this;
  2401. return smalltalk.withContext(function($ctx1) {
  2402. self["@selectedItem"]=anObject;
  2403. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2404. args: ["anObject"],
  2405. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  2406. messageSends: [],
  2407. referencedClasses: []
  2408. }),
  2409. smalltalk.HLListWidget);
  2410. smalltalk.addMethod(
  2411. smalltalk.method({
  2412. selector: "setupKeyBindings",
  2413. category: 'events',
  2414. fn: function (){
  2415. var self=this;
  2416. function $HLRepeatingKeyBindingHandler(){return smalltalk.HLRepeatingKeyBindingHandler||(typeof HLRepeatingKeyBindingHandler=="undefined"?nil:HLRepeatingKeyBindingHandler)}
  2417. return smalltalk.withContext(function($ctx1) {
  2418. var $1,$2;
  2419. $1=_st($HLRepeatingKeyBindingHandler())._forWidget_(self);
  2420. _st($1)._whileKeyPressed_do_((38),(function(){
  2421. return smalltalk.withContext(function($ctx2) {
  2422. return self._activatePreviousListItem();
  2423. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2424. _st($1)._whileKeyPressed_do_((40),(function(){
  2425. return smalltalk.withContext(function($ctx2) {
  2426. return self._activateNextListItem();
  2427. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2428. $2=_st($1)._rebindKeys();
  2429. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLListWidget)})},
  2430. args: [],
  2431. source: "setupKeyBindings \x0a\x09(HLRepeatingKeyBindingHandler forWidget: self)\x0a\x09\x09whileKeyPressed: 38 do: [ self activatePreviousListItem ];\x0a\x09\x09whileKeyPressed: 40 do: [ self activateNextListItem ];\x0a\x09\x09rebindKeys",
  2432. messageSends: ["whileKeyPressed:do:", "activatePreviousListItem", "forWidget:", "activateNextListItem", "rebindKeys"],
  2433. referencedClasses: ["HLRepeatingKeyBindingHandler"]
  2434. }),
  2435. smalltalk.HLListWidget);
  2436. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  2437. smalltalk.addMethod(
  2438. smalltalk.method({
  2439. selector: "next",
  2440. category: 'accessing',
  2441. fn: function (){
  2442. var self=this;
  2443. return smalltalk.withContext(function($ctx1) {
  2444. var $1;
  2445. $1=self["@next"];
  2446. return $1;
  2447. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.HLNavigationListWidget)})},
  2448. args: [],
  2449. source: "next\x0a\x09^ next",
  2450. messageSends: [],
  2451. referencedClasses: []
  2452. }),
  2453. smalltalk.HLNavigationListWidget);
  2454. smalltalk.addMethod(
  2455. smalltalk.method({
  2456. selector: "next:",
  2457. category: 'accessing',
  2458. fn: function (aWidget){
  2459. var self=this;
  2460. return smalltalk.withContext(function($ctx1) {
  2461. var $1;
  2462. self["@next"]=aWidget;
  2463. $1=_st(_st(aWidget)._previous()).__eq(self);
  2464. if(! smalltalk.assert($1)){
  2465. _st(aWidget)._previous_(self);
  2466. };
  2467. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  2468. args: ["aWidget"],
  2469. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  2470. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  2471. referencedClasses: []
  2472. }),
  2473. smalltalk.HLNavigationListWidget);
  2474. smalltalk.addMethod(
  2475. smalltalk.method({
  2476. selector: "nextFocus",
  2477. category: 'actions',
  2478. fn: function (){
  2479. var self=this;
  2480. return smalltalk.withContext(function($ctx1) {
  2481. var $1;
  2482. $1=self._next();
  2483. if(($receiver = $1) == nil || $receiver == undefined){
  2484. $1;
  2485. } else {
  2486. _st(self._next())._focus();
  2487. };
  2488. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},smalltalk.HLNavigationListWidget)})},
  2489. args: [],
  2490. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  2491. messageSends: ["ifNotNil:", "focus", "next"],
  2492. referencedClasses: []
  2493. }),
  2494. smalltalk.HLNavigationListWidget);
  2495. smalltalk.addMethod(
  2496. smalltalk.method({
  2497. selector: "previous",
  2498. category: 'accessing',
  2499. fn: function (){
  2500. var self=this;
  2501. return smalltalk.withContext(function($ctx1) {
  2502. var $1;
  2503. $1=self["@previous"];
  2504. return $1;
  2505. }, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationListWidget)})},
  2506. args: [],
  2507. source: "previous\x0a\x09^ previous",
  2508. messageSends: [],
  2509. referencedClasses: []
  2510. }),
  2511. smalltalk.HLNavigationListWidget);
  2512. smalltalk.addMethod(
  2513. smalltalk.method({
  2514. selector: "previous:",
  2515. category: 'accessing',
  2516. fn: function (aWidget){
  2517. var self=this;
  2518. return smalltalk.withContext(function($ctx1) {
  2519. var $1;
  2520. self["@previous"]=aWidget;
  2521. $1=_st(_st(aWidget)._next()).__eq(self);
  2522. if(! smalltalk.assert($1)){
  2523. _st(aWidget)._next_(self);
  2524. };
  2525. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  2526. args: ["aWidget"],
  2527. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  2528. messageSends: ["ifFalse:", "next:", "=", "next"],
  2529. referencedClasses: []
  2530. }),
  2531. smalltalk.HLNavigationListWidget);
  2532. smalltalk.addMethod(
  2533. smalltalk.method({
  2534. selector: "previousFocus",
  2535. category: 'actions',
  2536. fn: function (){
  2537. var self=this;
  2538. return smalltalk.withContext(function($ctx1) {
  2539. var $1;
  2540. $1=self._previous();
  2541. if(($receiver = $1) == nil || $receiver == undefined){
  2542. $1;
  2543. } else {
  2544. _st(self._previous())._focus();
  2545. };
  2546. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},smalltalk.HLNavigationListWidget)})},
  2547. args: [],
  2548. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  2549. messageSends: ["ifNotNil:", "focus", "previous"],
  2550. referencedClasses: []
  2551. }),
  2552. smalltalk.HLNavigationListWidget);
  2553. smalltalk.addMethod(
  2554. smalltalk.method({
  2555. selector: "setupKeyBindings",
  2556. category: 'events',
  2557. fn: function (){
  2558. var self=this;
  2559. return smalltalk.withContext(function($ctx1) {
  2560. var $1,$2;
  2561. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  2562. _st(_st(self._wrapper())._asJQuery())._keydown_((function(e){
  2563. return smalltalk.withContext(function($ctx2) {
  2564. $1=_st(_st(e)._which()).__eq((39));
  2565. if(smalltalk.assert($1)){
  2566. self._nextFocus();
  2567. };
  2568. $2=_st(_st(e)._which()).__eq((37));
  2569. if(smalltalk.assert($2)){
  2570. return self._previousFocus();
  2571. };
  2572. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  2573. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLNavigationListWidget)})},
  2574. args: [],
  2575. 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 ] ]",
  2576. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery", "wrapper"],
  2577. referencedClasses: []
  2578. }),
  2579. smalltalk.HLNavigationListWidget);
  2580. smalltalk.addClass('HLToolListWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Core');
  2581. smalltalk.addMethod(
  2582. smalltalk.method({
  2583. selector: "activateListItem:",
  2584. category: 'actions',
  2585. fn: function (anItem){
  2586. var self=this;
  2587. return smalltalk.withContext(function($ctx1) {
  2588. _st(self._model())._withChangesDo_((function(){
  2589. return smalltalk.withContext(function($ctx2) {
  2590. return smalltalk.HLNavigationListWidget.fn.prototype._activateListItem_.apply(_st(self), [anItem]);
  2591. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2592. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{anItem:anItem},smalltalk.HLToolListWidget)})},
  2593. args: ["anItem"],
  2594. source: "activateListItem: anItem\x0a\x09self model withChangesDo: [ super activateListItem: anItem ]",
  2595. messageSends: ["withChangesDo:", "activateListItem:", "model"],
  2596. referencedClasses: []
  2597. }),
  2598. smalltalk.HLToolListWidget);
  2599. smalltalk.addMethod(
  2600. smalltalk.method({
  2601. selector: "activateNextListItem",
  2602. category: 'actions',
  2603. fn: function (){
  2604. var self=this;
  2605. return smalltalk.withContext(function($ctx1) {
  2606. _st(self._model())._withChangesDo_((function(){
  2607. return smalltalk.withContext(function($ctx2) {
  2608. return smalltalk.HLNavigationListWidget.fn.prototype._activateNextListItem.apply(_st(self), []);
  2609. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2610. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLToolListWidget)})},
  2611. args: [],
  2612. source: "activateNextListItem\x0a\x09self model withChangesDo: [ super activateNextListItem ]",
  2613. messageSends: ["withChangesDo:", "activateNextListItem", "model"],
  2614. referencedClasses: []
  2615. }),
  2616. smalltalk.HLToolListWidget);
  2617. smalltalk.addMethod(
  2618. smalltalk.method({
  2619. selector: "activatePreviousListItem",
  2620. category: 'actions',
  2621. fn: function (){
  2622. var self=this;
  2623. return smalltalk.withContext(function($ctx1) {
  2624. _st(self._model())._withChangesDo_((function(){
  2625. return smalltalk.withContext(function($ctx2) {
  2626. return smalltalk.HLNavigationListWidget.fn.prototype._activatePreviousListItem.apply(_st(self), []);
  2627. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2628. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLToolListWidget)})},
  2629. args: [],
  2630. source: "activatePreviousListItem\x0a\x09self model withChangesDo: [ super activatePreviousListItem ]",
  2631. messageSends: ["withChangesDo:", "activatePreviousListItem", "model"],
  2632. referencedClasses: []
  2633. }),
  2634. smalltalk.HLToolListWidget);
  2635. smalltalk.addMethod(
  2636. smalltalk.method({
  2637. selector: "commandCategory",
  2638. category: 'accessing',
  2639. fn: function (){
  2640. var self=this;
  2641. return smalltalk.withContext(function($ctx1) {
  2642. var $1;
  2643. $1=self._label();
  2644. return $1;
  2645. }, function($ctx1) {$ctx1.fill(self,"commandCategory",{},smalltalk.HLToolListWidget)})},
  2646. args: [],
  2647. source: "commandCategory\x0a\x09^ self label",
  2648. messageSends: ["label"],
  2649. referencedClasses: []
  2650. }),
  2651. smalltalk.HLToolListWidget);
  2652. smalltalk.addMethod(
  2653. smalltalk.method({
  2654. selector: "label",
  2655. category: 'accessing',
  2656. fn: function (){
  2657. var self=this;
  2658. return smalltalk.withContext(function($ctx1) {
  2659. return "List";
  2660. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToolListWidget)})},
  2661. args: [],
  2662. source: "label\x0a\x09^ 'List'",
  2663. messageSends: [],
  2664. referencedClasses: []
  2665. }),
  2666. smalltalk.HLToolListWidget);
  2667. smalltalk.addMethod(
  2668. smalltalk.method({
  2669. selector: "menuCommands",
  2670. category: 'accessing',
  2671. fn: function (){
  2672. var self=this;
  2673. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  2674. return smalltalk.withContext(function($ctx1) {
  2675. var $1;
  2676. $1=_st(_st(_st(_st($HLToolCommand())._concreteClasses())._select_((function(each){
  2677. return smalltalk.withContext(function($ctx2) {
  2678. return _st(each)._isValidFor_(self._model());
  2679. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
  2680. return smalltalk.withContext(function($ctx2) {
  2681. return _st(each)._for_(self._model());
  2682. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._select_((function(each){
  2683. return smalltalk.withContext(function($ctx2) {
  2684. return _st(_st(_st(each)._category()).__eq(self._commandCategory()))._and_((function(){
  2685. return smalltalk.withContext(function($ctx3) {
  2686. return _st(_st(each)._isAction())._and_((function(){
  2687. return smalltalk.withContext(function($ctx4) {
  2688. return _st(each)._isActive();
  2689. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  2690. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2691. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2692. return $1;
  2693. }, function($ctx1) {$ctx1.fill(self,"menuCommands",{},smalltalk.HLToolListWidget)})},
  2694. args: [],
  2695. 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 ] ] ]",
  2696. messageSends: ["select:", "and:", "isActive", "isAction", "=", "commandCategory", "category", "collect:", "for:", "model", "isValidFor:", "concreteClasses"],
  2697. referencedClasses: ["HLToolCommand"]
  2698. }),
  2699. smalltalk.HLToolListWidget);
  2700. smalltalk.addMethod(
  2701. smalltalk.method({
  2702. selector: "model",
  2703. category: 'accessing',
  2704. fn: function (){
  2705. var self=this;
  2706. return smalltalk.withContext(function($ctx1) {
  2707. var $1;
  2708. $1=self["@model"];
  2709. return $1;
  2710. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLToolListWidget)})},
  2711. args: [],
  2712. source: "model\x0a\x09^ model",
  2713. messageSends: [],
  2714. referencedClasses: []
  2715. }),
  2716. smalltalk.HLToolListWidget);
  2717. smalltalk.addMethod(
  2718. smalltalk.method({
  2719. selector: "model:",
  2720. category: 'accessing',
  2721. fn: function (aBrowserModel){
  2722. var self=this;
  2723. return smalltalk.withContext(function($ctx1) {
  2724. var $1,$2;
  2725. self["@model"]=aBrowserModel;
  2726. $1=self;
  2727. _st($1)._observeSystem();
  2728. $2=_st($1)._observeModel();
  2729. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aBrowserModel:aBrowserModel},smalltalk.HLToolListWidget)})},
  2730. args: ["aBrowserModel"],
  2731. source: "model: aBrowserModel\x0a\x09model := aBrowserModel.\x0a \x0a self \x0a\x09\x09observeSystem;\x0a\x09\x09observeModel",
  2732. messageSends: ["observeSystem", "observeModel"],
  2733. referencedClasses: []
  2734. }),
  2735. smalltalk.HLToolListWidget);
  2736. smalltalk.addMethod(
  2737. smalltalk.method({
  2738. selector: "observeModel",
  2739. category: 'actions',
  2740. fn: function (){
  2741. var self=this;
  2742. return smalltalk.withContext(function($ctx1) {
  2743. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLToolListWidget)})},
  2744. args: [],
  2745. source: "observeModel",
  2746. messageSends: [],
  2747. referencedClasses: []
  2748. }),
  2749. smalltalk.HLToolListWidget);
  2750. smalltalk.addMethod(
  2751. smalltalk.method({
  2752. selector: "observeSystem",
  2753. category: 'actions',
  2754. fn: function (){
  2755. var self=this;
  2756. return smalltalk.withContext(function($ctx1) {
  2757. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLToolListWidget)})},
  2758. args: [],
  2759. source: "observeSystem",
  2760. messageSends: [],
  2761. referencedClasses: []
  2762. }),
  2763. smalltalk.HLToolListWidget);
  2764. smalltalk.addMethod(
  2765. smalltalk.method({
  2766. selector: "renderContentOn:",
  2767. category: 'rendering',
  2768. fn: function (html){
  2769. var self=this;
  2770. return smalltalk.withContext(function($ctx1) {
  2771. self._renderHeadOn_(html);
  2772. smalltalk.HLNavigationListWidget.fn.prototype._renderContentOn_.apply(_st(self), [html]);
  2773. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLToolListWidget)})},
  2774. args: ["html"],
  2775. source: "renderContentOn: html\x0a\x09self renderHeadOn: html.\x09\x0a\x09super renderContentOn: html",
  2776. messageSends: ["renderHeadOn:", "renderContentOn:"],
  2777. referencedClasses: []
  2778. }),
  2779. smalltalk.HLToolListWidget);
  2780. smalltalk.addMethod(
  2781. smalltalk.method({
  2782. selector: "renderHeadOn:",
  2783. category: 'rendering',
  2784. fn: function (html){
  2785. var self=this;
  2786. return smalltalk.withContext(function($ctx1) {
  2787. var $1,$2;
  2788. $1=_st(html)._div();
  2789. _st($1)._class_("list-label");
  2790. $2=_st($1)._with_((function(){
  2791. return smalltalk.withContext(function($ctx2) {
  2792. _st(html)._with_(self._label());
  2793. return self._renderMenuOn_(html);
  2794. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2795. return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},smalltalk.HLToolListWidget)})},
  2796. args: ["html"],
  2797. 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 ]",
  2798. messageSends: ["class:", "div", "with:", "label", "renderMenuOn:"],
  2799. referencedClasses: []
  2800. }),
  2801. smalltalk.HLToolListWidget);
  2802. smalltalk.addMethod(
  2803. smalltalk.method({
  2804. selector: "renderMenuOn:",
  2805. category: 'rendering',
  2806. fn: function (html){
  2807. var self=this;
  2808. var commands;
  2809. return smalltalk.withContext(function($ctx1) {
  2810. var $1,$2,$3,$5,$6,$7,$9,$10,$8,$4;
  2811. commands=self._menuCommands();
  2812. $1=_st(commands)._isEmpty();
  2813. if(smalltalk.assert($1)){
  2814. $2=self;
  2815. return $2;
  2816. };
  2817. $3=_st(html)._div();
  2818. _st($3)._class_("btn-group cog");
  2819. $4=_st($3)._with_((function(){
  2820. return smalltalk.withContext(function($ctx2) {
  2821. $5=_st(html)._a();
  2822. _st($5)._class_("btn dropdown-toggle");
  2823. _st($5)._at_put_("data-toggle","dropdown");
  2824. $6=_st($5)._with_((function(){
  2825. return smalltalk.withContext(function($ctx3) {
  2826. return _st(_st(html)._tag_("i"))._class_("icon-cog");
  2827. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2828. $6;
  2829. $7=_st(html)._ul();
  2830. _st($7)._class_("dropdown-menu pull-right");
  2831. $8=_st($7)._with_((function(){
  2832. return smalltalk.withContext(function($ctx3) {
  2833. return _st(self._menuCommands())._do_((function(each){
  2834. return smalltalk.withContext(function($ctx4) {
  2835. return _st(_st(html)._li())._with_((function(){
  2836. return smalltalk.withContext(function($ctx5) {
  2837. $9=_st(html)._a();
  2838. _st($9)._with_(_st(each)._menuLabel());
  2839. $10=_st($9)._onClick_((function(){
  2840. return smalltalk.withContext(function($ctx6) {
  2841. return self._execute_(each);
  2842. }, function($ctx6) {$ctx6.fillBlock({},$ctx5)})}));
  2843. return $10;
  2844. }, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
  2845. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
  2846. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  2847. return $8;
  2848. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2849. return self}, function($ctx1) {$ctx1.fill(self,"renderMenuOn:",{html:html,commands:commands},smalltalk.HLToolListWidget)})},
  2850. args: ["html"],
  2851. 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 ] ] ] ] ]",
  2852. messageSends: ["menuCommands", "ifTrue:", "isEmpty", "class:", "div", "with:", "a", "at:put:", "tag:", "ul", "do:", "menuLabel", "onClick:", "execute:", "li"],
  2853. referencedClasses: []
  2854. }),
  2855. smalltalk.HLToolListWidget);
  2856. smalltalk.addMethod(
  2857. smalltalk.method({
  2858. selector: "selectedItem:",
  2859. category: 'accessing',
  2860. fn: function (anItem){
  2861. var self=this;
  2862. return smalltalk.withContext(function($ctx1) {
  2863. smalltalk.HLNavigationListWidget.fn.prototype._selectedItem_.apply(_st(self), [anItem]);
  2864. self._updateMenu();
  2865. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anItem:anItem},smalltalk.HLToolListWidget)})},
  2866. args: ["anItem"],
  2867. source: "selectedItem: anItem\x0a\x09\x22Selection changed, update the cog menu\x22\x0a\x09\x0a\x09super selectedItem: anItem.\x0a\x09self updateMenu",
  2868. messageSends: ["selectedItem:", "updateMenu"],
  2869. referencedClasses: []
  2870. }),
  2871. smalltalk.HLToolListWidget);
  2872. smalltalk.addMethod(
  2873. smalltalk.method({
  2874. selector: "unregister",
  2875. category: 'actions',
  2876. fn: function (){
  2877. var self=this;
  2878. return smalltalk.withContext(function($ctx1) {
  2879. smalltalk.HLNavigationListWidget.fn.prototype._unregister.apply(_st(self), []);
  2880. _st(_st(self._model())._announcer())._unsubscribe_(self);
  2881. _st(_st(self._model())._systemAnnouncer())._unsubscribe_(self);
  2882. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLToolListWidget)})},
  2883. args: [],
  2884. source: "unregister\x0a\x09super unregister.\x0a\x09\x0a\x09self model announcer unsubscribe: self.\x0a\x09self model systemAnnouncer unsubscribe: self",
  2885. messageSends: ["unregister", "unsubscribe:", "announcer", "model", "systemAnnouncer"],
  2886. referencedClasses: []
  2887. }),
  2888. smalltalk.HLToolListWidget);
  2889. smalltalk.addMethod(
  2890. smalltalk.method({
  2891. selector: "updateMenu",
  2892. category: 'updating',
  2893. fn: function (){
  2894. var self=this;
  2895. return smalltalk.withContext(function($ctx1) {
  2896. _st(_st(_st(self._wrapper())._asJQuery())._find_(".cog"))._remove();
  2897. _st((function(html){
  2898. return smalltalk.withContext(function($ctx2) {
  2899. return self._renderMenuOn_(html);
  2900. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self._wrapper())._asJQuery())._find_(".list-label"));
  2901. return self}, function($ctx1) {$ctx1.fill(self,"updateMenu",{},smalltalk.HLToolListWidget)})},
  2902. args: [],
  2903. 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')",
  2904. messageSends: ["remove", "find:", "asJQuery", "wrapper", "appendToJQuery:", "renderMenuOn:"],
  2905. referencedClasses: []
  2906. }),
  2907. smalltalk.HLToolListWidget);
  2908. smalltalk.addMethod(
  2909. smalltalk.method({
  2910. selector: "on:",
  2911. category: 'instance creation',
  2912. fn: function (aModel){
  2913. var self=this;
  2914. return smalltalk.withContext(function($ctx1) {
  2915. var $2,$3,$1;
  2916. $2=self._new();
  2917. _st($2)._model_(aModel);
  2918. $3=_st($2)._yourself();
  2919. $1=$3;
  2920. return $1;
  2921. }, function($ctx1) {$ctx1.fill(self,"on:",{aModel:aModel},smalltalk.HLToolListWidget.klass)})},
  2922. args: ["aModel"],
  2923. source: "on: aModel\x0a\x09^ self new \x0a \x09model: aModel;\x0a yourself",
  2924. messageSends: ["model:", "new", "yourself"],
  2925. referencedClasses: []
  2926. }),
  2927. smalltalk.HLToolListWidget.klass);
  2928. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  2929. smalltalk.addMethod(
  2930. smalltalk.method({
  2931. selector: "activate:",
  2932. category: 'actions',
  2933. fn: function (aTab){
  2934. var self=this;
  2935. return smalltalk.withContext(function($ctx1) {
  2936. var $1,$2;
  2937. _st(self._keyBinder())._flushBindings();
  2938. _st(aTab)._registerBindings();
  2939. self["@activeTab"]=aTab;
  2940. $1=self;
  2941. _st($1)._refresh();
  2942. _st($1)._addToHistory_(aTab);
  2943. $2=_st($1)._show_(aTab);
  2944. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  2945. args: ["aTab"],
  2946. 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",
  2947. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  2948. referencedClasses: []
  2949. }),
  2950. smalltalk.HLManager);
  2951. smalltalk.addMethod(
  2952. smalltalk.method({
  2953. selector: "activeTab",
  2954. category: 'accessing',
  2955. fn: function (){
  2956. var self=this;
  2957. return smalltalk.withContext(function($ctx1) {
  2958. var $1;
  2959. $1=self["@activeTab"];
  2960. return $1;
  2961. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},smalltalk.HLManager)})},
  2962. args: [],
  2963. source: "activeTab\x0a\x09^ activeTab",
  2964. messageSends: [],
  2965. referencedClasses: []
  2966. }),
  2967. smalltalk.HLManager);
  2968. smalltalk.addMethod(
  2969. smalltalk.method({
  2970. selector: "addTab:",
  2971. category: 'actions',
  2972. fn: function (aTab){
  2973. var self=this;
  2974. return smalltalk.withContext(function($ctx1) {
  2975. _st(self._tabs())._add_(aTab);
  2976. self._activate_(aTab);
  2977. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},smalltalk.HLManager)})},
  2978. args: ["aTab"],
  2979. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  2980. messageSends: ["add:", "tabs", "activate:"],
  2981. referencedClasses: []
  2982. }),
  2983. smalltalk.HLManager);
  2984. smalltalk.addMethod(
  2985. smalltalk.method({
  2986. selector: "addToHistory:",
  2987. category: 'actions',
  2988. fn: function (aTab){
  2989. var self=this;
  2990. return smalltalk.withContext(function($ctx1) {
  2991. self._removeFromHistory_(aTab);
  2992. _st(self._history())._add_(aTab);
  2993. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},smalltalk.HLManager)})},
  2994. args: ["aTab"],
  2995. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  2996. messageSends: ["removeFromHistory:", "add:", "history"],
  2997. referencedClasses: []
  2998. }),
  2999. smalltalk.HLManager);
  3000. smalltalk.addMethod(
  3001. smalltalk.method({
  3002. selector: "confirm:ifFalse:",
  3003. category: 'actions',
  3004. fn: function (aString,aBlock){
  3005. var self=this;
  3006. function $HLConfirmationWidget(){return smalltalk.HLConfirmationWidget||(typeof HLConfirmationWidget=="undefined"?nil:HLConfirmationWidget)}
  3007. return smalltalk.withContext(function($ctx1) {
  3008. var $1,$2;
  3009. $1=_st($HLConfirmationWidget())._new();
  3010. _st($1)._confirmationString_(aString);
  3011. _st($1)._cancelBlock_(aBlock);
  3012. $2=_st($1)._yourself();
  3013. _st($2)._appendToJQuery_("body"._asJQuery());
  3014. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3015. args: ["aString", "aBlock"],
  3016. source: "confirm: aString ifFalse: aBlock\x0a\x09(HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09cancelBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  3017. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "cancelBlock:", "yourself"],
  3018. referencedClasses: ["HLConfirmationWidget"]
  3019. }),
  3020. smalltalk.HLManager);
  3021. smalltalk.addMethod(
  3022. smalltalk.method({
  3023. selector: "confirm:ifTrue:",
  3024. category: 'actions',
  3025. fn: function (aString,aBlock){
  3026. var self=this;
  3027. function $HLConfirmationWidget(){return smalltalk.HLConfirmationWidget||(typeof HLConfirmationWidget=="undefined"?nil:HLConfirmationWidget)}
  3028. return smalltalk.withContext(function($ctx1) {
  3029. var $1,$2;
  3030. $1=_st($HLConfirmationWidget())._new();
  3031. _st($1)._confirmationString_(aString);
  3032. _st($1)._actionBlock_(aBlock);
  3033. $2=_st($1)._yourself();
  3034. _st($2)._appendToJQuery_("body"._asJQuery());
  3035. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3036. args: ["aString", "aBlock"],
  3037. source: "confirm: aString ifTrue: aBlock\x0a\x09(HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  3038. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "yourself"],
  3039. referencedClasses: ["HLConfirmationWidget"]
  3040. }),
  3041. smalltalk.HLManager);
  3042. smalltalk.addMethod(
  3043. smalltalk.method({
  3044. selector: "defaultEnvironment",
  3045. category: 'defaults',
  3046. fn: function (){
  3047. var self=this;
  3048. var parent;
  3049. function $Environment(){return smalltalk.Environment||(typeof Environment=="undefined"?nil:Environment)}
  3050. return smalltalk.withContext(function($ctx1) {
  3051. var $1,$2,$3,$4;
  3052. $1=_st(window)._opener();
  3053. if(($receiver = $1) == nil || $receiver == undefined){
  3054. parent=_st(window)._parent();
  3055. } else {
  3056. parent=$1;
  3057. };
  3058. $2=parent;
  3059. if(($receiver = $2) == nil || $receiver == undefined){
  3060. $3=_st($Environment())._new();
  3061. return $3;
  3062. } else {
  3063. $2;
  3064. };
  3065. $4=_st(_st(_st(parent)._at_("smalltalk"))._at_("Environment"))._new();
  3066. return $4;
  3067. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{parent:parent},smalltalk.HLManager)})},
  3068. args: [],
  3069. source: "defaultEnvironment\x0a\x09\x22If helios is loaded from within a frame, answer the parent window environment\x22\x0a\x09\x0a\x09| parent |\x0a\x09\x0a\x09parent := window opener ifNil: [ window parent ].\x0a\x09parent ifNil: [ ^ Environment new ].\x0a\x09\x0a\x09^ ((parent at: 'smalltalk')\x0a\x09\x09at: 'Environment') new",
  3070. messageSends: ["ifNil:", "parent", "opener", "new", "at:"],
  3071. referencedClasses: ["Environment"]
  3072. }),
  3073. smalltalk.HLManager);
  3074. smalltalk.addMethod(
  3075. smalltalk.method({
  3076. selector: "environment",
  3077. category: 'accessing',
  3078. fn: function (){
  3079. var self=this;
  3080. return smalltalk.withContext(function($ctx1) {
  3081. var $2,$1;
  3082. $2=self["@environment"];
  3083. if(($receiver = $2) == nil || $receiver == undefined){
  3084. self["@environment"]=self._defaultEnvironment();
  3085. $1=self["@environment"];
  3086. } else {
  3087. $1=$2;
  3088. };
  3089. return $1;
  3090. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLManager)})},
  3091. args: [],
  3092. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  3093. messageSends: ["ifNil:", "defaultEnvironment"],
  3094. referencedClasses: []
  3095. }),
  3096. smalltalk.HLManager);
  3097. smalltalk.addMethod(
  3098. smalltalk.method({
  3099. selector: "environment:",
  3100. category: 'accessing',
  3101. fn: function (anEnvironment){
  3102. var self=this;
  3103. return smalltalk.withContext(function($ctx1) {
  3104. self["@environment"]=anEnvironment;
  3105. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLManager)})},
  3106. args: ["anEnvironment"],
  3107. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  3108. messageSends: [],
  3109. referencedClasses: []
  3110. }),
  3111. smalltalk.HLManager);
  3112. smalltalk.addMethod(
  3113. smalltalk.method({
  3114. selector: "history",
  3115. category: 'accessing',
  3116. fn: function (){
  3117. var self=this;
  3118. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3119. return smalltalk.withContext(function($ctx1) {
  3120. var $2,$1;
  3121. $2=self["@history"];
  3122. if(($receiver = $2) == nil || $receiver == undefined){
  3123. self["@history"]=_st($OrderedCollection())._new();
  3124. $1=self["@history"];
  3125. } else {
  3126. $1=$2;
  3127. };
  3128. return $1;
  3129. }, function($ctx1) {$ctx1.fill(self,"history",{},smalltalk.HLManager)})},
  3130. args: [],
  3131. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  3132. messageSends: ["ifNil:", "new"],
  3133. referencedClasses: ["OrderedCollection"]
  3134. }),
  3135. smalltalk.HLManager);
  3136. smalltalk.addMethod(
  3137. smalltalk.method({
  3138. selector: "history:",
  3139. category: 'accessing',
  3140. fn: function (aCollection){
  3141. var self=this;
  3142. return smalltalk.withContext(function($ctx1) {
  3143. self["@history"]=aCollection;
  3144. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection},smalltalk.HLManager)})},
  3145. args: ["aCollection"],
  3146. source: "history: aCollection\x0a\x09history := aCollection",
  3147. messageSends: [],
  3148. referencedClasses: []
  3149. }),
  3150. smalltalk.HLManager);
  3151. smalltalk.addMethod(
  3152. smalltalk.method({
  3153. selector: "initialize",
  3154. category: 'initialization',
  3155. fn: function (){
  3156. var self=this;
  3157. function $HLErrorHandler(){return smalltalk.HLErrorHandler||(typeof HLErrorHandler=="undefined"?nil:HLErrorHandler)}
  3158. function $HLProgressHandler(){return smalltalk.HLProgressHandler||(typeof HLProgressHandler=="undefined"?nil:HLProgressHandler)}
  3159. function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  3160. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  3161. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  3162. return smalltalk.withContext(function($ctx1) {
  3163. smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  3164. _st($HLErrorHandler())._register();
  3165. _st($HLProgressHandler())._register();
  3166. self._registerInspector_($HLInspector());
  3167. self._registerErrorHandler_(_st($ErrorHandler())._current());
  3168. self._registerProgressHandler_(_st($ProgressHandler())._current());
  3169. _st(self._keyBinder())._setupEvents();
  3170. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager)})},
  3171. args: [],
  3172. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09HLErrorHandler register.\x0a\x09HLProgressHandler register.\x0a\x09\x0a\x09self registerInspector: HLInspector.\x0a\x09self registerErrorHandler: ErrorHandler current.\x0a\x09self registerProgressHandler: ProgressHandler current.\x0a self keyBinder setupEvents",
  3173. messageSends: ["initialize", "register", "registerInspector:", "registerErrorHandler:", "current", "registerProgressHandler:", "setupEvents", "keyBinder"],
  3174. referencedClasses: ["HLErrorHandler", "HLProgressHandler", "HLInspector", "ErrorHandler", "ProgressHandler"]
  3175. }),
  3176. smalltalk.HLManager);
  3177. smalltalk.addMethod(
  3178. smalltalk.method({
  3179. selector: "keyBinder",
  3180. category: 'accessing',
  3181. fn: function (){
  3182. var self=this;
  3183. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  3184. return smalltalk.withContext(function($ctx1) {
  3185. var $2,$1;
  3186. $2=self["@keyBinder"];
  3187. if(($receiver = $2) == nil || $receiver == undefined){
  3188. self["@keyBinder"]=_st($HLKeyBinder())._new();
  3189. $1=self["@keyBinder"];
  3190. } else {
  3191. $1=$2;
  3192. };
  3193. return $1;
  3194. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLManager)})},
  3195. args: [],
  3196. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  3197. messageSends: ["ifNil:", "new"],
  3198. referencedClasses: ["HLKeyBinder"]
  3199. }),
  3200. smalltalk.HLManager);
  3201. smalltalk.addMethod(
  3202. smalltalk.method({
  3203. selector: "refresh",
  3204. category: 'rendering',
  3205. fn: function (){
  3206. var self=this;
  3207. return smalltalk.withContext(function($ctx1) {
  3208. _st(_st(window)._jQuery_(".navbar"))._remove();
  3209. self._appendToJQuery_("body"._asJQuery());
  3210. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  3211. args: [],
  3212. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  3213. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  3214. referencedClasses: []
  3215. }),
  3216. smalltalk.HLManager);
  3217. smalltalk.addMethod(
  3218. smalltalk.method({
  3219. selector: "registerErrorHandler:",
  3220. category: 'actions',
  3221. fn: function (anErrorHandler){
  3222. var self=this;
  3223. return smalltalk.withContext(function($ctx1) {
  3224. _st(self._environment())._registerErrorHandler_(anErrorHandler);
  3225. return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.HLManager)})},
  3226. args: ["anErrorHandler"],
  3227. source: "registerErrorHandler: anErrorHandler\x0a\x09self environment registerErrorHandler: anErrorHandler",
  3228. messageSends: ["registerErrorHandler:", "environment"],
  3229. referencedClasses: []
  3230. }),
  3231. smalltalk.HLManager);
  3232. smalltalk.addMethod(
  3233. smalltalk.method({
  3234. selector: "registerInspector:",
  3235. category: 'actions',
  3236. fn: function (anInspector){
  3237. var self=this;
  3238. return smalltalk.withContext(function($ctx1) {
  3239. _st(self._environment())._registerInspector_(anInspector);
  3240. return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.HLManager)})},
  3241. args: ["anInspector"],
  3242. source: "registerInspector: anInspector\x0a\x09self environment registerInspector: anInspector",
  3243. messageSends: ["registerInspector:", "environment"],
  3244. referencedClasses: []
  3245. }),
  3246. smalltalk.HLManager);
  3247. smalltalk.addMethod(
  3248. smalltalk.method({
  3249. selector: "registerProgressHandler:",
  3250. category: 'actions',
  3251. fn: function (aProgressHandler){
  3252. var self=this;
  3253. return smalltalk.withContext(function($ctx1) {
  3254. _st(self._environment())._registerProgressHandler_(aProgressHandler);
  3255. return self}, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},smalltalk.HLManager)})},
  3256. args: ["aProgressHandler"],
  3257. source: "registerProgressHandler: aProgressHandler\x0a\x09self environment registerProgressHandler: aProgressHandler",
  3258. messageSends: ["registerProgressHandler:", "environment"],
  3259. referencedClasses: []
  3260. }),
  3261. smalltalk.HLManager);
  3262. smalltalk.addMethod(
  3263. smalltalk.method({
  3264. selector: "removeActiveTab",
  3265. category: 'actions',
  3266. fn: function (){
  3267. var self=this;
  3268. return smalltalk.withContext(function($ctx1) {
  3269. self._removeTab_(self._activeTab());
  3270. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},smalltalk.HLManager)})},
  3271. args: [],
  3272. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  3273. messageSends: ["removeTab:", "activeTab"],
  3274. referencedClasses: []
  3275. }),
  3276. smalltalk.HLManager);
  3277. smalltalk.addMethod(
  3278. smalltalk.method({
  3279. selector: "removeFromHistory:",
  3280. category: 'actions',
  3281. fn: function (aTab){
  3282. var self=this;
  3283. return smalltalk.withContext(function($ctx1) {
  3284. self._history_(_st(self._history())._reject_((function(each){
  3285. return smalltalk.withContext(function($ctx2) {
  3286. return _st(each).__eq_eq(aTab);
  3287. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  3288. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},smalltalk.HLManager)})},
  3289. args: ["aTab"],
  3290. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  3291. messageSends: ["history:", "reject:", "==", "history"],
  3292. referencedClasses: []
  3293. }),
  3294. smalltalk.HLManager);
  3295. smalltalk.addMethod(
  3296. smalltalk.method({
  3297. selector: "removeTab:",
  3298. category: 'actions',
  3299. fn: function (aTab){
  3300. var self=this;
  3301. return smalltalk.withContext(function($ctx1) {
  3302. var $1,$2;
  3303. $1=_st(self._tabs())._includes_(aTab);
  3304. if(! smalltalk.assert($1)){
  3305. $2=self;
  3306. return $2;
  3307. };
  3308. self._removeFromHistory_(aTab);
  3309. _st(self._tabs())._remove_(aTab);
  3310. _st(self._keyBinder())._flushBindings();
  3311. _st(aTab)._remove();
  3312. self._refresh();
  3313. _st(self._history())._ifNotEmpty_((function(){
  3314. return smalltalk.withContext(function($ctx2) {
  3315. return _st(_st(self._history())._last())._activate();
  3316. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3317. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  3318. args: ["aTab"],
  3319. 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 ]",
  3320. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  3321. referencedClasses: []
  3322. }),
  3323. smalltalk.HLManager);
  3324. smalltalk.addMethod(
  3325. smalltalk.method({
  3326. selector: "renderAddOn:",
  3327. category: 'rendering',
  3328. fn: function (html){
  3329. var self=this;
  3330. function $HLWidget(){return smalltalk.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  3331. return smalltalk.withContext(function($ctx1) {
  3332. var $1,$3,$4,$5,$7,$8,$6,$2;
  3333. $1=_st(html)._li();
  3334. _st($1)._class_("dropdown");
  3335. $2=_st($1)._with_((function(){
  3336. return smalltalk.withContext(function($ctx2) {
  3337. $3=_st(html)._a();
  3338. _st($3)._class_("dropdown-toggle");
  3339. _st($3)._at_put_("data-toggle","dropdown");
  3340. $4=_st($3)._with_((function(){
  3341. return smalltalk.withContext(function($ctx3) {
  3342. _st(html)._with_("Open...");
  3343. return _st(_st(html)._tag_("b"))._class_("caret");
  3344. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3345. $4;
  3346. $5=_st(html)._ul();
  3347. _st($5)._class_("dropdown-menu");
  3348. $6=_st($5)._with_((function(){
  3349. return smalltalk.withContext(function($ctx3) {
  3350. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  3351. return smalltalk.withContext(function($ctx4) {
  3352. return _st(each)._canBeOpenAsTab();
  3353. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})})))._sorted_((function(a,b){
  3354. return smalltalk.withContext(function($ctx4) {
  3355. return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  3356. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3)})})))._do_((function(each){
  3357. return smalltalk.withContext(function($ctx4) {
  3358. return _st(_st(html)._li())._with_((function(){
  3359. return smalltalk.withContext(function($ctx5) {
  3360. $7=_st(html)._a();
  3361. _st($7)._with_(_st(each)._tabLabel());
  3362. $8=_st($7)._onClick_((function(){
  3363. return smalltalk.withContext(function($ctx6) {
  3364. return _st(each)._openAsTab();
  3365. }, function($ctx6) {$ctx6.fillBlock({},$ctx5)})}));
  3366. return $8;
  3367. }, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
  3368. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3)})}));
  3369. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3370. return $6;
  3371. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3372. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},smalltalk.HLManager)})},
  3373. args: ["html"],
  3374. 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 ] ] ] ] ]",
  3375. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  3376. referencedClasses: ["HLWidget"]
  3377. }),
  3378. smalltalk.HLManager);
  3379. smalltalk.addMethod(
  3380. smalltalk.method({
  3381. selector: "renderContentOn:",
  3382. category: 'rendering',
  3383. fn: function (html){
  3384. var self=this;
  3385. return smalltalk.withContext(function($ctx1) {
  3386. var $1,$3,$4,$2;
  3387. $1=_st(html)._div();
  3388. _st($1)._class_("navbar navbar-fixed-top");
  3389. $2=_st($1)._with_((function(){
  3390. return smalltalk.withContext(function($ctx2) {
  3391. $3=_st(html)._div();
  3392. _st($3)._class_("navbar-inner");
  3393. $4=_st($3)._with_((function(){
  3394. return smalltalk.withContext(function($ctx3) {
  3395. return self._renderTabsOn_(html);
  3396. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3397. return $4;
  3398. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3399. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  3400. args: ["html"],
  3401. 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 ] ]",
  3402. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  3403. referencedClasses: []
  3404. }),
  3405. smalltalk.HLManager);
  3406. smalltalk.addMethod(
  3407. smalltalk.method({
  3408. selector: "renderTabsOn:",
  3409. category: 'rendering',
  3410. fn: function (html){
  3411. var self=this;
  3412. return smalltalk.withContext(function($ctx1) {
  3413. var $1,$3,$4,$6,$5,$8,$9,$10,$11,$7,$2;
  3414. $1=_st(html)._ul();
  3415. _st($1)._class_("nav");
  3416. $2=_st($1)._with_((function(){
  3417. return smalltalk.withContext(function($ctx2) {
  3418. _st(self._tabs())._do_((function(each){
  3419. return smalltalk.withContext(function($ctx3) {
  3420. $3=_st(html)._li();
  3421. $4=$3;
  3422. $6=_st(each)._isActive();
  3423. if(smalltalk.assert($6)){
  3424. $5="active";
  3425. } else {
  3426. $5="inactive";
  3427. };
  3428. _st($4)._class_($5);
  3429. $7=_st($3)._with_((function(){
  3430. return smalltalk.withContext(function($ctx4) {
  3431. $8=_st(html)._a();
  3432. _st($8)._with_((function(){
  3433. return smalltalk.withContext(function($ctx5) {
  3434. _st(_st(_st(html)._tag_("i"))._class_("close"))._onClick_((function(){
  3435. return smalltalk.withContext(function($ctx6) {
  3436. return self._removeTab_(each);
  3437. }, function($ctx6) {$ctx6.fillBlock({},$ctx5)})}));
  3438. $9=_st(html)._span();
  3439. _st($9)._class_(_st(each)._cssClass());
  3440. $10=_st($9)._with_(_st(each)._displayLabel());
  3441. return $10;
  3442. }, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
  3443. $11=_st($8)._onClick_((function(){
  3444. return smalltalk.withContext(function($ctx5) {
  3445. return _st(each)._activate();
  3446. }, function($ctx5) {$ctx5.fillBlock({},$ctx4)})}));
  3447. return $11;
  3448. }, function($ctx4) {$ctx4.fillBlock({},$ctx3)})}));
  3449. return $7;
  3450. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2)})}));
  3451. return self._renderAddOn_(html);
  3452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3453. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  3454. args: ["html"],
  3455. 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: 'close')\x0a \x09\x09\x09\x09\x09\x09\x09\x09\x09onClick: [ self removeTab: each ].\x0a \x09html span \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09class: each cssClass;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09with: each displayLabel ];\x0a\x09\x09\x09\x09\x09\x09\x09onClick: [ each activate ] ] ].\x0a\x09\x09\x09self renderAddOn: html ]",
  3456. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "cssClass", "span", "displayLabel", "a", "activate", "tabs", "renderAddOn:"],
  3457. referencedClasses: []
  3458. }),
  3459. smalltalk.HLManager);
  3460. smalltalk.addMethod(
  3461. smalltalk.method({
  3462. selector: "request:do:",
  3463. category: 'actions',
  3464. fn: function (aString,aBlock){
  3465. var self=this;
  3466. return smalltalk.withContext(function($ctx1) {
  3467. self._request_value_do_(aString,"",aBlock);
  3468. return self}, function($ctx1) {$ctx1.fill(self,"request:do:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3469. args: ["aString", "aBlock"],
  3470. source: "request: aString do: aBlock\x0a\x09self \x0a\x09\x09request: aString\x0a\x09\x09value: ''\x0a\x09\x09do: aBlock",
  3471. messageSends: ["request:value:do:"],
  3472. referencedClasses: []
  3473. }),
  3474. smalltalk.HLManager);
  3475. smalltalk.addMethod(
  3476. smalltalk.method({
  3477. selector: "request:value:do:",
  3478. category: 'actions',
  3479. fn: function (aString,valueString,aBlock){
  3480. var self=this;
  3481. function $HLRequestWidget(){return smalltalk.HLRequestWidget||(typeof HLRequestWidget=="undefined"?nil:HLRequestWidget)}
  3482. return smalltalk.withContext(function($ctx1) {
  3483. var $1,$2;
  3484. $1=_st($HLRequestWidget())._new();
  3485. _st($1)._confirmationString_(aString);
  3486. _st($1)._actionBlock_(aBlock);
  3487. _st($1)._value_(valueString);
  3488. $2=_st($1)._yourself();
  3489. _st($2)._appendToJQuery_("body"._asJQuery());
  3490. return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},smalltalk.HLManager)})},
  3491. args: ["aString", "valueString", "aBlock"],
  3492. source: "request: aString value: valueString do: aBlock\x0a\x09(HLRequestWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09value: valueString;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  3493. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "value:", "yourself"],
  3494. referencedClasses: ["HLRequestWidget"]
  3495. }),
  3496. smalltalk.HLManager);
  3497. smalltalk.addMethod(
  3498. smalltalk.method({
  3499. selector: "show:",
  3500. category: 'rendering',
  3501. fn: function (aTab){
  3502. var self=this;
  3503. return smalltalk.withContext(function($ctx1) {
  3504. var $1,$2;
  3505. _st(self._tabs())._do_((function(each){
  3506. return smalltalk.withContext(function($ctx2) {
  3507. return _st(each)._hide();
  3508. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3509. $1=aTab;
  3510. _st($1)._show();
  3511. $2=_st($1)._focus();
  3512. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  3513. args: ["aTab"],
  3514. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  3515. messageSends: ["do:", "hide", "tabs", "show", "focus"],
  3516. referencedClasses: []
  3517. }),
  3518. smalltalk.HLManager);
  3519. smalltalk.addMethod(
  3520. smalltalk.method({
  3521. selector: "tabs",
  3522. category: 'accessing',
  3523. fn: function (){
  3524. var self=this;
  3525. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3526. return smalltalk.withContext(function($ctx1) {
  3527. var $2,$1;
  3528. $2=self["@tabs"];
  3529. if(($receiver = $2) == nil || $receiver == undefined){
  3530. self["@tabs"]=_st($OrderedCollection())._new();
  3531. $1=self["@tabs"];
  3532. } else {
  3533. $1=$2;
  3534. };
  3535. return $1;
  3536. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLManager)})},
  3537. args: [],
  3538. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  3539. messageSends: ["ifNil:", "new"],
  3540. referencedClasses: ["OrderedCollection"]
  3541. }),
  3542. smalltalk.HLManager);
  3543. smalltalk.HLManager.klass.iVarNames = ['current'];
  3544. smalltalk.addMethod(
  3545. smalltalk.method({
  3546. selector: "clearKeydownEvent",
  3547. category: 'private',
  3548. fn: function (){
  3549. var self=this;
  3550. return smalltalk.withContext(function($ctx1) {
  3551. var $1;
  3552. _st(_st(window)._jQuery_("body"))._keydown_((function(e){
  3553. return smalltalk.withContext(function($ctx2) {
  3554. $1=_st(_st(_st(e)._keyCode()).__gt_eq((37)))._and_((function(){
  3555. return smalltalk.withContext(function($ctx3) {
  3556. return _st(_st(e)._keyCode()).__lt_eq((40));
  3557. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3558. if(smalltalk.assert($1)){
  3559. return false;
  3560. };
  3561. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  3562. return self}, function($ctx1) {$ctx1.fill(self,"clearKeydownEvent",{},smalltalk.HLManager.klass)})},
  3563. args: [],
  3564. source: "clearKeydownEvent\x0a\x09\x22Prevent default keydown event with arrow key from scrolling the parent page\x0a\x09when helios is run inside a frame.\x22\x0a\x09\x0a\x09(window jQuery: 'body') keydown: [ :e | \x0a\x09\x09(e keyCode >= 37 and: [ e keyCode <= 40 ])\x0a\x09\x09\x09ifTrue: [ false ] ]",
  3565. messageSends: ["keydown:", "ifTrue:", "and:", "<=", "keyCode", ">=", "jQuery:"],
  3566. referencedClasses: []
  3567. }),
  3568. smalltalk.HLManager.klass);
  3569. smalltalk.addMethod(
  3570. smalltalk.method({
  3571. selector: "current",
  3572. category: 'accessing',
  3573. fn: function (){
  3574. var self=this;
  3575. return smalltalk.withContext(function($ctx1) {
  3576. var $2,$1;
  3577. $2=self["@current"];
  3578. if(($receiver = $2) == nil || $receiver == undefined){
  3579. self["@current"]=_st(self._basicNew())._initialize();
  3580. $1=self["@current"];
  3581. } else {
  3582. $1=$2;
  3583. };
  3584. return $1;
  3585. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLManager.klass)})},
  3586. args: [],
  3587. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  3588. messageSends: ["ifNil:", "initialize", "basicNew"],
  3589. referencedClasses: []
  3590. }),
  3591. smalltalk.HLManager.klass);
  3592. smalltalk.addMethod(
  3593. smalltalk.method({
  3594. selector: "initialize",
  3595. category: 'initialization',
  3596. fn: function (){
  3597. var self=this;
  3598. return smalltalk.withContext(function($ctx1) {
  3599. _st(self._current())._appendToJQuery_("body"._asJQuery());
  3600. self._clearKeydownEvent();
  3601. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager.klass)})},
  3602. args: [],
  3603. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery.\x0a\x09self clearKeydownEvent",
  3604. messageSends: ["appendToJQuery:", "asJQuery", "current", "clearKeydownEvent"],
  3605. referencedClasses: []
  3606. }),
  3607. smalltalk.HLManager.klass);
  3608. smalltalk.addMethod(
  3609. smalltalk.method({
  3610. selector: "new",
  3611. category: 'instance creation',
  3612. fn: function (){
  3613. var self=this;
  3614. return smalltalk.withContext(function($ctx1) {
  3615. self._shouldNotImplement();
  3616. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLManager.klass)})},
  3617. args: [],
  3618. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  3619. messageSends: ["shouldNotImplement"],
  3620. referencedClasses: []
  3621. }),
  3622. smalltalk.HLManager.klass);
  3623. smalltalk.addClass('HLModalWidget', smalltalk.HLWidget, [], 'Helios-Core');
  3624. smalltalk.HLModalWidget.comment="I implement an abstract modal widget.";
  3625. smalltalk.addMethod(
  3626. smalltalk.method({
  3627. selector: "cancel",
  3628. category: 'actions',
  3629. fn: function (){
  3630. var self=this;
  3631. return smalltalk.withContext(function($ctx1) {
  3632. self._remove();
  3633. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLModalWidget)})},
  3634. args: [],
  3635. source: "cancel\x0a\x09self remove",
  3636. messageSends: ["remove"],
  3637. referencedClasses: []
  3638. }),
  3639. smalltalk.HLModalWidget);
  3640. smalltalk.addMethod(
  3641. smalltalk.method({
  3642. selector: "cssClass",
  3643. category: 'accessing',
  3644. fn: function (){
  3645. var self=this;
  3646. return smalltalk.withContext(function($ctx1) {
  3647. return "";
  3648. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLModalWidget)})},
  3649. args: [],
  3650. source: "cssClass\x0a\x09^ ''",
  3651. messageSends: [],
  3652. referencedClasses: []
  3653. }),
  3654. smalltalk.HLModalWidget);
  3655. smalltalk.addMethod(
  3656. smalltalk.method({
  3657. selector: "remove",
  3658. category: 'actions',
  3659. fn: function (){
  3660. var self=this;
  3661. return smalltalk.withContext(function($ctx1) {
  3662. _st(_st(window)._jQuery_(".dialog"))._removeClass_("active");
  3663. _st((function(){
  3664. return smalltalk.withContext(function($ctx2) {
  3665. _st(_st(window)._jQuery_("#overlay"))._remove();
  3666. return _st(_st(window)._jQuery_(".dialog"))._remove();
  3667. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  3668. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLModalWidget)})},
  3669. args: [],
  3670. source: "remove\x0a\x09(window jQuery: '.dialog') removeClass: 'active'.\x0a\x09[ \x0a\x09\x09(window jQuery: '#overlay') remove.\x0a\x09\x09(window jQuery: '.dialog') remove\x0a\x09] valueWithTimeout: 300",
  3671. messageSends: ["removeClass:", "jQuery:", "valueWithTimeout:", "remove"],
  3672. referencedClasses: []
  3673. }),
  3674. smalltalk.HLModalWidget);
  3675. smalltalk.addMethod(
  3676. smalltalk.method({
  3677. selector: "renderButtonsOn:",
  3678. category: 'rendering',
  3679. fn: function (html){
  3680. var self=this;
  3681. return smalltalk.withContext(function($ctx1) {
  3682. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLModalWidget)})},
  3683. args: ["html"],
  3684. source: "renderButtonsOn: html\x0a\x09",
  3685. messageSends: [],
  3686. referencedClasses: []
  3687. }),
  3688. smalltalk.HLModalWidget);
  3689. smalltalk.addMethod(
  3690. smalltalk.method({
  3691. selector: "renderContentOn:",
  3692. category: 'rendering',
  3693. fn: function (html){
  3694. var self=this;
  3695. var confirmButton;
  3696. return smalltalk.withContext(function($ctx1) {
  3697. var $1,$3,$4,$2;
  3698. _st(_st(html)._div())._id_("overlay");
  3699. $1=_st(html)._div();
  3700. _st($1)._class_("dialog ".__comma(self._cssClass()));
  3701. $2=_st($1)._with_((function(){
  3702. return smalltalk.withContext(function($ctx2) {
  3703. $3=self;
  3704. _st($3)._renderMainOn_(html);
  3705. $4=_st($3)._renderButtonsOn_(html);
  3706. return $4;
  3707. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3708. _st(_st(window)._jQuery_(".dialog"))._addClass_("active");
  3709. self._setupKeyBindings();
  3710. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html,confirmButton:confirmButton},smalltalk.HLModalWidget)})},
  3711. args: ["html"],
  3712. source: "renderContentOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div id: 'overlay'.\x0a\x09html div \x0a\x09\x09class: 'dialog ', self cssClass;\x0a\x09\x09with: [\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09renderMainOn: html;\x0a\x09\x09\x09\x09renderButtonsOn: html ].\x0a\x0a\x09(window jQuery: '.dialog') addClass: 'active'.\x0a\x09self setupKeyBindings",
  3713. messageSends: ["id:", "div", "class:", ",", "cssClass", "with:", "renderMainOn:", "renderButtonsOn:", "addClass:", "jQuery:", "setupKeyBindings"],
  3714. referencedClasses: []
  3715. }),
  3716. smalltalk.HLModalWidget);
  3717. smalltalk.addMethod(
  3718. smalltalk.method({
  3719. selector: "renderMainOn:",
  3720. category: 'rendering',
  3721. fn: function (html){
  3722. var self=this;
  3723. return smalltalk.withContext(function($ctx1) {
  3724. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLModalWidget)})},
  3725. args: ["html"],
  3726. source: "renderMainOn: html",
  3727. messageSends: [],
  3728. referencedClasses: []
  3729. }),
  3730. smalltalk.HLModalWidget);
  3731. smalltalk.addMethod(
  3732. smalltalk.method({
  3733. selector: "setupKeyBindings",
  3734. category: 'rendering',
  3735. fn: function (){
  3736. var self=this;
  3737. return smalltalk.withContext(function($ctx1) {
  3738. var $1;
  3739. _st(_st(window)._jQuery_(".dialog"))._keyup_((function(e){
  3740. return smalltalk.withContext(function($ctx2) {
  3741. $1=_st(_st(e)._keyCode()).__eq((27));
  3742. if(smalltalk.assert($1)){
  3743. return self._cancel();
  3744. };
  3745. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  3746. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLModalWidget)})},
  3747. args: [],
  3748. source: "setupKeyBindings\x0a\x09(window jQuery: '.dialog') keyup: [ :e |\x0a\x09\x09e keyCode = 27 ifTrue: [ self cancel ] ]",
  3749. messageSends: ["keyup:", "ifTrue:", "cancel", "=", "keyCode", "jQuery:"],
  3750. referencedClasses: []
  3751. }),
  3752. smalltalk.HLModalWidget);
  3753. smalltalk.addClass('HLConfirmationWidget', smalltalk.HLModalWidget, ['confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
  3754. smalltalk.HLConfirmationWidget.comment="I display confirmation messages. \x0a\x0aInstead of creating an instance directly, use `HLWidget >> #confirm:ifTrue:`.";
  3755. smalltalk.addMethod(
  3756. smalltalk.method({
  3757. selector: "actionBlock",
  3758. category: 'accessing',
  3759. fn: function (){
  3760. var self=this;
  3761. return smalltalk.withContext(function($ctx1) {
  3762. var $2,$1;
  3763. $2=self["@actionBlock"];
  3764. if(($receiver = $2) == nil || $receiver == undefined){
  3765. $1=(function(){
  3766. return smalltalk.withContext(function($ctx2) {
  3767. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  3768. } else {
  3769. $1=$2;
  3770. };
  3771. return $1;
  3772. }, function($ctx1) {$ctx1.fill(self,"actionBlock",{},smalltalk.HLConfirmationWidget)})},
  3773. args: [],
  3774. source: "actionBlock\x0a\x09^ actionBlock ifNil: [ [] ]",
  3775. messageSends: ["ifNil:"],
  3776. referencedClasses: []
  3777. }),
  3778. smalltalk.HLConfirmationWidget);
  3779. smalltalk.addMethod(
  3780. smalltalk.method({
  3781. selector: "actionBlock:",
  3782. category: 'accessing',
  3783. fn: function (aBlock){
  3784. var self=this;
  3785. return smalltalk.withContext(function($ctx1) {
  3786. self["@actionBlock"]=aBlock;
  3787. return self}, function($ctx1) {$ctx1.fill(self,"actionBlock:",{aBlock:aBlock},smalltalk.HLConfirmationWidget)})},
  3788. args: ["aBlock"],
  3789. source: "actionBlock: aBlock\x0a\x09actionBlock := aBlock",
  3790. messageSends: [],
  3791. referencedClasses: []
  3792. }),
  3793. smalltalk.HLConfirmationWidget);
  3794. smalltalk.addMethod(
  3795. smalltalk.method({
  3796. selector: "cancel",
  3797. category: 'actions',
  3798. fn: function (){
  3799. var self=this;
  3800. return smalltalk.withContext(function($ctx1) {
  3801. _st(self._cancelBlock())._value();
  3802. self._remove();
  3803. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLConfirmationWidget)})},
  3804. args: [],
  3805. source: "cancel\x0a\x09self cancelBlock value.\x0a\x09self remove",
  3806. messageSends: ["value", "cancelBlock", "remove"],
  3807. referencedClasses: []
  3808. }),
  3809. smalltalk.HLConfirmationWidget);
  3810. smalltalk.addMethod(
  3811. smalltalk.method({
  3812. selector: "cancelBlock",
  3813. category: 'accessing',
  3814. fn: function (){
  3815. var self=this;
  3816. return smalltalk.withContext(function($ctx1) {
  3817. var $2,$1;
  3818. $2=self["@cancelBlock"];
  3819. if(($receiver = $2) == nil || $receiver == undefined){
  3820. $1=(function(){
  3821. return smalltalk.withContext(function($ctx2) {
  3822. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  3823. } else {
  3824. $1=$2;
  3825. };
  3826. return $1;
  3827. }, function($ctx1) {$ctx1.fill(self,"cancelBlock",{},smalltalk.HLConfirmationWidget)})},
  3828. args: [],
  3829. source: "cancelBlock\x0a\x09^ cancelBlock ifNil: [ [] ]",
  3830. messageSends: ["ifNil:"],
  3831. referencedClasses: []
  3832. }),
  3833. smalltalk.HLConfirmationWidget);
  3834. smalltalk.addMethod(
  3835. smalltalk.method({
  3836. selector: "cancelBlock:",
  3837. category: 'accessing',
  3838. fn: function (aBlock){
  3839. var self=this;
  3840. return smalltalk.withContext(function($ctx1) {
  3841. self["@cancelBlock"]=aBlock;
  3842. return self}, function($ctx1) {$ctx1.fill(self,"cancelBlock:",{aBlock:aBlock},smalltalk.HLConfirmationWidget)})},
  3843. args: ["aBlock"],
  3844. source: "cancelBlock: aBlock\x0a\x09cancelBlock := aBlock",
  3845. messageSends: [],
  3846. referencedClasses: []
  3847. }),
  3848. smalltalk.HLConfirmationWidget);
  3849. smalltalk.addMethod(
  3850. smalltalk.method({
  3851. selector: "confirm",
  3852. category: 'actions',
  3853. fn: function (){
  3854. var self=this;
  3855. return smalltalk.withContext(function($ctx1) {
  3856. _st(self._actionBlock())._value();
  3857. self._remove();
  3858. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLConfirmationWidget)})},
  3859. args: [],
  3860. source: "confirm\x0a\x09self actionBlock value.\x0a\x09self remove",
  3861. messageSends: ["value", "actionBlock", "remove"],
  3862. referencedClasses: []
  3863. }),
  3864. smalltalk.HLConfirmationWidget);
  3865. smalltalk.addMethod(
  3866. smalltalk.method({
  3867. selector: "confirmationString",
  3868. category: 'accessing',
  3869. fn: function (){
  3870. var self=this;
  3871. return smalltalk.withContext(function($ctx1) {
  3872. var $2,$1;
  3873. $2=self["@confirmationString"];
  3874. if(($receiver = $2) == nil || $receiver == undefined){
  3875. $1="Confirm";
  3876. } else {
  3877. $1=$2;
  3878. };
  3879. return $1;
  3880. }, function($ctx1) {$ctx1.fill(self,"confirmationString",{},smalltalk.HLConfirmationWidget)})},
  3881. args: [],
  3882. source: "confirmationString\x0a\x09^ confirmationString ifNil: [ 'Confirm' ]",
  3883. messageSends: ["ifNil:"],
  3884. referencedClasses: []
  3885. }),
  3886. smalltalk.HLConfirmationWidget);
  3887. smalltalk.addMethod(
  3888. smalltalk.method({
  3889. selector: "confirmationString:",
  3890. category: 'accessing',
  3891. fn: function (aString){
  3892. var self=this;
  3893. return smalltalk.withContext(function($ctx1) {
  3894. self["@confirmationString"]=aString;
  3895. return self}, function($ctx1) {$ctx1.fill(self,"confirmationString:",{aString:aString},smalltalk.HLConfirmationWidget)})},
  3896. args: ["aString"],
  3897. source: "confirmationString: aString\x0a\x09confirmationString := aString",
  3898. messageSends: [],
  3899. referencedClasses: []
  3900. }),
  3901. smalltalk.HLConfirmationWidget);
  3902. smalltalk.addMethod(
  3903. smalltalk.method({
  3904. selector: "remove",
  3905. category: 'actions',
  3906. fn: function (){
  3907. var self=this;
  3908. return smalltalk.withContext(function($ctx1) {
  3909. _st(_st(window)._jQuery_(".dialog"))._removeClass_("active");
  3910. _st((function(){
  3911. return smalltalk.withContext(function($ctx2) {
  3912. _st(_st(window)._jQuery_("#overlay"))._remove();
  3913. return _st(_st(window)._jQuery_(".dialog"))._remove();
  3914. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  3915. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLConfirmationWidget)})},
  3916. args: [],
  3917. source: "remove\x0a\x09(window jQuery: '.dialog') removeClass: 'active'.\x0a\x09[ \x0a\x09\x09(window jQuery: '#overlay') remove.\x0a\x09\x09(window jQuery: '.dialog') remove\x0a\x09] valueWithTimeout: 300",
  3918. messageSends: ["removeClass:", "jQuery:", "valueWithTimeout:", "remove"],
  3919. referencedClasses: []
  3920. }),
  3921. smalltalk.HLConfirmationWidget);
  3922. smalltalk.addMethod(
  3923. smalltalk.method({
  3924. selector: "renderButtonsOn:",
  3925. category: 'rendering',
  3926. fn: function (html){
  3927. var self=this;
  3928. var confirmButton;
  3929. return smalltalk.withContext(function($ctx1) {
  3930. var $1,$3,$4,$5,$6,$2;
  3931. $1=_st(html)._div();
  3932. _st($1)._class_("buttons");
  3933. $2=_st($1)._with_((function(){
  3934. return smalltalk.withContext(function($ctx2) {
  3935. $3=_st(html)._button();
  3936. _st($3)._class_("button");
  3937. _st($3)._with_("Cancel");
  3938. $4=_st($3)._onClick_((function(){
  3939. return smalltalk.withContext(function($ctx3) {
  3940. return self._cancel();
  3941. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3942. $4;
  3943. $5=_st(html)._button();
  3944. _st($5)._class_("button default");
  3945. _st($5)._with_("Confirm");
  3946. $6=_st($5)._onClick_((function(){
  3947. return smalltalk.withContext(function($ctx3) {
  3948. return self._confirm();
  3949. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}));
  3950. confirmButton=$6;
  3951. return confirmButton;
  3952. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3953. _st(_st(confirmButton)._asJQuery())._focus();
  3954. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html,confirmButton:confirmButton},smalltalk.HLConfirmationWidget)})},
  3955. args: ["html"],
  3956. source: "renderButtonsOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div \x0a\x09\x09class: 'buttons';\x0a\x09\x09with: [\x0a\x09\x09\x09html button\x0a\x09\x09\x09\x09class: 'button';\x0a\x09\x09\x09\x09with: 'Cancel';\x0a\x09\x09\x09\x09onClick: [ self cancel ].\x0a\x09\x09\x09confirmButton := html button\x0a\x09\x09\x09\x09class: 'button default';\x0a\x09\x09\x09\x09with: 'Confirm';\x0a\x09\x09\x09\x09onClick: [ self confirm ] ].\x0a\x0a\x09confirmButton asJQuery focus",
  3957. messageSends: ["class:", "div", "with:", "button", "onClick:", "cancel", "confirm", "focus", "asJQuery"],
  3958. referencedClasses: []
  3959. }),
  3960. smalltalk.HLConfirmationWidget);
  3961. smalltalk.addMethod(
  3962. smalltalk.method({
  3963. selector: "renderMainOn:",
  3964. category: 'rendering',
  3965. fn: function (html){
  3966. var self=this;
  3967. return smalltalk.withContext(function($ctx1) {
  3968. _st(_st(html)._span())._with_(self._confirmationString());
  3969. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLConfirmationWidget)})},
  3970. args: ["html"],
  3971. source: "renderMainOn: html\x0a\x09html span with: self confirmationString",
  3972. messageSends: ["with:", "confirmationString", "span"],
  3973. referencedClasses: []
  3974. }),
  3975. smalltalk.HLConfirmationWidget);
  3976. smalltalk.addClass('HLRequestWidget', smalltalk.HLConfirmationWidget, ['input', 'value'], 'Helios-Core');
  3977. smalltalk.HLRequestWidget.comment="I display a modal window requesting user input.\x0a\x0aInstead of creating instances manually, use `HLWidget >> #request:do:` and `#request:value:do:`.";
  3978. smalltalk.addMethod(
  3979. smalltalk.method({
  3980. selector: "confirm",
  3981. category: 'actions',
  3982. fn: function (){
  3983. var self=this;
  3984. return smalltalk.withContext(function($ctx1) {
  3985. _st(self._actionBlock())._value_(_st(_st(self["@input"])._asJQuery())._val());
  3986. self._remove();
  3987. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLRequestWidget)})},
  3988. args: [],
  3989. source: "confirm\x0a\x09self actionBlock value: input asJQuery val.\x0a\x09self remove",
  3990. messageSends: ["value:", "val", "asJQuery", "actionBlock", "remove"],
  3991. referencedClasses: []
  3992. }),
  3993. smalltalk.HLRequestWidget);
  3994. smalltalk.addMethod(
  3995. smalltalk.method({
  3996. selector: "cssClass",
  3997. category: 'accessing',
  3998. fn: function (){
  3999. var self=this;
  4000. return smalltalk.withContext(function($ctx1) {
  4001. return "large";
  4002. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLRequestWidget)})},
  4003. args: [],
  4004. source: "cssClass\x0a\x09^ 'large'",
  4005. messageSends: [],
  4006. referencedClasses: []
  4007. }),
  4008. smalltalk.HLRequestWidget);
  4009. smalltalk.addMethod(
  4010. smalltalk.method({
  4011. selector: "renderMainOn:",
  4012. category: 'rendering',
  4013. fn: function (html){
  4014. var self=this;
  4015. return smalltalk.withContext(function($ctx1) {
  4016. smalltalk.HLConfirmationWidget.fn.prototype._renderMainOn_.apply(_st(self), [html]);
  4017. self["@input"]=_st(html)._textarea();
  4018. _st(_st(self["@input"])._asJQuery())._val_(self._value());
  4019. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLRequestWidget)})},
  4020. args: ["html"],
  4021. source: "renderMainOn: html\x0a\x09super renderMainOn: html.\x0a\x09input := html textarea.\x0a\x09input asJQuery val: self value",
  4022. messageSends: ["renderMainOn:", "textarea", "val:", "value", "asJQuery"],
  4023. referencedClasses: []
  4024. }),
  4025. smalltalk.HLRequestWidget);
  4026. smalltalk.addMethod(
  4027. smalltalk.method({
  4028. selector: "value",
  4029. category: 'accessing',
  4030. fn: function (){
  4031. var self=this;
  4032. return smalltalk.withContext(function($ctx1) {
  4033. var $2,$1;
  4034. $2=self["@value"];
  4035. if(($receiver = $2) == nil || $receiver == undefined){
  4036. $1="";
  4037. } else {
  4038. $1=$2;
  4039. };
  4040. return $1;
  4041. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.HLRequestWidget)})},
  4042. args: [],
  4043. source: "value\x0a\x09^ value ifNil: [ '' ]",
  4044. messageSends: ["ifNil:"],
  4045. referencedClasses: []
  4046. }),
  4047. smalltalk.HLRequestWidget);
  4048. smalltalk.addMethod(
  4049. smalltalk.method({
  4050. selector: "value:",
  4051. category: 'accessing',
  4052. fn: function (aString){
  4053. var self=this;
  4054. return smalltalk.withContext(function($ctx1) {
  4055. self["@value"]=aString;
  4056. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},smalltalk.HLRequestWidget)})},
  4057. args: ["aString"],
  4058. source: "value: aString\x0a\x09value := aString",
  4059. messageSends: [],
  4060. referencedClasses: []
  4061. }),
  4062. smalltalk.HLRequestWidget);
  4063. smalltalk.addClass('HLProgressWidget', smalltalk.HLModalWidget, ['progressBars', 'visible'], 'Helios-Core');
  4064. smalltalk.HLProgressWidget.comment="I am a widget used to display progress modal dialogs.\x0a\x0aMy default instance is accessed with `HLProgressWidget class >> #default`.\x0a\x0aSee `HLProgressHandler` for usage.";
  4065. smalltalk.addMethod(
  4066. smalltalk.method({
  4067. selector: "addProgressBar:",
  4068. category: 'actions',
  4069. fn: function (aProgressBar){
  4070. var self=this;
  4071. return smalltalk.withContext(function($ctx1) {
  4072. self._show();
  4073. _st(self._progressBars())._add_(aProgressBar);
  4074. _st(aProgressBar)._appendToJQuery_(_st(_st(self._wrapper())._asJQuery())._find_(".dialog"));
  4075. return self}, function($ctx1) {$ctx1.fill(self,"addProgressBar:",{aProgressBar:aProgressBar},smalltalk.HLProgressWidget)})},
  4076. args: ["aProgressBar"],
  4077. source: "addProgressBar: aProgressBar\x0a\x09self show.\x0a\x09self progressBars add: aProgressBar.\x0a\x09aProgressBar appendToJQuery: (self wrapper asJQuery find: '.dialog')",
  4078. messageSends: ["show", "add:", "progressBars", "appendToJQuery:", "find:", "asJQuery", "wrapper"],
  4079. referencedClasses: []
  4080. }),
  4081. smalltalk.HLProgressWidget);
  4082. smalltalk.addMethod(
  4083. smalltalk.method({
  4084. selector: "do:on:displaying:",
  4085. category: 'actions',
  4086. fn: function (aBlock,aCollection,aString){
  4087. var self=this;
  4088. var progressBar;
  4089. function $HLProgressBarWidget(){return smalltalk.HLProgressBarWidget||(typeof HLProgressBarWidget=="undefined"?nil:HLProgressBarWidget)}
  4090. return smalltalk.withContext(function($ctx1) {
  4091. var $1,$2;
  4092. $1=_st($HLProgressBarWidget())._new();
  4093. _st($1)._parent_(self);
  4094. _st($1)._label_(aString);
  4095. _st($1)._workBlock_(aBlock);
  4096. _st($1)._collection_(aCollection);
  4097. $2=_st($1)._yourself();
  4098. progressBar=$2;
  4099. self._addProgressBar_(progressBar);
  4100. _st(progressBar)._start();
  4101. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString,progressBar:progressBar},smalltalk.HLProgressWidget)})},
  4102. args: ["aBlock", "aCollection", "aString"],
  4103. source: "do: aBlock on: aCollection displaying: aString\x0a\x09| progressBar |\x0a\x09\x0a\x09progressBar := HLProgressBarWidget new\x0a\x09\x09parent: self;\x0a\x09\x09label: aString;\x0a\x09\x09workBlock: aBlock;\x0a\x09\x09collection: aCollection;\x0a\x09\x09yourself.\x0a\x09\x0a\x09self addProgressBar: progressBar.\x0a\x09progressBar start",
  4104. messageSends: ["parent:", "new", "label:", "workBlock:", "collection:", "yourself", "addProgressBar:", "start"],
  4105. referencedClasses: ["HLProgressBarWidget"]
  4106. }),
  4107. smalltalk.HLProgressWidget);
  4108. smalltalk.addMethod(
  4109. smalltalk.method({
  4110. selector: "flush",
  4111. category: 'actions',
  4112. fn: function (){
  4113. var self=this;
  4114. return smalltalk.withContext(function($ctx1) {
  4115. _st(self._progressBars())._do_((function(each){
  4116. return smalltalk.withContext(function($ctx2) {
  4117. return self._removeProgressBar_(each);
  4118. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4119. return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.HLProgressWidget)})},
  4120. args: [],
  4121. source: "flush\x0a\x09self progressBars do: [ :each |\x0a\x09\x09self removeProgressBar: each ]",
  4122. messageSends: ["do:", "removeProgressBar:", "progressBars"],
  4123. referencedClasses: []
  4124. }),
  4125. smalltalk.HLProgressWidget);
  4126. smalltalk.addMethod(
  4127. smalltalk.method({
  4128. selector: "isVisible",
  4129. category: 'testing',
  4130. fn: function (){
  4131. var self=this;
  4132. return smalltalk.withContext(function($ctx1) {
  4133. var $2,$1;
  4134. $2=self["@visible"];
  4135. if(($receiver = $2) == nil || $receiver == undefined){
  4136. $1=false;
  4137. } else {
  4138. $1=$2;
  4139. };
  4140. return $1;
  4141. }, function($ctx1) {$ctx1.fill(self,"isVisible",{},smalltalk.HLProgressWidget)})},
  4142. args: [],
  4143. source: "isVisible\x0a\x09^ visible ifNil: [ false ]",
  4144. messageSends: ["ifNil:"],
  4145. referencedClasses: []
  4146. }),
  4147. smalltalk.HLProgressWidget);
  4148. smalltalk.addMethod(
  4149. smalltalk.method({
  4150. selector: "progressBars",
  4151. category: 'accessing',
  4152. fn: function (){
  4153. var self=this;
  4154. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  4155. return smalltalk.withContext(function($ctx1) {
  4156. var $2,$1;
  4157. $2=self["@progressBars"];
  4158. if(($receiver = $2) == nil || $receiver == undefined){
  4159. self["@progressBars"]=_st($OrderedCollection())._new();
  4160. $1=self["@progressBars"];
  4161. } else {
  4162. $1=$2;
  4163. };
  4164. return $1;
  4165. }, function($ctx1) {$ctx1.fill(self,"progressBars",{},smalltalk.HLProgressWidget)})},
  4166. args: [],
  4167. source: "progressBars\x0a\x09^ progressBars ifNil: [ progressBars := OrderedCollection new ]",
  4168. messageSends: ["ifNil:", "new"],
  4169. referencedClasses: ["OrderedCollection"]
  4170. }),
  4171. smalltalk.HLProgressWidget);
  4172. smalltalk.addMethod(
  4173. smalltalk.method({
  4174. selector: "remove",
  4175. category: 'actions',
  4176. fn: function (){
  4177. var self=this;
  4178. return smalltalk.withContext(function($ctx1) {
  4179. var $1;
  4180. $1=self._isVisible();
  4181. if(smalltalk.assert($1)){
  4182. self["@visible"]=false;
  4183. self["@visible"];
  4184. smalltalk.HLModalWidget.fn.prototype._remove.apply(_st(self), []);
  4185. };
  4186. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLProgressWidget)})},
  4187. args: [],
  4188. source: "remove\x0a\x09self isVisible ifTrue: [\x0a\x09\x09visible := false.\x0a\x09\x09super remove ]",
  4189. messageSends: ["ifTrue:", "remove", "isVisible"],
  4190. referencedClasses: []
  4191. }),
  4192. smalltalk.HLProgressWidget);
  4193. smalltalk.addMethod(
  4194. smalltalk.method({
  4195. selector: "removeProgressBar:",
  4196. category: 'actions',
  4197. fn: function (aProgressBar){
  4198. var self=this;
  4199. return smalltalk.withContext(function($ctx1) {
  4200. _st(self._progressBars())._remove_ifAbsent_(aProgressBar,(function(){
  4201. return smalltalk.withContext(function($ctx2) {
  4202. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4203. _st(_st(_st(aProgressBar)._wrapper())._asJQuery())._remove();
  4204. _st(self._progressBars())._ifEmpty_((function(){
  4205. return smalltalk.withContext(function($ctx2) {
  4206. return self._remove();
  4207. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4208. return self}, function($ctx1) {$ctx1.fill(self,"removeProgressBar:",{aProgressBar:aProgressBar},smalltalk.HLProgressWidget)})},
  4209. args: ["aProgressBar"],
  4210. source: "removeProgressBar: aProgressBar\x0a\x09self progressBars remove: aProgressBar ifAbsent: [].\x0a\x09aProgressBar wrapper asJQuery remove.\x0a\x09\x0a\x09self progressBars ifEmpty: [ self remove ]",
  4211. messageSends: ["remove:ifAbsent:", "progressBars", "remove", "asJQuery", "wrapper", "ifEmpty:"],
  4212. referencedClasses: []
  4213. }),
  4214. smalltalk.HLProgressWidget);
  4215. smalltalk.addMethod(
  4216. smalltalk.method({
  4217. selector: "renderButtonsOn:",
  4218. category: 'rendering',
  4219. fn: function (html){
  4220. var self=this;
  4221. return smalltalk.withContext(function($ctx1) {
  4222. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLProgressWidget)})},
  4223. args: ["html"],
  4224. source: "renderButtonsOn: html",
  4225. messageSends: [],
  4226. referencedClasses: []
  4227. }),
  4228. smalltalk.HLProgressWidget);
  4229. smalltalk.addMethod(
  4230. smalltalk.method({
  4231. selector: "renderMainOn:",
  4232. category: 'rendering',
  4233. fn: function (html){
  4234. var self=this;
  4235. return smalltalk.withContext(function($ctx1) {
  4236. _st(self._progressBars())._do_((function(each){
  4237. return smalltalk.withContext(function($ctx2) {
  4238. return _st(html)._with_(each);
  4239. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  4240. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLProgressWidget)})},
  4241. args: ["html"],
  4242. source: "renderMainOn: html\x0a\x09self progressBars do: [ :each |\x0a\x09\x09html with: each ]",
  4243. messageSends: ["do:", "with:", "progressBars"],
  4244. referencedClasses: []
  4245. }),
  4246. smalltalk.HLProgressWidget);
  4247. smalltalk.addMethod(
  4248. smalltalk.method({
  4249. selector: "show",
  4250. category: 'actions',
  4251. fn: function (){
  4252. var self=this;
  4253. return smalltalk.withContext(function($ctx1) {
  4254. var $1;
  4255. $1=self._isVisible();
  4256. if(! smalltalk.assert($1)){
  4257. self["@visible"]=true;
  4258. self["@visible"];
  4259. self._appendToJQuery_("body"._asJQuery());
  4260. };
  4261. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLProgressWidget)})},
  4262. args: [],
  4263. source: "show\x0a\x09self isVisible ifFalse: [\x0a\x09\x09visible := true.\x0a\x09\x09self appendToJQuery: 'body' asJQuery ]",
  4264. messageSends: ["ifFalse:", "appendToJQuery:", "asJQuery", "isVisible"],
  4265. referencedClasses: []
  4266. }),
  4267. smalltalk.HLProgressWidget);
  4268. smalltalk.HLProgressWidget.klass.iVarNames = ['default'];
  4269. smalltalk.addMethod(
  4270. smalltalk.method({
  4271. selector: "default",
  4272. category: 'accessing',
  4273. fn: function (){
  4274. var self=this;
  4275. return smalltalk.withContext(function($ctx1) {
  4276. var $2,$1;
  4277. $2=self["@default"];
  4278. if(($receiver = $2) == nil || $receiver == undefined){
  4279. self["@default"]=self._new();
  4280. $1=self["@default"];
  4281. } else {
  4282. $1=$2;
  4283. };
  4284. return $1;
  4285. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.HLProgressWidget.klass)})},
  4286. args: [],
  4287. source: "default\x0a\x09^ default ifNil: [ default := self new ]",
  4288. messageSends: ["ifNil:", "new"],
  4289. referencedClasses: []
  4290. }),
  4291. smalltalk.HLProgressWidget.klass);
  4292. smalltalk.addClass('HLProgressBarWidget', smalltalk.HLWidget, ['label', 'parent', 'workBlock', 'collection', 'bar'], 'Helios-Core');
  4293. smalltalk.HLProgressBarWidget.comment="I am a widget used to display a progress bar while iterating over a collection.";
  4294. smalltalk.addMethod(
  4295. smalltalk.method({
  4296. selector: "collection",
  4297. category: 'accessing',
  4298. fn: function (){
  4299. var self=this;
  4300. return smalltalk.withContext(function($ctx1) {
  4301. var $1;
  4302. $1=self["@collection"];
  4303. return $1;
  4304. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.HLProgressBarWidget)})},
  4305. args: [],
  4306. source: "collection\x0a\x09^ collection",
  4307. messageSends: [],
  4308. referencedClasses: []
  4309. }),
  4310. smalltalk.HLProgressBarWidget);
  4311. smalltalk.addMethod(
  4312. smalltalk.method({
  4313. selector: "collection:",
  4314. category: 'accessing',
  4315. fn: function (aCollection){
  4316. var self=this;
  4317. return smalltalk.withContext(function($ctx1) {
  4318. self["@collection"]=aCollection;
  4319. return self}, function($ctx1) {$ctx1.fill(self,"collection:",{aCollection:aCollection},smalltalk.HLProgressBarWidget)})},
  4320. args: ["aCollection"],
  4321. source: "collection: aCollection\x0a\x09collection := aCollection",
  4322. messageSends: [],
  4323. referencedClasses: []
  4324. }),
  4325. smalltalk.HLProgressBarWidget);
  4326. smalltalk.addMethod(
  4327. smalltalk.method({
  4328. selector: "evaluateAt:",
  4329. category: 'actions',
  4330. fn: function (anInteger){
  4331. var self=this;
  4332. return smalltalk.withContext(function($ctx1) {
  4333. var $1;
  4334. self._updateProgress_(_st(_st(anInteger).__slash(_st(self._collection())._size())).__star((100)));
  4335. $1=_st(anInteger).__lt_eq(_st(self._collection())._size());
  4336. if(smalltalk.assert($1)){
  4337. _st((function(){
  4338. return smalltalk.withContext(function($ctx2) {
  4339. _st(self._workBlock())._value_(_st(self._collection())._at_(anInteger));
  4340. return self._evaluateAt_(_st(anInteger).__plus((1)));
  4341. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((10));
  4342. } else {
  4343. _st((function(){
  4344. return smalltalk.withContext(function($ctx2) {
  4345. return self._remove();
  4346. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((500));
  4347. };
  4348. return self}, function($ctx1) {$ctx1.fill(self,"evaluateAt:",{anInteger:anInteger},smalltalk.HLProgressBarWidget)})},
  4349. args: ["anInteger"],
  4350. source: "evaluateAt: anInteger\x0a\x09self updateProgress: (anInteger / self collection size) * 100.\x0a\x09anInteger <= self collection size\x0a\x09\x09ifTrue: [ \x0a\x09\x09\x09[ \x0a\x09\x09\x09\x09self workBlock value: (self collection at: anInteger).\x0a\x09\x09\x09\x09self evaluateAt: anInteger + 1 ] valueWithTimeout: 10 ]\x0a\x09\x09ifFalse: [ [ self remove ] valueWithTimeout: 500 ]",
  4351. messageSends: ["updateProgress:", "*", "/", "size", "collection", "ifTrue:ifFalse:", "valueWithTimeout:", "value:", "at:", "workBlock", "evaluateAt:", "+", "remove", "<="],
  4352. referencedClasses: []
  4353. }),
  4354. smalltalk.HLProgressBarWidget);
  4355. smalltalk.addMethod(
  4356. smalltalk.method({
  4357. selector: "label",
  4358. category: 'accessing',
  4359. fn: function (){
  4360. var self=this;
  4361. return smalltalk.withContext(function($ctx1) {
  4362. var $1;
  4363. $1=self["@label"];
  4364. return $1;
  4365. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLProgressBarWidget)})},
  4366. args: [],
  4367. source: "label\x0a\x09^ label",
  4368. messageSends: [],
  4369. referencedClasses: []
  4370. }),
  4371. smalltalk.HLProgressBarWidget);
  4372. smalltalk.addMethod(
  4373. smalltalk.method({
  4374. selector: "label:",
  4375. category: 'accessing',
  4376. fn: function (aString){
  4377. var self=this;
  4378. return smalltalk.withContext(function($ctx1) {
  4379. self["@label"]=aString;
  4380. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLProgressBarWidget)})},
  4381. args: ["aString"],
  4382. source: "label: aString\x0a\x09label := aString",
  4383. messageSends: [],
  4384. referencedClasses: []
  4385. }),
  4386. smalltalk.HLProgressBarWidget);
  4387. smalltalk.addMethod(
  4388. smalltalk.method({
  4389. selector: "parent",
  4390. category: 'accessing',
  4391. fn: function (){
  4392. var self=this;
  4393. return smalltalk.withContext(function($ctx1) {
  4394. var $1;
  4395. $1=self["@parent"];
  4396. return $1;
  4397. }, function($ctx1) {$ctx1.fill(self,"parent",{},smalltalk.HLProgressBarWidget)})},
  4398. args: [],
  4399. source: "parent\x0a\x09^ parent",
  4400. messageSends: [],
  4401. referencedClasses: []
  4402. }),
  4403. smalltalk.HLProgressBarWidget);
  4404. smalltalk.addMethod(
  4405. smalltalk.method({
  4406. selector: "parent:",
  4407. category: 'accessing',
  4408. fn: function (aProgress){
  4409. var self=this;
  4410. return smalltalk.withContext(function($ctx1) {
  4411. self["@parent"]=aProgress;
  4412. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{aProgress:aProgress},smalltalk.HLProgressBarWidget)})},
  4413. args: ["aProgress"],
  4414. source: "parent: aProgress\x0a\x09parent := aProgress",
  4415. messageSends: [],
  4416. referencedClasses: []
  4417. }),
  4418. smalltalk.HLProgressBarWidget);
  4419. smalltalk.addMethod(
  4420. smalltalk.method({
  4421. selector: "remove",
  4422. category: 'actions',
  4423. fn: function (){
  4424. var self=this;
  4425. return smalltalk.withContext(function($ctx1) {
  4426. _st(self._parent())._removeProgressBar_(self);
  4427. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLProgressBarWidget)})},
  4428. args: [],
  4429. source: "remove\x0a\x09self parent removeProgressBar: self",
  4430. messageSends: ["removeProgressBar:", "parent"],
  4431. referencedClasses: []
  4432. }),
  4433. smalltalk.HLProgressBarWidget);
  4434. smalltalk.addMethod(
  4435. smalltalk.method({
  4436. selector: "renderContentOn:",
  4437. category: 'rendering',
  4438. fn: function (html){
  4439. var self=this;
  4440. return smalltalk.withContext(function($ctx1) {
  4441. var $1,$3,$4,$2;
  4442. _st(_st(html)._span())._with_(self._label());
  4443. $1=_st(html)._div();
  4444. _st($1)._class_("progress");
  4445. $2=_st($1)._with_((function(){
  4446. return smalltalk.withContext(function($ctx2) {
  4447. $3=_st(html)._div();
  4448. _st($3)._class_("bar");
  4449. $4=_st($3)._style_("width: 0%");
  4450. self["@bar"]=$4;
  4451. return self["@bar"];
  4452. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  4453. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLProgressBarWidget)})},
  4454. args: ["html"],
  4455. source: "renderContentOn: html\x0a\x09html span with: self label.\x0a\x09html div \x0a\x09\x09class: 'progress';\x0a\x09\x09with: [\x0a\x09\x09\x09bar := html div \x0a\x09\x09\x09\x09class: 'bar';\x0a\x09\x09\x09\x09style: 'width: 0%' ]",
  4456. messageSends: ["with:", "label", "span", "class:", "div", "style:"],
  4457. referencedClasses: []
  4458. }),
  4459. smalltalk.HLProgressBarWidget);
  4460. smalltalk.addMethod(
  4461. smalltalk.method({
  4462. selector: "start",
  4463. category: 'actions',
  4464. fn: function (){
  4465. var self=this;
  4466. return smalltalk.withContext(function($ctx1) {
  4467. self._evaluateAt_((1));
  4468. return self}, function($ctx1) {$ctx1.fill(self,"start",{},smalltalk.HLProgressBarWidget)})},
  4469. args: [],
  4470. source: "start\x0a\x09\x22Make sure the UI has some time to update itself between each iteration\x22\x0a\x09\x0a\x09self evaluateAt: 1",
  4471. messageSends: ["evaluateAt:"],
  4472. referencedClasses: []
  4473. }),
  4474. smalltalk.HLProgressBarWidget);
  4475. smalltalk.addMethod(
  4476. smalltalk.method({
  4477. selector: "updateProgress:",
  4478. category: 'actions',
  4479. fn: function (anInteger){
  4480. var self=this;
  4481. return smalltalk.withContext(function($ctx1) {
  4482. _st(_st(self["@bar"])._asJQuery())._css_put_("width",_st(_st(anInteger)._asString()).__comma("%"));
  4483. return self}, function($ctx1) {$ctx1.fill(self,"updateProgress:",{anInteger:anInteger},smalltalk.HLProgressBarWidget)})},
  4484. args: ["anInteger"],
  4485. source: "updateProgress: anInteger\x0a\x09bar asJQuery css: 'width' put: anInteger asString, '%'",
  4486. messageSends: ["css:put:", ",", "asString", "asJQuery"],
  4487. referencedClasses: []
  4488. }),
  4489. smalltalk.HLProgressBarWidget);
  4490. smalltalk.addMethod(
  4491. smalltalk.method({
  4492. selector: "workBlock",
  4493. category: 'accessing',
  4494. fn: function (){
  4495. var self=this;
  4496. return smalltalk.withContext(function($ctx1) {
  4497. var $1;
  4498. $1=self["@workBlock"];
  4499. return $1;
  4500. }, function($ctx1) {$ctx1.fill(self,"workBlock",{},smalltalk.HLProgressBarWidget)})},
  4501. args: [],
  4502. source: "workBlock\x0a\x09^ workBlock",
  4503. messageSends: [],
  4504. referencedClasses: []
  4505. }),
  4506. smalltalk.HLProgressBarWidget);
  4507. smalltalk.addMethod(
  4508. smalltalk.method({
  4509. selector: "workBlock:",
  4510. category: 'accessing',
  4511. fn: function (aBlock){
  4512. var self=this;
  4513. return smalltalk.withContext(function($ctx1) {
  4514. self["@workBlock"]=aBlock;
  4515. return self}, function($ctx1) {$ctx1.fill(self,"workBlock:",{aBlock:aBlock},smalltalk.HLProgressBarWidget)})},
  4516. args: ["aBlock"],
  4517. source: "workBlock: aBlock\x0a\x09workBlock := aBlock",
  4518. messageSends: [],
  4519. referencedClasses: []
  4520. }),
  4521. smalltalk.HLProgressBarWidget);
  4522. smalltalk.HLProgressBarWidget.klass.iVarNames = ['default'];
  4523. smalltalk.addMethod(
  4524. smalltalk.method({
  4525. selector: "default",
  4526. category: 'accessing',
  4527. fn: function (){
  4528. var self=this;
  4529. return smalltalk.withContext(function($ctx1) {
  4530. var $2,$1;
  4531. $2=self["@default"];
  4532. if(($receiver = $2) == nil || $receiver == undefined){
  4533. self["@default"]=self._new();
  4534. $1=self["@default"];
  4535. } else {
  4536. $1=$2;
  4537. };
  4538. return $1;
  4539. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.HLProgressBarWidget.klass)})},
  4540. args: [],
  4541. source: "default\x0a\x09^ default ifNil: [ default := self new ]",
  4542. messageSends: ["ifNil:", "new"],
  4543. referencedClasses: []
  4544. }),
  4545. smalltalk.HLProgressBarWidget.klass);
  4546. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  4547. smalltalk.addMethod(
  4548. smalltalk.method({
  4549. selector: "canBeOpenAsTab",
  4550. category: 'testing',
  4551. fn: function (){
  4552. var self=this;
  4553. return smalltalk.withContext(function($ctx1) {
  4554. return true;
  4555. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSUnit.klass)})},
  4556. args: [],
  4557. source: "canBeOpenAsTab\x0a\x09^ true",
  4558. messageSends: [],
  4559. referencedClasses: []
  4560. }),
  4561. smalltalk.HLSUnit.klass);
  4562. smalltalk.addMethod(
  4563. smalltalk.method({
  4564. selector: "tabClass",
  4565. category: 'accessing',
  4566. fn: function (){
  4567. var self=this;
  4568. return smalltalk.withContext(function($ctx1) {
  4569. return "sunit";
  4570. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLSUnit.klass)})},
  4571. args: [],
  4572. source: "tabClass\x0a\x09^ 'sunit'",
  4573. messageSends: [],
  4574. referencedClasses: []
  4575. }),
  4576. smalltalk.HLSUnit.klass);
  4577. smalltalk.addMethod(
  4578. smalltalk.method({
  4579. selector: "tabLabel",
  4580. category: 'accessing',
  4581. fn: function (){
  4582. var self=this;
  4583. return smalltalk.withContext(function($ctx1) {
  4584. return "SUnit";
  4585. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLSUnit.klass)})},
  4586. args: [],
  4587. source: "tabLabel\x0a\x09^ 'SUnit'",
  4588. messageSends: [],
  4589. referencedClasses: []
  4590. }),
  4591. smalltalk.HLSUnit.klass);
  4592. smalltalk.addMethod(
  4593. smalltalk.method({
  4594. selector: "tabPriority",
  4595. category: 'accessing',
  4596. fn: function (){
  4597. var self=this;
  4598. return smalltalk.withContext(function($ctx1) {
  4599. return (1000);
  4600. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLSUnit.klass)})},
  4601. args: [],
  4602. source: "tabPriority\x0a\x09^ 1000",
  4603. messageSends: [],
  4604. referencedClasses: []
  4605. }),
  4606. smalltalk.HLSUnit.klass);