Helios-Core.js 156 KB

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