123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917 |
- smalltalk.addPackage('Helios-Workspace');
- smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "announcer",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@announcer"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@announcer"]=_st($Announcer())._new();
- $1=self["@announcer"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeModel)})},
- args: [],
- source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["Announcer"]
- }),
- smalltalk.HLCodeModel);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "defaultReceiver",
- category: 'defaults',
- fn: function (){
- var self=this;
- function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st($DoIt())._new();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},smalltalk.HLCodeModel)})},
- args: [],
- source: "defaultReceiver\x0a\x09^ DoIt new",
- messageSends: ["new"],
- referencedClasses: ["DoIt"]
- }),
- smalltalk.HLCodeModel);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "doIt:",
- category: 'actions',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self)._environment())._eval_on_(aString,_st(self)._receiver());
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},smalltalk.HLCodeModel)})},
- args: ["aString"],
- source: "doIt: aString\x0a\x0a\x09^ self environment eval: aString on: self receiver",
- messageSends: ["eval:on:", "receiver", "environment"],
- referencedClasses: []
- }),
- smalltalk.HLCodeModel);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "environment",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@environment"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1=_st(_st($HLManager())._current())._environment();
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLCodeModel)})},
- args: [],
- source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
- messageSends: ["ifNil:", "environment", "current"],
- referencedClasses: ["HLManager"]
- }),
- smalltalk.HLCodeModel);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "environment:",
- category: 'accessing',
- fn: function (anEnvironment){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@environment"]=anEnvironment;
- return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel)})},
- args: ["anEnvironment"],
- source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeModel);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@receiver"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@receiver"]=_st(self)._defaultReceiver();
- $1=self["@receiver"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeModel)})},
- args: [],
- source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
- messageSends: ["ifNil:", "defaultReceiver"],
- referencedClasses: []
- }),
- smalltalk.HLCodeModel);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver:",
- category: 'accessing',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@receiver"]=anObject;
- return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeModel)})},
- args: ["anObject"],
- source: "receiver: anObject\x0a\x09receiver := anObject",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeModel);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "on:",
- category: 'actions',
- fn: function (anEnvironment){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st(self)._new();
- _st($2)._environment_(anEnvironment);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel.klass)})},
- args: ["anEnvironment"],
- source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
- messageSends: ["environment:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.HLCodeModel.klass);
- smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor', 'state'], 'Helios-Workspace');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "announcer",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self)._model())._announcer();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "announcer\x0a\x09^ self model announcer",
- messageSends: ["announcer", "model"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "canHaveFocus",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "canHaveFocus\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "clear",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._contents_("");
- return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "clear\x0a\x09self contents: ''",
- messageSends: ["contents:"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "configureEditor",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(self)._editor())._at_put_("amberCodeWidget",self);
- _st(_st(self)._editor())._on_do_("change",(function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(self)._onChange();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self.\x0a\x09self editor on: 'change' do: [ self onChange ]",
- messageSends: ["at:put:", "editor", "on:do:", "onChange"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "contents",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self["@editor"])._getValue();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "contents\x0a\x09^ editor getValue",
- messageSends: ["getValue"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "contents:",
- category: 'accessing',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- _st(self["@editor"])._setValue_(aString);
- $1=self["@state"];
- if(($receiver = $1) == nil || $receiver == undefined){
- $1;
- } else {
- _st(self)._updateState();
- };
- return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLCodeWidget)})},
- args: ["aString"],
- source: "contents: aString\x0a\x09editor setValue: aString.\x0a\x09state ifNotNil: [ self updateState ]",
- messageSends: ["setValue:", "ifNotNil:", "updateState"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "currentLine",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
- messageSends: ["getLine:", "line", "getCursor"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "currentLineOrSelection",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=_st(self["@editor"])._somethingSelected();
- if(smalltalk.assert($2)){
- $1=_st(self)._selection();
- } else {
- $1=_st(self)._currentLine();
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
- messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "doIt",
- category: 'actions',
- fn: function (){
- var self=this;
- var result;
- function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
- function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
- return smalltalk.withContext(function($ctx1) {
- var $1;
- _st(_st(_st(self)._model())._announcer())._announce_(_st($HLDoItRequested())._on_(self["@model"]));
- result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
- _st(_st(_st(self)._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
- $1=result;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
- args: [],
- source: "doIt\x0a\x09| result |\x0a\x0a\x09self model announcer announce: (HLDoItRequested on: model).\x0a\x09result := model doIt: self currentLineOrSelection.\x0a\x09self model announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result ",
- messageSends: ["announce:", "on:", "announcer", "model", "doIt:", "currentLineOrSelection"],
- referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "editor",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@editor"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "editor\x0a\x09^ editor",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "focus",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self["@editor"])._focus();
- return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "focus\x0a\x09editor focus",
- messageSends: ["focus"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "hasFocus",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "hasFocus\x0a\x09^ code asJQuery is: ':active'",
- messageSends: ["is:", "asJQuery"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "hasModification",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return false;
- }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "hasModification\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "inspectIt",
- category: 'actions',
- fn: function (){
- var self=this;
- var newInspector;
- function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
- return smalltalk.withContext(function($ctx1) {
- _st(_st(_st(self)._model())._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
- newInspector=_st(self)._makeInspectorOn_(_st(self)._doIt());
- _st(newInspector)._open();
- return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
- args: [],
- source: "inspectIt\x0a\x09| newInspector |\x0a \x0a\x09self model announcer announce: (HLInspectItRequested on: model).\x0a\x09newInspector := self makeInspectorOn: self doIt.\x0a\x09newInspector open",
- messageSends: ["announce:", "on:", "announcer", "model", "makeInspectorOn:", "doIt", "open"],
- referencedClasses: ["HLInspectItRequested"]
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "makeInspectorOn:",
- category: 'actions',
- fn: function (anObject){
- var self=this;
- function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st($HLInspector())._new();
- _st($2)._inspect_(anObject);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"makeInspectorOn:",{anObject:anObject},smalltalk.HLCodeWidget)})},
- args: ["anObject"],
- source: "makeInspectorOn: anObject\x0a\x0a\x09^ HLInspector new \x0a\x09\x09inspect: anObject;\x0a\x09\x09yourself",
- messageSends: ["inspect:", "new", "yourself"],
- referencedClasses: ["HLInspector"]
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageHintFor:token:",
- category: 'hints',
- fn: function (anEditor,aToken){
- var self=this;
- function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each)._includesSubString_(_st(aToken)._string());
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each).__eq(_st(aToken)._string());
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
- args: ["anEditor", "aToken"],
- source: "messageHintFor: anEditor token: aToken\x0a\x09^ ((Smalltalk current at: 'allSelectors') value asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
- messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"],
- referencedClasses: ["Smalltalk"]
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "model",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@model"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@model"]=_st($HLCodeModel())._new();
- $1=self["@model"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["HLCodeModel"]
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "model:",
- category: 'accessing',
- fn: function (aModel){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self["@model"]=aModel;
- return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
- args: ["aModel"],
- source: "model: aModel\x0a\x09model := aModel",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onChange",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._updateState();
- return self}, function($ctx1) {$ctx1.fill(self,"onChange",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "onChange\x0a\x09self updateState",
- messageSends: ["updateState"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onDoIt",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._doIt();
- return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "onDoIt\x0a\x09\x0a self doIt",
- messageSends: ["doIt"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onInspectIt",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._inspectIt();
- return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "onInspectIt\x0a\x0a\x09self inspectIt",
- messageSends: ["inspectIt"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onPrintIt",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._printIt();
- return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "onPrintIt\x0a\x0a\x09self printIt",
- messageSends: ["printIt"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onSaveIt",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "print:",
- category: 'actions',
- fn: function (aString){
- var self=this;
- var start,stop,currentLine;
- function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
- return smalltalk.withContext(function($ctx1) {
- currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
- start=_st($HashedCollection())._new();
- _st(start)._at_put_("line",currentLine);
- _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
- _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
- return smalltalk.withContext(function($ctx2) {
- _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
- return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
- stop=_st($HashedCollection())._new();
- _st(stop)._at_put_("line",currentLine);
- _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
- _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
- _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
- _st(self["@editor"])._setSelection_end_(stop,start);
- return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
- args: ["aString"],
- source: "print: aString\x0a\x09| start stop currentLine |\x0a currentLine := (editor getCursor: false) line.\x0a\x09start := HashedCollection new.\x0a\x09start at: 'line' put: currentLine.\x0a\x09start at: 'ch' put: (editor getCursor: false) ch.\x0a (editor getSelection) ifEmpty: [\x0a \x09\x22select current line if selection is empty\x22\x0a \x09start at: 'ch' put: (editor getLine: currentLine) size.\x0a editor setSelection: #{'line' -> currentLine. 'ch' -> 0} end: start.\x0a ].\x0a\x09stop := HashedCollection new.\x0a\x09stop at: 'line' put: currentLine.\x0a\x09stop at: 'ch' put: ((start at: 'ch') + aString size + 2).\x0a\x0a\x09editor replaceSelection: (editor getSelection, ' ', aString, ' ').\x0a\x09editor setCursor: (editor getCursor: true).\x0a\x09editor setSelection: stop end: start",
- messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"],
- referencedClasses: ["HashedCollection"]
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "printIt",
- category: 'actions',
- fn: function (){
- var self=this;
- var result;
- function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
- return smalltalk.withContext(function($ctx1) {
- result=_st(self)._doIt();
- _st(_st(_st(self)._model())._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
- _st(self)._print_(_st(result)._printString());
- _st(self)._focus();
- return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
- args: [],
- source: "printIt\x0a\x09| result |\x0a\x0a\x09result:= self doIt. \x0a\x09self model announcer announce: (HLPrintItRequested on: model).\x0a self print: result printString.\x0a\x09\x0a\x09self focus.",
- messageSends: ["doIt", "announce:", "on:", "announcer", "model", "print:", "printString", "focus"],
- referencedClasses: ["HLPrintItRequested"]
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self)._model())._receiver();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "receiver\x0a\x09^ self model receiver",
- messageSends: ["receiver", "model"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "receiver:",
- category: 'accessing',
- fn: function (anObject){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(self)._model())._receiver_(anObject);
- return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
- args: ["anObject"],
- source: "receiver: anObject\x0a\x09self model receiver: anObject",
- messageSends: ["receiver:", "model"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- self["@code"]=_st(html)._textarea();
- self["@state"]=_st(_st(html)._div())._class_("state");
- $1=self;
- _st($1)._setEditorOn_(_st(self["@code"])._element());
- _st($1)._configureEditor();
- $2=_st($1)._updateState();
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09code := html textarea.\x0a\x09state := html div class: 'state'.\x0a\x09self \x0a\x09\x09setEditorOn: code element;\x0a\x09\x09configureEditor;\x0a\x09\x09updateState",
- messageSends: ["textarea", "class:", "div", "setEditorOn:", "element", "configureEditor", "updateState"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "saveIt",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "saveIt\x0a\x09\x22I do not do anything\x22",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selection",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self["@editor"])._getSelection();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "selection\x0a\x09^editor getSelection",
- messageSends: ["getSelection"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectionEnd",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self["@code"])._element())._selectionEnd();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "selectionEnd\x0a ^code element selectionEnd",
- messageSends: ["selectionEnd", "element"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectionEnd:",
- category: 'accessing',
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
- return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
- args: ["anInteger"],
- source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
- messageSends: ["selectionEnd:", "element"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectionStart",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self["@code"])._element())._selectionStart();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "selectionStart\x0a ^code element selectionStart",
- messageSends: ["selectionStart", "element"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "selectionStart:",
- category: 'accessing',
- fn: function (anInteger){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(self["@code"])._element())._selectionStart_(anInteger);
- return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
- args: ["anInteger"],
- source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
- messageSends: ["selectionStart:", "element"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "setEditorOn:",
- category: 'actions',
- fn: function (aTextarea){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
- theme: 'amber',
- lineNumbers: true,
- enterMode: 'flat',
- indentWithTabs: true,
- indentUnit: 4,
- matchBrackets: true,
- electricChars: true,
- keyMap: 'Amber',
- extraKeys: {"Shift-Space": "autocomplete"}
- });
- return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
- args: ["aTextarea"],
- source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a lineNumbers: true,\x0a enterMode: 'flat',\x0a indentWithTabs: true,\x0a\x09\x09\x09\x09indentUnit: 4,\x0a matchBrackets: true,\x0a electricChars: true,\x0a\x09\x09\x09\x09keyMap: 'Amber',\x0a\x09\x09\x09\x09extraKeys: {\x22Shift-Space\x22: \x22autocomplete\x22}\x0a\x09})>",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "updateState",
- category: 'updating',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(self)._hasModification();
- if(smalltalk.assert($1)){
- _st(_st(self["@state"])._asJQuery())._addClass_("modified");
- } else {
- _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
- };
- return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},smalltalk.HLCodeWidget)})},
- args: [],
- source: "updateState\x0a\x09self hasModification \x0a\x09\x09ifTrue: [ state asJQuery addClass: 'modified' ]\x0a\x09\x09ifFalse: [ state asJQuery removeClass: 'modified' ]",
- messageSends: ["ifTrue:ifFalse:", "addClass:", "asJQuery", "removeClass:", "hasModification"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "variableHintFor:token:",
- category: 'hints',
- fn: function (anEditor,aToken){
- var self=this;
- var variables,classNames,pseudoVariables;
- function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
- return smalltalk.withContext(function($ctx1) {
- var $1;
- variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(window)._jQuery_(each))._html();
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
- classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each)._name();
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
- pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
- $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each)._includesSubString_(_st(aToken)._string());
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
- return smalltalk.withContext(function($ctx2) {
- return _st(each).__eq(_st(aToken)._string());
- }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
- args: ["anEditor", "aToken"],
- source: "variableHintFor: anEditor token: aToken\x0a\x09| variables classNames pseudoVariables |\x0a\x09\x0a\x09variables := ((window jQuery: anEditor display wrapper) find: 'span.cm-variable') get\x0a\x09\x09collect: [ :each | (window jQuery: each) html ].\x0a\x09\x0a\x09classNames := Smalltalk current classes collect: [ :each | each name ].\x0a\x09pseudoVariables := Smalltalk current pseudoVariableNames.\x0a\x09\x0a\x09^ ((variables, classNames, pseudoVariables) asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
- messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","],
- referencedClasses: ["Smalltalk"]
- }),
- smalltalk.HLCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "hintFor:options:",
- category: 'hints',
- fn: function (anEditor,options){
- var self=this;
- var cursor,token,completions;
- function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
- function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- cursor=_st(anEditor)._getCursor();
- token=_st(anEditor)._getTokenAt_(cursor);
- _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
- $1=_st(_st(token)._type()).__eq("variable");
- if(smalltalk.assert($1)){
- completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
- } else {
- completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
- };
- $2=smalltalk.HashedCollection._fromPairs_([_st("list").__minus_gt(completions),_st("from").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._end())),_st("to").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start()))]);
- return $2;
- }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
- args: ["anEditor", "options"],
- source: "hintFor: anEditor options: options\x0a\x09| cursor token completions |\x0a\x09\x0a\x09cursor := anEditor getCursor.\x0a\x09token := anEditor getTokenAt: cursor.\x0a\x09token at: 'state' put: ((CodeMirror basicAt: 'innerMode')\x0a\x09\x09value: anEditor getMode value: (token at: 'state')) state.\x0a\x09\x0a\x09completions := token type = 'variable' \x0a\x09\x09ifTrue: [ HLCodeWidget variableHintFor: anEditor token: token ]\x0a\x09\x09ifFalse: [ HLCodeWidget messageHintFor: anEditor token: token ].\x0a\x09\x0a\x09^ #{\x0a\x09\x09'list' -> completions.\x0a\x09\x09'from' -> ((CodeMirror basicAt: 'Pos') value: cursor line value: token end).\x0a\x09\x09'to' -> ((CodeMirror basicAt: 'Pos') value: cursor line value: token start)\x0a\x09}",
- messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"],
- referencedClasses: ["CodeMirror", "HLCodeWidget"]
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "initialize",
- category: 'initialization',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
- $1=self;
- _st($1)._setupCodeMirror();
- _st($1)._setupCommands();
- $2=_st($1)._setupKeyMaps();
- return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
- args: [],
- source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
- messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "keyMap",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
- if(smalltalk.assert($2)){
- $1=_st(self)._macKeyMap();
- } else {
- $1=_st(self)._pcKeyMap();
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
- args: [],
- source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
- messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"],
- referencedClasses: ["HLManager"]
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "macKeyMap",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=smalltalk.HashedCollection._fromPairs_([_st("Alt-Backspace").__minus_gt("delWordBefore"),_st("Alt-Delete").__minus_gt("delWordAfter"),_st("Alt-Left").__minus_gt("goWordBoundaryLeft"),_st("Alt-Right").__minus_gt("goWordBoundaryRight"),_st("Cmd-A").__minus_gt("selectAll"),_st("Cmd-Alt-F").__minus_gt("replace"),_st("Cmd-D").__minus_gt("doIt"),_st("Cmd-Down").__minus_gt("goDocEnd"),_st("Cmd-End").__minus_gt("goDocEnd"),_st("Cmd-F").__minus_gt("find"),_st("Cmd-G").__minus_gt("findNext"),_st("Cmd-I").__minus_gt("inspectIt"),_st("Cmd-Left").__minus_gt("goLineStart"),_st("Cmd-P").__minus_gt("printIt"),_st("Cmd-Right").__minus_gt("goLineEnd"),_st("Cmd-S").__minus_gt("saveIt"),_st("Cmd-Up").__minus_gt("goDocStart"),_st("Cmd-Y").__minus_gt("redo"),_st("Cmd-Z").__minus_gt("undo"),_st("Cmd-[").__minus_gt("indentLess"),_st("Cmd-]").__minus_gt("indentMore"),_st("Ctrl-Alt-Backspace").__minus_gt("delWordAfter"),_st("Shift-Cmd-Alt-F").__minus_gt("replaceAll"),_st("Shift-Cmd-G").__minus_gt("findPrev"),_st("Shift-Cmd-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic","emacsy"])]);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
- args: [],
- source: "macKeyMap\x0a\x09^ #{\x0a\x09\x09'Alt-Backspace'\x09\x09-> 'delWordBefore'.\x0a\x09\x09'Alt-Delete'\x09\x09-> 'delWordAfter'. \x0a\x09\x09'Alt-Left'\x09\x09-> 'goWordBoundaryLeft'.\x0a\x09\x09'Alt-Right'\x09\x09-> 'goWordBoundaryRight'. \x0a\x09\x09'Cmd-A'\x09\x09\x09-> 'selectAll'. \x0a\x09\x09'Cmd-Alt-F'\x09\x09-> 'replace'. \x0a\x09\x09'Cmd-D'\x09\x09\x09-> 'doIt'. \x0a\x09\x09'Cmd-Down'\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-End'\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-F'\x09\x09\x09-> 'find'.\x0a\x09\x09'Cmd-G'\x09\x09\x09-> 'findNext'. \x0a\x09\x09'Cmd-I'\x09\x09\x09-> 'inspectIt'. \x0a\x09\x09'Cmd-Left'\x09\x09-> 'goLineStart'. \x0a\x09\x09'Cmd-P'\x09\x09\x09-> 'printIt'. \x0a\x09\x09'Cmd-Right'\x09\x09-> 'goLineEnd'. \x0a\x09\x09'Cmd-S'\x09\x09\x09-> 'saveIt'. \x0a\x09\x09'Cmd-Up'\x09\x09-> 'goDocStart'. \x0a\x09\x09'Cmd-Y'\x09\x09\x09-> 'redo'.\x0a\x09\x09'Cmd-Z'\x09\x09\x09-> 'undo'. \x0a\x09\x09'Cmd-['\x09\x09\x09-> 'indentLess'. \x0a\x09\x09'Cmd-]'\x09\x09\x09-> 'indentMore'.\x0a\x09\x09'Ctrl-Alt-Backspace'\x09-> 'delWordAfter'. \x0a\x09\x09'Shift-Cmd-Alt-F'\x09-> 'replaceAll'.\x0a\x09\x09'Shift-Cmd-G'\x09\x09-> 'findPrev'. \x0a\x09\x09'Shift-Cmd-Z'\x09\x09-> 'redo'. \x0a \x09'fallthrough' \x09-> { 'basic'. 'emacsy' }\x0a }",
- messageSends: ["->"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "messageHintFor:token:",
- category: 'hints',
- fn: function (anEditor,aToken){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
- args: ["anEditor", "aToken"],
- source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
- messageSends: ["messageHintFor:token:", "at:"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "pcKeyMap",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=[_st("Alt-Left").__minus_gt("goLineStart"),_st("Alt-Right").__minus_gt("goLineEnd"),_st("Alt-Up").__minus_gt("goDocStart"),_st("Ctrl-A").__minus_gt("selectAll"),_st("Ctrl-Backspace").__minus_gt("delWordBefore"),_st("Ctrl-D").__minus_gt("doIt"),_st("Ctrl-Delete").__minus_gt("delWordAfter"),_st("Ctrl-Down").__minus_gt("goDocEnd"),_st("Ctrl-End").__minus_gt("goDocEnd"),_st("Ctrl-F").__minus_gt("find"),_st("Ctrl-G").__minus_gt("findNext"),_st("Ctrl-I").__minus_gt("inspectIt"),_st("Ctrl-Home").__minus_gt("goDocStart"),_st("Ctrl-Left").__minus_gt("goWordBoundaryLeft"),_st("Ctrl-P").__minus_gt("printIt"),_st("Ctrl-Right").__minus_gt("goWordBoundaryRight"),_st("Ctrl-S").__minus_gt("saveIt"),_st("Ctrl-Y").__minus_gt("redo"),_st("Ctrl-Z").__minus_gt("undo"),_st("Ctrl-[").__minus_gt("indentLess"),_st("Ctrl-]").__minus_gt("indentMore"),_st("Shift-Ctrl-F").__minus_gt("replace"),_st("Shift-Ctrl-G").__minus_gt("findPrev"),_st("Shift-Ctrl-R").__minus_gt("replaceAll"),_st("Shift-Ctrl-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic"])];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
- args: [],
- source: "pcKeyMap\x0a\x09^ {\x0a\x09\x09'Alt-Left' -> 'goLineStart'. \x0a\x09\x09'Alt-Right' -> 'goLineEnd'.\x0a\x09\x09'Alt-Up' -> 'goDocStart'. \x0a\x09\x09'Ctrl-A' -> 'selectAll'. \x0a\x09\x09'Ctrl-Backspace' -> 'delWordBefore'. \x0a\x09\x09'Ctrl-D' -> 'doIt'. \x0a\x09\x09'Ctrl-Delete' -> 'delWordAfter'. \x0a\x09\x09'Ctrl-Down' -> 'goDocEnd'.\x0a\x09\x09'Ctrl-End' -> 'goDocEnd'. \x0a\x09\x09'Ctrl-F' -> 'find'.\x0a\x09\x09'Ctrl-G' -> 'findNext'. \x0a\x09\x09'Ctrl-I' -> 'inspectIt'.\x0a\x09\x09'Ctrl-Home' -> 'goDocStart'. \x0a\x09\x09'Ctrl-Left' -> 'goWordBoundaryLeft'. \x0a\x09\x09'Ctrl-P' -> 'printIt'.\x0a\x09\x09'Ctrl-Right' -> 'goWordBoundaryRight'. \x0a\x09\x09'Ctrl-S' -> 'saveIt'. \x0a\x09\x09'Ctrl-Y' -> 'redo'.\x0a\x09\x09'Ctrl-Z' -> 'undo'. \x0a\x09\x09'Ctrl-[' -> 'indentLess'. \x0a\x09\x09'Ctrl-]' -> 'indentMore'.\x0a\x09\x09'Shift-Ctrl-F' -> 'replace'. \x0a\x09\x09'Shift-Ctrl-G' -> 'findPrev'. \x0a\x09\x09'Shift-Ctrl-R' -> 'replaceAll'.\x0a\x09\x09'Shift-Ctrl-Z' -> 'redo'. \x0a\x09\x09'fallthrough' -> #('basic')\x0a}",
- messageSends: ["->"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "setupCodeMirror",
- category: 'initialization',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
-
- CodeMirror.keyMap.default.fallthrough = ["basic"];
- CodeMirror.commands.autocomplete = function(cm) {
- CodeMirror.showHint(cm, self._hintFor_options_);
- }
- ;
- return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
- args: [],
- source: "setupCodeMirror\x0a\x09< \x0a\x09\x09CodeMirror.keyMap.default.fallthrough = [\x22basic\x22];\x0a\x09\x09CodeMirror.commands.autocomplete = function(cm) {\x0a \x09CodeMirror.showHint(cm, self._hintFor_options_);\x0a \x09}\x0a\x09>",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "setupCommands",
- category: 'initialization',
- fn: function (){
- var self=this;
- function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=_st($CodeMirror())._basicAt_("commands");
- _st($1)._at_put_("doIt",(function(cm){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(cm)._amberCodeWidget())._doIt();
- }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
- _st($1)._at_put_("inspectIt",(function(cm){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(cm)._amberCodeWidget())._inspectIt();
- }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
- _st($1)._at_put_("printIt",(function(cm){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(cm)._amberCodeWidget())._printIt();
- }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
- $2=_st($1)._at_put_("saveIt",(function(cm){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(cm)._amberCodeWidget())._saveIt();
- }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
- args: [],
- source: "setupCommands\x0a\x09(CodeMirror basicAt: 'commands') \x0a\x09\x09at: 'doIt' put: [ :cm | cm amberCodeWidget doIt ];\x0a\x09\x09at: 'inspectIt' put: [ :cm | cm amberCodeWidget inspectIt ];\x0a\x09\x09at: 'printIt' put: [ :cm | cm amberCodeWidget printIt ];\x0a\x09\x09at: 'saveIt' put: [ :cm | cm amberCodeWidget saveIt ]",
- messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"],
- referencedClasses: ["CodeMirror"]
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "setupKeyMaps",
- category: 'initialization',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- CodeMirror.keyMap['Amber'] = self._keyMap();
- return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
- args: [],
- source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "variableHintFor:token:",
- category: 'hints',
- fn: function (anEditor,aToken){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
- args: ["anEditor", "aToken"],
- source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
- messageSends: ["variableHintFor:token:", "at:"],
- referencedClasses: []
- }),
- smalltalk.HLCodeWidget.klass);
- smalltalk.addClass('HLNavigationCodeWidget', smalltalk.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "configureEditor",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- smalltalk.HLCodeWidget.fn.prototype._configureEditor.apply(_st(self), []);
- _st(self)._contents_(_st(self)._methodContents());
- return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLNavigationCodeWidget)})},
- args: [],
- source: "configureEditor\x0a\x09super configureEditor.\x0a\x09self contents: self methodContents",
- messageSends: ["configureEditor", "contents:", "methodContents"],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "contents:",
- category: 'accessing',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._methodContents_(aString);
- smalltalk.HLCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
- return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
- args: ["aString"],
- source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
- messageSends: ["methodContents:", "contents:"],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "hasModification",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
- args: [],
- source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
- messageSends: ["not", "=", "contents", "methodContents"],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "methodContents",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@methodContents"];
- if(($receiver = $2) == nil || $receiver == undefined){
- $1="";
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
- args: [],
- source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
- messageSends: ["ifNil:"],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "methodContents:",
- category: 'accessing',
- fn: function (aString){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- self["@methodContents"]=aString;
- $1=self["@methodContents"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
- args: ["aString"],
- source: "methodContents: aString\x0a\x09^ methodContents := aString",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "previous",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
- args: [],
- source: "previous\x0a\x09\x22for browser lists widget\x22",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "previous:",
- category: 'accessing',
- fn: function (aWidget){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
- args: ["aWidget"],
- source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "canBeOpenAsTab",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return false;
- }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
- args: [],
- source: "canBeOpenAsTab\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "on:",
- category: 'instance creation',
- fn: function (aBrowserModel){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st(self)._new();
- _st($2)._browserModel_(aBrowserModel);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
- args: ["aBrowserModel"],
- source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
- messageSends: ["browserModel:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.HLNavigationCodeWidget.klass);
- smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "browserModel",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=self["@browserModel"];
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
- args: [],
- source: "browserModel\x0a\x09^ browserModel",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "browserModel:",
- category: 'accessing',
- fn: function (aBrowserModel){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- self["@browserModel"]=aBrowserModel;
- $1=self;
- _st($1)._observeSystem();
- $2=_st($1)._observeBrowserModel();
- return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
- args: ["aBrowserModel"],
- source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
- messageSends: ["observeSystem", "observeBrowserModel"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "observeBrowserModel",
- category: 'actions',
- fn: function (){
- var self=this;
- function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
- function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
- function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
- function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
- function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
- function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
- function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
- function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
- function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
- function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
- function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
- function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=_st(_st(self)._browserModel())._announcer();
- _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
- _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
- _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
- _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
- _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
- _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
- _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
- _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
- _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
- _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
- _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
- $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
- return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
- args: [],
- source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09send: #onSaveIt\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09send: #onShowInstanceToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09send: #onSourceCodeSaved\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09send: #onBrowserAboutToChange:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09send: #onParseError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09send: #onCompileError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09send: #onUnknownVariableError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09send: #onInstVarAdded\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a \x09on: HLClassSelected \x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a \x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09send: #onSourceCodeFocusRequested\x0a\x09\x09to: self",
- messageSends: ["on:send:to:", "announcer", "browserModel"],
- referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "observeSystem",
- category: 'actions',
- fn: function (){
- var self=this;
- function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
- return smalltalk.withContext(function($ctx1) {
- _st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
- return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
- args: [],
- source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
- messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
- referencedClasses: ["MethodModified"]
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onBrowserAboutToChange:",
- category: 'reactions',
- fn: function (anAnnouncement){
- var self=this;
- var block;
- function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
- return smalltalk.withContext(function($ctx1) {
- var $1;
- block=_st(anAnnouncement)._actionBlock();
- $1=_st(self)._hasModification();
- if(smalltalk.assert($1)){
- _st(self)._confirm_ifTrue_("Do you want to cancel changes?",(function(){
- return smalltalk.withContext(function($ctx2) {
- _st(self)._methodContents_(_st(self)._contents());
- return _st(block)._value();
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
- _st($HLChangeForbidden())._signal();
- };
- return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
- args: ["anAnnouncement"],
- source: "onBrowserAboutToChange: anAnnouncement\x0a\x09| block |\x0a\x09\x0a\x09block := anAnnouncement actionBlock.\x0a\x09\x0a\x09self hasModification\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self \x0a\x09\x09\x09\x09confirm: 'Do you want to cancel changes?' \x0a\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x22Don't ask twice\x22\x0a\x09\x09\x09\x09\x09self methodContents: self contents.\x0a\x09\x09\x09\x09\x09block value ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x0a\x09\x09\x09HLChangeForbidden signal ]",
- messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"],
- referencedClasses: ["HLChangeForbidden"]
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onClassSelected:",
- category: 'reactions',
- fn: function (anAnnouncement){
- var self=this;
- var class_;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- class_=_st(anAnnouncement)._item();
- $1=class_;
- if(($receiver = $1) == nil || $receiver == undefined){
- $2=_st(self)._contents_("");
- return $2;
- } else {
- $1;
- };
- _st(self)._contents_(_st(class_)._definition());
- return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
- args: ["anAnnouncement"],
- source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a self contents: class definition",
- messageSends: ["item", "ifNil:", "contents:", "definition"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onCompileError:",
- category: 'reactions',
- fn: function (anAnnouncement){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
- return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
- args: ["anAnnouncement"],
- source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
- messageSends: ["alert:", "messageText", "error"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onInstVarAdded",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(self)._browserModel())._save_(_st(self)._contents());
- return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
- args: [],
- source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
- messageSends: ["save:", "contents", "browserModel"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onMethodModified:",
- category: 'reactions',
- fn: function (anAnnouncement){
- var self=this;
- var method;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$4,$5,$6;
- method=_st(anAnnouncement)._method();
- $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
- if(! smalltalk.assert($1)){
- $2=self;
- return $2;
- };
- $3=_st(_st(self)._browserModel())._selectedMethod();
- if(($receiver = $3) == nil || $receiver == undefined){
- $4=self;
- return $4;
- } else {
- $3;
- };
- $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
- if(! smalltalk.assert($5)){
- $6=self;
- return $6;
- };
- _st(self)._refresh();
- return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
- args: ["anAnnouncement"],
- source: "onMethodModified: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement method.\x0a\x09\x0a\x09self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
- messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onMethodSelected:",
- category: 'reactions',
- fn: function (anAnnouncement){
- var self=this;
- var method;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- method=_st(anAnnouncement)._item();
- $1=method;
- if(($receiver = $1) == nil || $receiver == undefined){
- $2=_st(self)._contents_("");
- return $2;
- } else {
- $1;
- };
- _st(self)._contents_(_st(method)._source());
- return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
- args: ["anAnnouncement"],
- source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a self contents: method source",
- messageSends: ["item", "ifNil:", "contents:", "source"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onParseError:",
- category: 'reactions',
- fn: function (anAnnouncement){
- var self=this;
- var lineIndex,newContents;
- function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3;
- lineIndex=(1);
- _st(self)._contents_(_st($String())._streamContents_((function(stream){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(self)._contents())._linesDo_((function(each){
- return smalltalk.withContext(function($ctx3) {
- $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
- if(smalltalk.assert($1)){
- $2=stream;
- _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
- _st($2)._nextPutAll_("<- ");
- _st($2)._nextPutAll_(_st(anAnnouncement)._message());
- _st($2)._nextPutAll_(" ");
- $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
- $3;
- } else {
- _st(stream)._nextPutAll_(each);
- };
- _st(stream)._nextPutAll_(_st($String())._cr());
- lineIndex=_st(lineIndex).__plus((1));
- return lineIndex;
- }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
- return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
- args: ["anAnnouncement"],
- source: "onParseError: anAnnouncement\x0a\x09| lineIndex newContents |\x0a\x09\x0a\x09lineIndex := 1.\x0a\x09\x0a\x09self contents: (String streamContents: [ :stream |\x0a\x09\x09self contents linesDo: [ :each |\x0a\x09\x09\x09lineIndex = anAnnouncement line \x0a\x09\x09\x09\x09ifTrue: [ \x0a\x09\x09\x09\x09\x09stream \x0a\x09\x09\x09\x09\x09\x09nextPutAll: (each copyFrom: 1 to: anAnnouncement column);\x0a\x09\x09\x09\x09\x09\x09nextPutAll: '<- ';\x0a\x09\x09\x09\x09\x09\x09nextPutAll: anAnnouncement message;\x0a\x09\x09\x09\x09\x09\x09nextPutAll: ' ';\x0a\x09\x09\x09\x09\x09\x09nextPutAll: (each copyFrom: anAnnouncement column + 1 to: each size) ]\x0a\x09\x09\x09\x09ifFalse: [ stream nextPutAll: each ].\x0a\x09\x09\x09stream nextPutAll: String cr.\x0a\x09\x09\x09lineIndex := lineIndex + 1 ] ])",
- messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"],
- referencedClasses: ["String"]
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onProtocolSelected:",
- category: 'reactions',
- fn: function (anAnnouncement){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=_st(_st(self)._browserModel())._selectedClass();
- if(($receiver = $1) == nil || $receiver == undefined){
- $2=_st(self)._contents_("");
- return $2;
- } else {
- $1;
- };
- _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
- return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
- args: ["anAnnouncement"],
- source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a self contents: self browserModel selectedClass definition",
- messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onSaveIt",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(self)._browserModel())._save_(_st(self)._contents());
- return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
- args: [],
- source: "onSaveIt\x0a\x09self browserModel save: self contents",
- messageSends: ["save:", "contents", "browserModel"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onShowInstanceToggled",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- $1=_st(_st(self)._browserModel())._selectedClass();
- if(($receiver = $1) == nil || $receiver == undefined){
- $2=_st(self)._contents_("");
- return $2;
- } else {
- $1;
- };
- _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
- return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
- args: [],
- source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: self browserModel selectedClass definition",
- messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onSourceCodeFocusRequested",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._focus();
- return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
- args: [],
- source: "onSourceCodeFocusRequested\x0a\x09self focus",
- messageSends: ["focus"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onSourceCodeSaved",
- category: 'reactions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(self)._methodContents_(_st(self)._contents());
- _st(self)._updateState();
- return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
- args: [],
- source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
- messageSends: ["methodContents:", "contents", "updateState"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "onUnknownVariableError:",
- category: 'reactions',
- fn: function (anAnnouncement){
- var self=this;
- var error;
- function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
- return smalltalk.withContext(function($ctx1) {
- var $1,$2;
- error=_st(anAnnouncement)._error();
- _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
- return smalltalk.withContext(function($ctx2) {
- $1=stream;
- _st($1)._nextPutAll_(_st(error)._messageText());
- _st($1)._nextPutAll_(_st($String())._cr());
- $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
- return $2;
- }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
- return smalltalk.withContext(function($ctx2) {
- return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
- }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
- return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
- args: ["anAnnouncement"],
- source: "onUnknownVariableError: anAnnouncement\x0a\x09| error |\x0a\x09\x0a\x09error := anAnnouncement error.\x0a\x09\x0a\x09self \x0a\x09\x09confirm: (String streamContents: [ :stream |\x0a\x09\x09\x09stream \x0a\x09\x09\x09\x09nextPutAll: error messageText;\x0a\x09\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ])\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self browserModel addInstVarNamed: error variableName ]",
- messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"],
- referencedClasses: ["String"]
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "refresh",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1,$2,$3,$4;
- $1=_st(self)._hasModification();
- if(smalltalk.assert($1)){
- $2=self;
- return $2;
- };
- $3=_st(self)._hasFocus();
- if(smalltalk.assert($3)){
- $4=self;
- return $4;
- };
- _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedMethod())._source());
- return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
- args: [],
- source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
- messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "saveIt",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- _st(_st(self)._browserModel())._saveSourceCode();
- return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
- args: [],
- source: "saveIt\x0a\x09self browserModel saveSourceCode",
- messageSends: ["saveSourceCode", "browserModel"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "unregister",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
- _st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
- _st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
- return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
- args: [],
- source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
- messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "canBeOpenAsTab",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return false;
- }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
- args: [],
- source: "canBeOpenAsTab\x0a\x09^ false",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "on:",
- category: 'instance creation',
- fn: function (aBrowserModel){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $2,$3,$1;
- $2=_st(self)._new();
- _st($2)._browserModel_(aBrowserModel);
- $3=_st($2)._yourself();
- $1=$3;
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
- args: ["aBrowserModel"],
- source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
- messageSends: ["browserModel:", "new", "yourself"],
- referencedClasses: []
- }),
- smalltalk.HLBrowserCodeWidget.klass);
- smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
- smalltalk.addMethod(
- smalltalk.method({
- selector: "canHaveFocus",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
- args: [],
- source: "canHaveFocus\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLWorkspace);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "codeWidget",
- category: 'accessing',
- fn: function (){
- var self=this;
- function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
- return smalltalk.withContext(function($ctx1) {
- var $2,$1;
- $2=self["@codeWidget"];
- if(($receiver = $2) == nil || $receiver == undefined){
- self["@codeWidget"]=_st($HLCodeWidget())._new();
- $1=self["@codeWidget"];
- } else {
- $1=$2;
- };
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
- args: [],
- source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
- messageSends: ["ifNil:", "new"],
- referencedClasses: ["HLCodeWidget"]
- }),
- smalltalk.HLWorkspace);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "focus",
- category: 'actions',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=_st(_st(self)._codeWidget())._focus();
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
- args: [],
- source: "focus\x0a\x09^ self codeWidget focus",
- messageSends: ["focus", "codeWidget"],
- referencedClasses: []
- }),
- smalltalk.HLWorkspace);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "renderContentOn:",
- category: 'rendering',
- fn: function (html){
- var self=this;
- function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
- return smalltalk.withContext(function($ctx1) {
- _st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
- return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
- args: ["html"],
- source: "renderContentOn: html\x0a\x09html with: (HLContainer with: self codeWidget)",
- messageSends: ["with:", "codeWidget"],
- referencedClasses: ["HLContainer"]
- }),
- smalltalk.HLWorkspace);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "canBeOpenAsTab",
- category: 'testing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return true;
- }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
- args: [],
- source: "canBeOpenAsTab\x0a\x09^ true",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLWorkspace.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "tabLabel",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- return "Workspace";
- }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
- args: [],
- source: "tabLabel\x0a\x09^ 'Workspace'",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLWorkspace.klass);
- smalltalk.addMethod(
- smalltalk.method({
- selector: "tabPriority",
- category: 'accessing',
- fn: function (){
- var self=this;
- return smalltalk.withContext(function($ctx1) {
- var $1;
- $1=(10);
- return $1;
- }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
- args: [],
- source: "tabPriority\x0a\x09^ 10",
- messageSends: [],
- referencedClasses: []
- }),
- smalltalk.HLWorkspace.klass);
|