Helios-Inspector.deploy.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913
  1. smalltalk.addPackage('Helios-Inspector');
  2. smalltalk.addClass('HLInspector', smalltalk.HLWidget, ['model', 'variablesWidget', 'displayWidget', 'codeWidget', 'label'], 'Helios-Inspector');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "codeWidget",
  6. fn: function (){
  7. var self=this;
  8. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  9. return smalltalk.withContext(function($ctx1) {
  10. var $2,$3,$4,$1;
  11. $2=self["@codeWidget"];
  12. if(($receiver = $2) == nil || $receiver == undefined){
  13. $3=_st($HLCodeWidget())._new();
  14. _st($3)._model_(_st(self["@model"])._code());
  15. _st($3)._receiver_(_st(self["@model"])._inspectee());
  16. $4=_st($3)._yourself();
  17. self["@codeWidget"]=$4;
  18. $1=self["@codeWidget"];
  19. } else {
  20. $1=$2;
  21. };
  22. return $1;
  23. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLInspector)})},
  24. messageSends: ["ifNil:", "model:", "code", "new", "receiver:", "inspectee", "yourself"]}),
  25. smalltalk.HLInspector);
  26. smalltalk.addMethod(
  27. smalltalk.method({
  28. selector: "displayWidget",
  29. fn: function (){
  30. var self=this;
  31. function $HLInspectorDisplayWidget(){return smalltalk.HLInspectorDisplayWidget||(typeof HLInspectorDisplayWidget=="undefined"?nil:HLInspectorDisplayWidget)}
  32. return smalltalk.withContext(function($ctx1) {
  33. var $2,$3,$4,$1;
  34. $2=self["@displayWidget"];
  35. if(($receiver = $2) == nil || $receiver == undefined){
  36. $3=_st($HLInspectorDisplayWidget())._new();
  37. _st($3)._model_(_st(self)._model());
  38. $4=_st($3)._yourself();
  39. self["@displayWidget"]=$4;
  40. $1=self["@displayWidget"];
  41. } else {
  42. $1=$2;
  43. };
  44. return $1;
  45. }, function($ctx1) {$ctx1.fill(self,"displayWidget",{},smalltalk.HLInspector)})},
  46. messageSends: ["ifNil:", "model:", "model", "new", "yourself"]}),
  47. smalltalk.HLInspector);
  48. smalltalk.addMethod(
  49. smalltalk.method({
  50. selector: "inspect:",
  51. fn: function (anObject){
  52. var self=this;
  53. return smalltalk.withContext(function($ctx1) {
  54. var $1,$2;
  55. _st(_st(self)._model())._inspect_on_(anObject,self);
  56. $1=self;
  57. _st($1)._refreshVariablesWidget();
  58. $2=_st($1)._refreshDisplayWidget();
  59. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.HLInspector)})},
  60. messageSends: ["inspect:on:", "model", "refreshVariablesWidget", "refreshDisplayWidget"]}),
  61. smalltalk.HLInspector);
  62. smalltalk.addMethod(
  63. smalltalk.method({
  64. selector: "inspectee",
  65. fn: function (){
  66. var self=this;
  67. return smalltalk.withContext(function($ctx1) {
  68. var $1;
  69. $1=_st(_st(self)._model())._inspectee();
  70. return $1;
  71. }, function($ctx1) {$ctx1.fill(self,"inspectee",{},smalltalk.HLInspector)})},
  72. messageSends: ["inspectee", "model"]}),
  73. smalltalk.HLInspector);
  74. smalltalk.addMethod(
  75. smalltalk.method({
  76. selector: "inspectee:",
  77. fn: function (anObject){
  78. var self=this;
  79. return smalltalk.withContext(function($ctx1) {
  80. _st(_st(self)._model())._inspectee_(anObject);
  81. return self}, function($ctx1) {$ctx1.fill(self,"inspectee:",{anObject:anObject},smalltalk.HLInspector)})},
  82. messageSends: ["inspectee:", "model"]}),
  83. smalltalk.HLInspector);
  84. smalltalk.addMethod(
  85. smalltalk.method({
  86. selector: "label",
  87. fn: function (){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) {
  90. var $2,$1;
  91. $2=self["@label"];
  92. if(($receiver = $2) == nil || $receiver == undefined){
  93. $1=_st(_st(self["@model"])._inspectee())._printString();
  94. } else {
  95. $1=$2;
  96. };
  97. return $1;
  98. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLInspector)})},
  99. messageSends: ["ifNil:", "printString", "inspectee"]}),
  100. smalltalk.HLInspector);
  101. smalltalk.addMethod(
  102. smalltalk.method({
  103. selector: "model",
  104. fn: function (){
  105. var self=this;
  106. function $HLInspectorModel(){return smalltalk.HLInspectorModel||(typeof HLInspectorModel=="undefined"?nil:HLInspectorModel)}
  107. return smalltalk.withContext(function($ctx1) {
  108. var $2,$1;
  109. $2=self["@model"];
  110. if(($receiver = $2) == nil || $receiver == undefined){
  111. _st(self)._model_(_st($HLInspectorModel())._new());
  112. $1=self["@model"];
  113. } else {
  114. $1=$2;
  115. };
  116. return $1;
  117. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLInspector)})},
  118. messageSends: ["ifNil:", "model:", "new"]}),
  119. smalltalk.HLInspector);
  120. smalltalk.addMethod(
  121. smalltalk.method({
  122. selector: "model:",
  123. fn: function (aModel){
  124. var self=this;
  125. return smalltalk.withContext(function($ctx1) {
  126. var $1,$2;
  127. self["@model"]=aModel;
  128. _st(_st(self)._codeWidget())._model_(_st(aModel)._code());
  129. $1=self;
  130. _st($1)._observeCodeWidget();
  131. _st($1)._observeVariablesWidget();
  132. $2=_st($1)._observeModel();
  133. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLInspector)})},
  134. messageSends: ["model:", "code", "codeWidget", "observeCodeWidget", "observeVariablesWidget", "observeModel"]}),
  135. smalltalk.HLInspector);
  136. smalltalk.addMethod(
  137. smalltalk.method({
  138. selector: "observeCodeWidget",
  139. fn: function (){
  140. var self=this;
  141. function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  142. return smalltalk.withContext(function($ctx1) {
  143. _st(_st(_st(self)._codeWidget())._announcer())._on_do_($HLDoItExecuted(),(function(){
  144. return smalltalk.withContext(function($ctx2) {
  145. return _st(self)._onDoneIt();
  146. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  147. return self}, function($ctx1) {$ctx1.fill(self,"observeCodeWidget",{},smalltalk.HLInspector)})},
  148. messageSends: ["on:do:", "onDoneIt", "announcer", "codeWidget"]}),
  149. smalltalk.HLInspector);
  150. smalltalk.addMethod(
  151. smalltalk.method({
  152. selector: "observeModel",
  153. fn: function (){
  154. var self=this;
  155. function $HLInstanceVariableSelected(){return smalltalk.HLInstanceVariableSelected||(typeof HLInstanceVariableSelected=="undefined"?nil:HLInstanceVariableSelected)}
  156. return smalltalk.withContext(function($ctx1) {
  157. _st(_st(_st(self)._model())._announcer())._on_send_to_($HLInstanceVariableSelected(),"onInstanceVariableSelected",self);
  158. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLInspector)})},
  159. messageSends: ["on:send:to:", "announcer", "model"]}),
  160. smalltalk.HLInspector);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "observeVariablesWidget",
  164. fn: function (){
  165. var self=this;
  166. function $HLRefreshRequested(){return smalltalk.HLRefreshRequested||(typeof HLRefreshRequested=="undefined"?nil:HLRefreshRequested)}
  167. function $HLDiveRequested(){return smalltalk.HLDiveRequested||(typeof HLDiveRequested=="undefined"?nil:HLDiveRequested)}
  168. return smalltalk.withContext(function($ctx1) {
  169. var $1,$2;
  170. $1=_st(_st(self)._variablesWidget())._announcer();
  171. _st($1)._on_do_($HLRefreshRequested(),(function(ann){
  172. return smalltalk.withContext(function($ctx2) {
  173. return _st(self)._onRefresh();
  174. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  175. $2=_st($1)._on_do_($HLDiveRequested(),(function(){
  176. return smalltalk.withContext(function($ctx2) {
  177. return _st(self)._onDive();
  178. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  179. return self}, function($ctx1) {$ctx1.fill(self,"observeVariablesWidget",{},smalltalk.HLInspector)})},
  180. messageSends: ["on:do:", "onRefresh", "announcer", "variablesWidget", "onDive"]}),
  181. smalltalk.HLInspector);
  182. smalltalk.addMethod(
  183. smalltalk.method({
  184. selector: "onDive",
  185. fn: function (){
  186. var self=this;
  187. return smalltalk.withContext(function($ctx1) {
  188. _st(self)._inspect_(_st(_st(self)._model())._selectedInstVarObject());
  189. return self}, function($ctx1) {$ctx1.fill(self,"onDive",{},smalltalk.HLInspector)})},
  190. messageSends: ["inspect:", "selectedInstVarObject", "model"]}),
  191. smalltalk.HLInspector);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "onDoneIt",
  195. fn: function (){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. _st(self)._refresh();
  199. return self}, function($ctx1) {$ctx1.fill(self,"onDoneIt",{},smalltalk.HLInspector)})},
  200. messageSends: ["refresh"]}),
  201. smalltalk.HLInspector);
  202. smalltalk.addMethod(
  203. smalltalk.method({
  204. selector: "onInspectIt",
  205. fn: function (){
  206. var self=this;
  207. return smalltalk.withContext(function($ctx1) {
  208. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLInspector)})},
  209. messageSends: []}),
  210. smalltalk.HLInspector);
  211. smalltalk.addMethod(
  212. smalltalk.method({
  213. selector: "onInstanceVariableSelected",
  214. fn: function (){
  215. var self=this;
  216. return smalltalk.withContext(function($ctx1) {
  217. _st(_st(self)._codeWidget())._receiver_(_st(_st(self)._model())._selectedInstVarObject());
  218. _st(self)._refreshDisplayWidget();
  219. return self}, function($ctx1) {$ctx1.fill(self,"onInstanceVariableSelected",{},smalltalk.HLInspector)})},
  220. messageSends: ["receiver:", "selectedInstVarObject", "model", "codeWidget", "refreshDisplayWidget"]}),
  221. smalltalk.HLInspector);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "onPrintIt",
  225. fn: function (){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) {
  228. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLInspector)})},
  229. messageSends: []}),
  230. smalltalk.HLInspector);
  231. smalltalk.addMethod(
  232. smalltalk.method({
  233. selector: "onRefresh",
  234. fn: function (){
  235. var self=this;
  236. return smalltalk.withContext(function($ctx1) {
  237. _st(self)._refresh();
  238. return self}, function($ctx1) {$ctx1.fill(self,"onRefresh",{},smalltalk.HLInspector)})},
  239. messageSends: ["refresh"]}),
  240. smalltalk.HLInspector);
  241. smalltalk.addMethod(
  242. smalltalk.method({
  243. selector: "open",
  244. fn: function (){
  245. var self=this;
  246. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  247. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  248. return smalltalk.withContext(function($ctx1) {
  249. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(self,_st(self)._tabLabel()));
  250. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.HLInspector)})},
  251. messageSends: ["addTab:", "on:labelled:", "tabLabel", "current"]}),
  252. smalltalk.HLInspector);
  253. smalltalk.addMethod(
  254. smalltalk.method({
  255. selector: "refresh",
  256. fn: function (){
  257. var self=this;
  258. return smalltalk.withContext(function($ctx1) {
  259. _st(self)._inspect_(_st(self)._inspectee());
  260. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLInspector)})},
  261. messageSends: ["inspect:", "inspectee"]}),
  262. smalltalk.HLInspector);
  263. smalltalk.addMethod(
  264. smalltalk.method({
  265. selector: "refreshDisplayWidget",
  266. fn: function (){
  267. var self=this;
  268. return smalltalk.withContext(function($ctx1) {
  269. _st(_st(self)._displayWidget())._refresh();
  270. return self}, function($ctx1) {$ctx1.fill(self,"refreshDisplayWidget",{},smalltalk.HLInspector)})},
  271. messageSends: ["refresh", "displayWidget"]}),
  272. smalltalk.HLInspector);
  273. smalltalk.addMethod(
  274. smalltalk.method({
  275. selector: "refreshVariablesWidget",
  276. fn: function (){
  277. var self=this;
  278. return smalltalk.withContext(function($ctx1) {
  279. _st(_st(self)._variablesWidget())._refresh();
  280. return self}, function($ctx1) {$ctx1.fill(self,"refreshVariablesWidget",{},smalltalk.HLInspector)})},
  281. messageSends: ["refresh", "variablesWidget"]}),
  282. smalltalk.HLInspector);
  283. smalltalk.addMethod(
  284. smalltalk.method({
  285. selector: "renderContentOn:",
  286. fn: function (html){
  287. var self=this;
  288. function $HLVerticalSplitter(){return smalltalk.HLVerticalSplitter||(typeof HLVerticalSplitter=="undefined"?nil:HLVerticalSplitter)}
  289. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  290. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  291. return smalltalk.withContext(function($ctx1) {
  292. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(_st($HLVerticalSplitter())._with_with_(_st(self)._variablesWidget(),_st(self)._displayWidget()),_st(self)._codeWidget())));
  293. _st(_st(self)._variablesWidget())._focus();
  294. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLInspector)})},
  295. messageSends: ["with:", "with:with:", "variablesWidget", "displayWidget", "codeWidget", "focus"]}),
  296. smalltalk.HLInspector);
  297. smalltalk.addMethod(
  298. smalltalk.method({
  299. selector: "setLabel:",
  300. fn: function (aString){
  301. var self=this;
  302. return smalltalk.withContext(function($ctx1) {
  303. self["@label"]=aString;
  304. return self}, function($ctx1) {$ctx1.fill(self,"setLabel:",{aString:aString},smalltalk.HLInspector)})},
  305. messageSends: []}),
  306. smalltalk.HLInspector);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "setVariables:",
  310. fn: function (aDictionary){
  311. var self=this;
  312. return smalltalk.withContext(function($ctx1) {
  313. _st(_st(self)._model())._variables_(aDictionary);
  314. return self}, function($ctx1) {$ctx1.fill(self,"setVariables:",{aDictionary:aDictionary},smalltalk.HLInspector)})},
  315. messageSends: ["variables:", "model"]}),
  316. smalltalk.HLInspector);
  317. smalltalk.addMethod(
  318. smalltalk.method({
  319. selector: "tabLabel",
  320. fn: function (){
  321. var self=this;
  322. return smalltalk.withContext(function($ctx1) {
  323. return "Inspector";
  324. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLInspector)})},
  325. messageSends: []}),
  326. smalltalk.HLInspector);
  327. smalltalk.addMethod(
  328. smalltalk.method({
  329. selector: "variablesWidget",
  330. fn: function (){
  331. var self=this;
  332. function $HLInspectorVariablesWidget(){return smalltalk.HLInspectorVariablesWidget||(typeof HLInspectorVariablesWidget=="undefined"?nil:HLInspectorVariablesWidget)}
  333. return smalltalk.withContext(function($ctx1) {
  334. var $2,$3,$4,$1;
  335. $2=self["@variablesWidget"];
  336. if(($receiver = $2) == nil || $receiver == undefined){
  337. $3=_st($HLInspectorVariablesWidget())._new();
  338. _st($3)._model_(_st(self)._model());
  339. $4=_st($3)._yourself();
  340. self["@variablesWidget"]=$4;
  341. $1=self["@variablesWidget"];
  342. } else {
  343. $1=$2;
  344. };
  345. return $1;
  346. }, function($ctx1) {$ctx1.fill(self,"variablesWidget",{},smalltalk.HLInspector)})},
  347. messageSends: ["ifNil:", "model:", "model", "new", "yourself"]}),
  348. smalltalk.HLInspector);
  349. smalltalk.addMethod(
  350. smalltalk.method({
  351. selector: "canBeOpenAsTab",
  352. fn: function (){
  353. var self=this;
  354. return smalltalk.withContext(function($ctx1) {
  355. return false;
  356. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLInspector.klass)})},
  357. messageSends: []}),
  358. smalltalk.HLInspector.klass);
  359. smalltalk.addMethod(
  360. smalltalk.method({
  361. selector: "tabLabel",
  362. fn: function (){
  363. var self=this;
  364. return smalltalk.withContext(function($ctx1) {
  365. return "Inspector";
  366. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLInspector.klass)})},
  367. messageSends: []}),
  368. smalltalk.HLInspector.klass);
  369. smalltalk.addMethod(
  370. smalltalk.method({
  371. selector: "tabPriority",
  372. fn: function (){
  373. var self=this;
  374. return smalltalk.withContext(function($ctx1) {
  375. var $1;
  376. $1=(10);
  377. return $1;
  378. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLInspector.klass)})},
  379. messageSends: []}),
  380. smalltalk.HLInspector.klass);
  381. smalltalk.addClass('HLInspectorDisplayWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Inspector');
  382. smalltalk.addMethod(
  383. smalltalk.method({
  384. selector: "model",
  385. fn: function (){
  386. var self=this;
  387. return smalltalk.withContext(function($ctx1) {
  388. var $1;
  389. $1=self["@model"];
  390. return $1;
  391. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLInspectorDisplayWidget)})},
  392. messageSends: []}),
  393. smalltalk.HLInspectorDisplayWidget);
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "model:",
  397. fn: function (aModel){
  398. var self=this;
  399. return smalltalk.withContext(function($ctx1) {
  400. self["@model"]=aModel;
  401. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLInspectorDisplayWidget)})},
  402. messageSends: []}),
  403. smalltalk.HLInspectorDisplayWidget);
  404. smalltalk.addMethod(
  405. smalltalk.method({
  406. selector: "renderContentOn:",
  407. fn: function (html){
  408. var self=this;
  409. return smalltalk.withContext(function($ctx1) {
  410. _st(_st(html)._div())._with_(_st(self)._selectionDisplayString());
  411. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLInspectorDisplayWidget)})},
  412. messageSends: ["with:", "selectionDisplayString", "div"]}),
  413. smalltalk.HLInspectorDisplayWidget);
  414. smalltalk.addMethod(
  415. smalltalk.method({
  416. selector: "selectionDisplayString",
  417. fn: function (){
  418. var self=this;
  419. var selection;
  420. return smalltalk.withContext(function($ctx1) {
  421. var $2,$1;
  422. selection=_st(self["@model"])._selection();
  423. $2=_st(_st(_st(self["@model"])._variables())._keys())._includes_(selection);
  424. if(smalltalk.assert($2)){
  425. $1=_st(_st(self["@model"])._instVarObjectAt_(selection))._printString();
  426. } else {
  427. $1="";
  428. };
  429. return $1;
  430. }, function($ctx1) {$ctx1.fill(self,"selectionDisplayString",{selection:selection},smalltalk.HLInspectorDisplayWidget)})},
  431. messageSends: ["selection", "ifTrue:ifFalse:", "printString", "instVarObjectAt:", "includes:", "keys", "variables"]}),
  432. smalltalk.HLInspectorDisplayWidget);
  433. smalltalk.addClass('HLInspectorModel', smalltalk.Object, ['announcer', 'environment', 'inspectee', 'code', 'variables', 'selection'], 'Helios-Inspector');
  434. smalltalk.addMethod(
  435. smalltalk.method({
  436. selector: "announcer",
  437. fn: function (){
  438. var self=this;
  439. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  440. return smalltalk.withContext(function($ctx1) {
  441. var $2,$1;
  442. $2=self["@announcer"];
  443. if(($receiver = $2) == nil || $receiver == undefined){
  444. self["@announcer"]=_st($Announcer())._new();
  445. $1=self["@announcer"];
  446. } else {
  447. $1=$2;
  448. };
  449. return $1;
  450. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLInspectorModel)})},
  451. messageSends: ["ifNil:", "new"]}),
  452. smalltalk.HLInspectorModel);
  453. smalltalk.addMethod(
  454. smalltalk.method({
  455. selector: "code",
  456. fn: function (){
  457. var self=this;
  458. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  459. return smalltalk.withContext(function($ctx1) {
  460. var $2,$1;
  461. $2=self["@code"];
  462. if(($receiver = $2) == nil || $receiver == undefined){
  463. self["@code"]=_st($HLCodeModel())._on_(_st(self)._environment());
  464. $1=self["@code"];
  465. } else {
  466. $1=$2;
  467. };
  468. return $1;
  469. }, function($ctx1) {$ctx1.fill(self,"code",{},smalltalk.HLInspectorModel)})},
  470. messageSends: ["ifNil:", "on:", "environment"]}),
  471. smalltalk.HLInspectorModel);
  472. smalltalk.addMethod(
  473. smalltalk.method({
  474. selector: "environment",
  475. fn: function (){
  476. var self=this;
  477. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  478. return smalltalk.withContext(function($ctx1) {
  479. var $2,$1;
  480. $2=self["@environment"];
  481. if(($receiver = $2) == nil || $receiver == undefined){
  482. $1=_st(_st($HLManager())._current())._environment();
  483. } else {
  484. $1=$2;
  485. };
  486. return $1;
  487. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLInspectorModel)})},
  488. messageSends: ["ifNil:", "environment", "current"]}),
  489. smalltalk.HLInspectorModel);
  490. smalltalk.addMethod(
  491. smalltalk.method({
  492. selector: "environment:",
  493. fn: function (anEnvironment){
  494. var self=this;
  495. return smalltalk.withContext(function($ctx1) {
  496. self["@environment"]=anEnvironment;
  497. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLInspectorModel)})},
  498. messageSends: []}),
  499. smalltalk.HLInspectorModel);
  500. smalltalk.addMethod(
  501. smalltalk.method({
  502. selector: "inspect:on:",
  503. fn: function (anObject,anInspector){
  504. var self=this;
  505. return smalltalk.withContext(function($ctx1) {
  506. self["@inspectee"]=anObject;
  507. self["@variables"]=[];
  508. _st(self["@inspectee"])._inspectOn_(anInspector);
  509. return self}, function($ctx1) {$ctx1.fill(self,"inspect:on:",{anObject:anObject,anInspector:anInspector},smalltalk.HLInspectorModel)})},
  510. messageSends: ["inspectOn:"]}),
  511. smalltalk.HLInspectorModel);
  512. smalltalk.addMethod(
  513. smalltalk.method({
  514. selector: "inspectee",
  515. fn: function (){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) {
  518. var $1;
  519. $1=self["@inspectee"];
  520. return $1;
  521. }, function($ctx1) {$ctx1.fill(self,"inspectee",{},smalltalk.HLInspectorModel)})},
  522. messageSends: []}),
  523. smalltalk.HLInspectorModel);
  524. smalltalk.addMethod(
  525. smalltalk.method({
  526. selector: "inspectee:",
  527. fn: function (anObject){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) {
  530. self["@inspectee"]=anObject;
  531. return self}, function($ctx1) {$ctx1.fill(self,"inspectee:",{anObject:anObject},smalltalk.HLInspectorModel)})},
  532. messageSends: []}),
  533. smalltalk.HLInspectorModel);
  534. smalltalk.addMethod(
  535. smalltalk.method({
  536. selector: "instVarObjectAt:",
  537. fn: function (anInstVarName){
  538. var self=this;
  539. return smalltalk.withContext(function($ctx1) {
  540. var $1;
  541. $1=_st(_st(self)._variables())._at_(anInstVarName);
  542. return $1;
  543. }, function($ctx1) {$ctx1.fill(self,"instVarObjectAt:",{anInstVarName:anInstVarName},smalltalk.HLInspectorModel)})},
  544. messageSends: ["at:", "variables"]}),
  545. smalltalk.HLInspectorModel);
  546. smalltalk.addMethod(
  547. smalltalk.method({
  548. selector: "onKeyDown:",
  549. fn: function (anEvent){
  550. var self=this;
  551. return smalltalk.withContext(function($ctx1) {
  552. if(anEvent.ctrlKey) {
  553. if(anEvent.keyCode === 80) { //ctrl+p
  554. self._printIt();
  555. anEvent.preventDefault();
  556. return false;
  557. }
  558. if(anEvent.keyCode === 68) { //ctrl+d
  559. self._doIt();
  560. anEvent.preventDefault();
  561. return false;
  562. }
  563. if(anEvent.keyCode === 73) { //ctrl+i
  564. self._inspectIt();
  565. anEvent.preventDefault();
  566. return false;
  567. }
  568. };
  569. return self}, function($ctx1) {$ctx1.fill(self,"onKeyDown:",{anEvent:anEvent},smalltalk.HLInspectorModel)})},
  570. messageSends: []}),
  571. smalltalk.HLInspectorModel);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "selectedInstVar:",
  575. fn: function (anInstVarName){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) {
  578. _st(self)._selection_(anInstVarName);
  579. return self}, function($ctx1) {$ctx1.fill(self,"selectedInstVar:",{anInstVarName:anInstVarName},smalltalk.HLInspectorModel)})},
  580. messageSends: ["selection:"]}),
  581. smalltalk.HLInspectorModel);
  582. smalltalk.addMethod(
  583. smalltalk.method({
  584. selector: "selectedInstVarObject",
  585. fn: function (){
  586. var self=this;
  587. return smalltalk.withContext(function($ctx1) {
  588. var $1;
  589. $1=_st(self)._instVarObjectAt_(_st(self)._selection());
  590. return $1;
  591. }, function($ctx1) {$ctx1.fill(self,"selectedInstVarObject",{},smalltalk.HLInspectorModel)})},
  592. messageSends: ["instVarObjectAt:", "selection"]}),
  593. smalltalk.HLInspectorModel);
  594. smalltalk.addMethod(
  595. smalltalk.method({
  596. selector: "selection",
  597. fn: function (){
  598. var self=this;
  599. return smalltalk.withContext(function($ctx1) {
  600. var $2,$1;
  601. $2=self["@selection"];
  602. if(($receiver = $2) == nil || $receiver == undefined){
  603. $1="";
  604. } else {
  605. $1=$2;
  606. };
  607. return $1;
  608. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLInspectorModel)})},
  609. messageSends: ["ifNil:"]}),
  610. smalltalk.HLInspectorModel);
  611. smalltalk.addMethod(
  612. smalltalk.method({
  613. selector: "selection:",
  614. fn: function (anObject){
  615. var self=this;
  616. function $HLInstanceVariableSelected(){return smalltalk.HLInstanceVariableSelected||(typeof HLInstanceVariableSelected=="undefined"?nil:HLInstanceVariableSelected)}
  617. return smalltalk.withContext(function($ctx1) {
  618. self["@selection"]=anObject;
  619. _st(_st(self)._announcer())._announce_(_st($HLInstanceVariableSelected())._on_(self["@selection"]));
  620. return self}, function($ctx1) {$ctx1.fill(self,"selection:",{anObject:anObject},smalltalk.HLInspectorModel)})},
  621. messageSends: ["announce:", "on:", "announcer"]}),
  622. smalltalk.HLInspectorModel);
  623. smalltalk.addMethod(
  624. smalltalk.method({
  625. selector: "subscribe:",
  626. fn: function (aWidget){
  627. var self=this;
  628. return smalltalk.withContext(function($ctx1) {
  629. _st(aWidget)._subscribeTo_(_st(self)._announcer());
  630. return self}, function($ctx1) {$ctx1.fill(self,"subscribe:",{aWidget:aWidget},smalltalk.HLInspectorModel)})},
  631. messageSends: ["subscribeTo:", "announcer"]}),
  632. smalltalk.HLInspectorModel);
  633. smalltalk.addMethod(
  634. smalltalk.method({
  635. selector: "variables",
  636. fn: function (){
  637. var self=this;
  638. return smalltalk.withContext(function($ctx1) {
  639. var $1;
  640. $1=self["@variables"];
  641. return $1;
  642. }, function($ctx1) {$ctx1.fill(self,"variables",{},smalltalk.HLInspectorModel)})},
  643. messageSends: []}),
  644. smalltalk.HLInspectorModel);
  645. smalltalk.addMethod(
  646. smalltalk.method({
  647. selector: "variables:",
  648. fn: function (aCollection){
  649. var self=this;
  650. return smalltalk.withContext(function($ctx1) {
  651. self["@variables"]=aCollection;
  652. return self}, function($ctx1) {$ctx1.fill(self,"variables:",{aCollection:aCollection},smalltalk.HLInspectorModel)})},
  653. messageSends: []}),
  654. smalltalk.HLInspectorModel);
  655. smalltalk.addMethod(
  656. smalltalk.method({
  657. selector: "on:",
  658. fn: function (anEnvironment){
  659. var self=this;
  660. return smalltalk.withContext(function($ctx1) {
  661. var $2,$3,$1;
  662. $2=_st(self)._new();
  663. _st($2)._environment_(anEnvironment);
  664. $3=_st($2)._yourself();
  665. $1=$3;
  666. return $1;
  667. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLInspectorModel.klass)})},
  668. messageSends: ["environment:", "new", "yourself"]}),
  669. smalltalk.HLInspectorModel.klass);
  670. smalltalk.addClass('HLInspectorVariablesWidget', smalltalk.HLNavigationListWidget, ['announcer', 'model', 'list', 'diveButton'], 'Helios-Inspector');
  671. smalltalk.addMethod(
  672. smalltalk.method({
  673. selector: "announcer",
  674. fn: function (){
  675. var self=this;
  676. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  677. return smalltalk.withContext(function($ctx1) {
  678. var $2,$1;
  679. $2=self["@announcer"];
  680. if(($receiver = $2) == nil || $receiver == undefined){
  681. self["@announcer"]=_st($Announcer())._new();
  682. $1=self["@announcer"];
  683. } else {
  684. $1=$2;
  685. };
  686. return $1;
  687. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLInspectorVariablesWidget)})},
  688. messageSends: ["ifNil:", "new"]}),
  689. smalltalk.HLInspectorVariablesWidget);
  690. smalltalk.addMethod(
  691. smalltalk.method({
  692. selector: "defaultItems",
  693. fn: function (){
  694. var self=this;
  695. return smalltalk.withContext(function($ctx1) {
  696. var $1;
  697. $1=_st(_st(_st(self)._model())._variables())._keys();
  698. return $1;
  699. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLInspectorVariablesWidget)})},
  700. messageSends: ["keys", "variables", "model"]}),
  701. smalltalk.HLInspectorVariablesWidget);
  702. smalltalk.addMethod(
  703. smalltalk.method({
  704. selector: "label",
  705. fn: function (){
  706. var self=this;
  707. return smalltalk.withContext(function($ctx1) {
  708. var $1;
  709. $1=_st(_st(_st(_st(self)._model())._inspectee())._class())._name();
  710. return $1;
  711. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLInspectorVariablesWidget)})},
  712. messageSends: ["name", "class", "inspectee", "model"]}),
  713. smalltalk.HLInspectorVariablesWidget);
  714. smalltalk.addMethod(
  715. smalltalk.method({
  716. selector: "model",
  717. fn: function (){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) {
  720. var $1;
  721. $1=self["@model"];
  722. return $1;
  723. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLInspectorVariablesWidget)})},
  724. messageSends: []}),
  725. smalltalk.HLInspectorVariablesWidget);
  726. smalltalk.addMethod(
  727. smalltalk.method({
  728. selector: "model:",
  729. fn: function (aModel){
  730. var self=this;
  731. return smalltalk.withContext(function($ctx1) {
  732. self["@model"]=aModel;
  733. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLInspectorVariablesWidget)})},
  734. messageSends: []}),
  735. smalltalk.HLInspectorVariablesWidget);
  736. smalltalk.addMethod(
  737. smalltalk.method({
  738. selector: "refresh",
  739. fn: function (){
  740. var self=this;
  741. return smalltalk.withContext(function($ctx1) {
  742. _st(self)._resetItems();
  743. smalltalk.HLNavigationListWidget.fn.prototype._refresh.apply(_st(self), []);
  744. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLInspectorVariablesWidget)})},
  745. messageSends: ["resetItems", "refresh"]}),
  746. smalltalk.HLInspectorVariablesWidget);
  747. smalltalk.addMethod(
  748. smalltalk.method({
  749. selector: "renderButtonsOn:",
  750. fn: function (html){
  751. var self=this;
  752. function $HLRefreshRequested(){return smalltalk.HLRefreshRequested||(typeof HLRefreshRequested=="undefined"?nil:HLRefreshRequested)}
  753. function $HLDiveRequested(){return smalltalk.HLDiveRequested||(typeof HLDiveRequested=="undefined"?nil:HLDiveRequested)}
  754. return smalltalk.withContext(function($ctx1) {
  755. var $1,$2,$3,$4;
  756. $1=_st(html)._button();
  757. _st($1)._class_("btn");
  758. _st($1)._with_("Refresh");
  759. $2=_st($1)._onClick_((function(){
  760. return smalltalk.withContext(function($ctx2) {
  761. return _st(_st(self)._announcer())._announce_(_st($HLRefreshRequested())._new());
  762. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  763. $3=_st(html)._button();
  764. _st($3)._class_("btn");
  765. _st($3)._with_("Dive");
  766. $4=_st($3)._onClick_((function(){
  767. return smalltalk.withContext(function($ctx2) {
  768. return _st(_st(self)._announcer())._announce_(_st($HLDiveRequested())._new());
  769. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  770. self["@diveButton"]=$4;
  771. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLInspectorVariablesWidget)})},
  772. messageSends: ["class:", "button", "with:", "onClick:", "announce:", "new", "announcer"]}),
  773. smalltalk.HLInspectorVariablesWidget);
  774. smalltalk.addMethod(
  775. smalltalk.method({
  776. selector: "renderContentOn:",
  777. fn: function (html){
  778. var self=this;
  779. return smalltalk.withContext(function($ctx1) {
  780. _st(self)._renderHeadOn_(html);
  781. smalltalk.HLNavigationListWidget.fn.prototype._renderContentOn_.apply(_st(self), [html]);
  782. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLInspectorVariablesWidget)})},
  783. messageSends: ["renderHeadOn:", "renderContentOn:"]}),
  784. smalltalk.HLInspectorVariablesWidget);
  785. smalltalk.addMethod(
  786. smalltalk.method({
  787. selector: "renderHeadOn:",
  788. fn: function (html){
  789. var self=this;
  790. return smalltalk.withContext(function($ctx1) {
  791. var $1,$2;
  792. $1=_st(html)._div();
  793. _st($1)._class_("list-label");
  794. $2=_st($1)._with_(_st(self)._label());
  795. return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},smalltalk.HLInspectorVariablesWidget)})},
  796. messageSends: ["class:", "div", "with:", "label"]}),
  797. smalltalk.HLInspectorVariablesWidget);
  798. smalltalk.addMethod(
  799. smalltalk.method({
  800. selector: "resetItems",
  801. fn: function (){
  802. var self=this;
  803. return smalltalk.withContext(function($ctx1) {
  804. self["@items"]=nil;
  805. return self}, function($ctx1) {$ctx1.fill(self,"resetItems",{},smalltalk.HLInspectorVariablesWidget)})},
  806. messageSends: []}),
  807. smalltalk.HLInspectorVariablesWidget);
  808. smalltalk.addMethod(
  809. smalltalk.method({
  810. selector: "selectItem:",
  811. fn: function (anObject){
  812. var self=this;
  813. return smalltalk.withContext(function($ctx1) {
  814. smalltalk.HLNavigationListWidget.fn.prototype._selectItem_.apply(_st(self), [anObject]);
  815. _st(_st(self)._model())._selectedInstVar_(anObject);
  816. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLInspectorVariablesWidget)})},
  817. messageSends: ["selectItem:", "selectedInstVar:", "model"]}),
  818. smalltalk.HLInspectorVariablesWidget);
  819. smalltalk.addMethod(
  820. smalltalk.method({
  821. selector: "selection",
  822. fn: function (){
  823. var self=this;
  824. return smalltalk.withContext(function($ctx1) {
  825. var $1;
  826. $1=_st(self["@model"])._selection();
  827. return $1;
  828. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLInspectorVariablesWidget)})},
  829. messageSends: ["selection"]}),
  830. smalltalk.HLInspectorVariablesWidget);
  831. smalltalk.addMethod(
  832. smalltalk.method({
  833. selector: "variables",
  834. fn: function (){
  835. var self=this;
  836. return smalltalk.withContext(function($ctx1) {
  837. var $1;
  838. $1=_st(self["@model"])._variables();
  839. return $1;
  840. }, function($ctx1) {$ctx1.fill(self,"variables",{},smalltalk.HLInspectorVariablesWidget)})},
  841. messageSends: ["variables"]}),
  842. smalltalk.HLInspectorVariablesWidget);