2
0

Helios-Core.js 179 KB

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