Helios-Core.js 194 KB

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