# HG changeset patch # User Claus Gittinger # Date 1391626575 -3600 # Node ID 538d93a2f75d8c50d4857a7f8282a5b0d2614495 # Parent 6f311465b4cf009e4466dc6474ef89e14e1fec4f merged in jv's chenges diff -r 6f311465b4cf -r 538d93a2f75d Tools__Inspector2.st --- a/Tools__Inspector2.st Wed Feb 05 19:56:13 2014 +0100 +++ b/Tools__Inspector2.st Wed Feb 05 19:56:15 2014 +0100 @@ -16,8 +16,9 @@ ApplicationModel subclass:#Inspector2 instanceVariableNames:'tabViewAspect navigationHistoryHolder navigationStateAspect browser currentObjectHolder colorProfileHolder - toolbarBackgroundHolder' - classVariableNames:'LastExtent ColorProfiles' + toolbarBackgroundHolder evaluationLanguageHolder + evaluationLanguageList' + classVariableNames:'LastExtent ColorProfiles EvaluationLanguageMap' poolDictionaries:'' category:'Interface-Inspector2' ! @@ -71,10 +72,11 @@ at: #green put: Color green lighter; at: #blue put: Color blue lighter; at: #yellow put: Color yellow lighter; - at: #gray put: Color gray; - yourself. + at: #gray put: Color gray. - "Modified: / 17-01-2012 / 12:57:40 / Jan Vrany " + EvaluationLanguageMap := Dictionary new. + + "Modified: / 26-10-2013 / 00:42:35 / Jan Vrany " ! ! !Inspector2 class methodsFor:'help specs'! @@ -138,6 +140,9 @@ #colorProfile '' +#evaluationLanguage +'Language used for evaluating expressions in code panes' + ) ! ! @@ -145,10 +150,12 @@ settingsIcon - ^self settingsIcon5 + - "Modified: / 17-01-2012 / 12:45:40 / Jan Vrany " + ^self settingsIcon6 + "Modified: / 19-01-2012 / 14:00:35 / cg" + "Modified: / 28-02-2012 / 21:59:25 / Jan Vrany " ! settingsIcon1 @@ -314,9 +321,41 @@ ! settingsIcon5 + + + ^ GenericToolbarIconLibrary palette16x16Icon "Created: / 19-01-2012 / 14:00:24 / cg" + "Modified: / 18-02-2012 / 16:28:35 / Jan Vrany " +! + +settingsIcon6 + "This resource specification was automatically generated + by the ImageEditor of ST/X." + + "Do not manually edit this!! If it is corrupted, + the ImageEditor may not be able to read the specification." + + " + self settingsIcon6 inspect + ImageEditor openOnClass:self andSelector:#settingsIcon6 + Icon flushCachedIcons + " + + + + ^Icon + constantNamed:'Tools::Inspector2 class settingsIcon6' + ifAbsentPut:[(Depth8Image new) width: 25; height: 25; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' +(:N#(:N#(:N#(:N#(:N#(:N#(:N#(:N#(:IWY&Y&Y&Y1(!!8*J"4*J#""JCX6M3X6PJJ"YG]7]7]7]:H$O#8>O#8>(#MBP$IBP$J"(FA5]WU5]WV G3(:N#(: +N*@+PTEAPTEA(I=X[7A/\F=/''1X1LSD1LSF_H34=OC0^T6-+Z6-+Z98QI2\''I2\''''!!,5MST5MSV^''T=''Y6]''Y6^]B2D!!HRD!!HY4TLC@0LB<0''Y1VX&I" +X&I"''@O#8>O&H&!!(ZF!!(ZFXIS@???? O???8C???>@???? O???8C???>@???? O???8C???>@???? O???8C???>@???? O???8C???>@???? O???8C???>@???? O?? +?8C???>@???? @@a') ; yourself); yourself] ! ! !Inspector2 class methodsFor:'interface specs'! @@ -337,41 +376,51 @@ ^ - #(FullSpec - name: windowSpec - window: - (WindowSpec - label: 'Inspector2' - name: 'Inspector2' - labelChannel: windowTitleAspect - min: (Point 0 0) - bounds: (Rectangle 0 0 388 421) - menu: mainMenu - ) - component: - (SpecCollection - collection: ( - (MenuPanelSpec - name: 'ToolBar' - layout: (LayoutFrame 0 0 0 0 0 1 40 0) - backgroundChannel: toolbarBackgroundHolder - menu: toolbarMenu - textDefault: true - ) - (NoteBookViewSpec - name: 'NoteBook' - layout: (LayoutFrame 0 0 40 0 0 1 0 1) - model: tabSelectionIndexAspect - menu: tabLabelsAspect - useIndex: true - fitLastRow: false - canvas: tabViewAspect - keepCanvasAlive: true - ) + #(FullSpec + name: windowSpec + window: + (WindowSpec + label: 'Inspector2' + name: 'Inspector2' + labelChannel: windowTitleAspect + min: (Point 0 0) + bounds: (Rectangle 0 0 490 654) + menu: mainMenu + ) + component: + (SpecCollection + collection: ( + (MenuPanelSpec + name: 'ToolBar' + layout: (LayoutFrame 0 0 0 0 0 1 40 0) + backgroundChannel: toolbarBackgroundHolder + menu: toolbarMenu + textDefault: true ) - - ) - ) + (NoteBookViewSpec + name: 'NoteBook' + layout: (LayoutFrame 0 0 40 0 0 1 0 1) + model: tabSelectionIndexAspect + menu: tabLabelsAspect + useIndex: true + fitLastRow: false + canvas: tabViewAspect + keepCanvasAlive: true + ) + (ComboListSpec + name: 'EvaluationLanguageCombo' + layout: (LayoutFrame -200 1 7 0.0 -40 1 32 0) + activeHelpKey: evaluationLanguage + visibilityChannel: evaluationLanguageComboVisibleHolder + model: evaluationLanguageHolder + comboList: evaluationLanguageList + useIndex: false + postBuildCallback: postBuildEvaluationLanguageCombo: + ) + ) + + ) + ) ! ! !Inspector2 class methodsFor:'menu specs'! @@ -747,12 +796,14 @@ currentObjectHolder currentObjectHolder isNil ifTrue:[ - currentObjectHolder := ValueHolder new + currentObjectHolder := ValueHolder new. + currentObjectHolder addDependent: self. ]. ^ currentObjectHolder "Created: / 27-02-2008 / 12:05:22 / janfrog" "Created: / 19-08-2011 / 08:58:48 / cg" + "Modified: / 26-10-2013 / 00:34:54 / Jan Vrany " ! currentObjectIsFilename @@ -771,6 +822,58 @@ "Created: / 15-01-2012 / 10:06:28 / cg" ! +evaluationLanguageComboVisibleHolder + + + "/ Do not show language combo when language is Smalltalk. + "/ For those not working with multiple languages is too disturbing. + ^ BlockValue + with:[:o | o class programmingLanguage isSmalltalk not ] + argument:self currentObjectHolder + + "Modified (comment): / 25-10-2013 / 19:39:13 / Jan Vrany " +! + +evaluationLanguageHolder + + + "automatically generated by UIPainter ..." + + "*** the code below creates a default model when invoked." + "*** (which may not be the one you wanted)" + "*** Please change as required and accept it in the browser." + "*** (and replace this comment by something more useful ;-)" + + evaluationLanguageHolder isNil ifTrue:[ + evaluationLanguageHolder := ValueHolder new. +"/ if your app needs to be notified of changes, uncomment one of the lines below: + evaluationLanguageHolder addDependent:self. +"/ evaluationLanguageHolder onChangeSend:#evaluationLanguageHolderChanged to:self. + ]. + ^ evaluationLanguageHolder. + + "Modified: / 26-10-2013 / 00:43:40 / Jan Vrany " +! + +evaluationLanguageList + + + "automatically generated by UIPainter ..." + + "*** the code below creates a default model when invoked." + "*** (which may not be the one you wanted)" + "*** Please change as required and accept it in the browser." + "*** (and replace this comment by something more useful ;-)" + + evaluationLanguageList isNil ifTrue:[ + evaluationLanguageList := ValueHolder new. +"/ if your app needs to be notified of changes, uncomment one of the lines below: +"/ evaluationLanguageList addDependent:self. +"/ evaluationLanguageList onChangeSend:#evaluationLanguageListChanged to:self. + ]. + ^ evaluationLanguageList. +! + expandArraysInAllList ^ InspectorView expandArraysInAllLists @@ -874,6 +977,54 @@ "Modified: / 27-02-2008 / 12:05:56 / janfrog" ! ! +!Inspector2 methodsFor:'change & update'! + +update:something with:aParameter from:changedObject + "Invoked when an object that I depend upon sends a change notification." + + "stub code automatically generated - please change as required" + + changedObject == currentObjectHolder ifTrue:[ + self updateEvaluationLanguageList. + ^ self. + ]. + changedObject == evaluationLanguageHolder ifTrue:[ + self updateEvaluationLanguage. + ^ self. + ]. + super update:something with:aParameter from:changedObject + + "Modified: / 26-10-2013 / 00:44:02 / Jan Vrany " +! + +updateEvaluationLanguage + | evaluationLanguage | + + evaluationLanguage := self evaluationLanguageHolder value. + "/ Remember user's selection for future... + EvaluationLanguageMap at: self currentObject class programmingLanguage put: evaluationLanguage. + "/ Update compiler class in all inspectors... + self setDoItActionForLanguage: evaluationLanguage. + + "Created: / 26-10-2013 / 00:36:33 / Jan Vrany " +! + +updateEvaluationLanguageList + | currentObject currentObjectLanguage | + + currentObject := self currentObject. + currentObjectLanguage := currentObject class programmingLanguage. + currentObjectLanguage isSmalltalk ifFalse:[ + self evaluationLanguageList value: (Array with: currentObjectLanguage with: SmalltalkLanguage instance) + ] ifTrue:[ + self evaluationLanguageList value: (Array with: currentObjectLanguage). + ]. + + self evaluationLanguageHolder value:(EvaluationLanguageMap at: currentObjectLanguage ifAbsent:[currentObjectLanguage]) + + "Created: / 26-10-2013 / 00:40:37 / Jan Vrany " +! ! + !Inspector2 methodsFor:'configuration'! hideHashes:aBoolean @@ -898,6 +1049,14 @@ #todo ! ! +!Inspector2 methodsFor:'hooks'! + +postBuildEvaluationLanguageCombo: aComboBoxView +"/ aComboBoxView font: (aComboBoxView font asSize: (aComboBoxView font size * 1.5) rounded) + + "Modified: / 26-10-2013 / 01:00:30 / Jan Vrany " +! ! + !Inspector2 methodsFor:'menu'! backButtonMenuChannel @@ -1082,6 +1241,35 @@ "Created: / 15-07-2011 / 16:25:42 / cg" ! ! +!Inspector2 methodsFor:'private'! + +setDoItActionForLanguage: language + + + self currentState tabViews do:[:view | + (view respondsTo: #workspace) ifTrue:[ + view workspace doItAction: + [:theCode | + |evaluator| + + (evaluator := language evaluatorClass) + notNil ifTrue:[ + evaluator + evaluate:theCode + in:nil + receiver:self currentObject + notifying:view workspace + logged:true + ifFail:nil + ] ifFalse:[ + 'object''s class provides no evaluator' + ] + ]. + ]. + ] + + "Created: / 26-10-2013 / 01:13:15 / Jan Vrany " +! ! !Inspector2::NavigationState class methodsFor:'creating classes'! @@ -1098,11 +1286,11 @@ !Inspector2::NavigationState class methodsFor:'documentation'! version - ^'$Header: /cvs/stx/stx/libtool/Tools__Inspector2.st,v 1.43 2013-07-26 15:10:27 cg Exp $' + ^'$Header: /cvs/stx/stx/libtool/Tools__Inspector2.st,v 1.44 2014-02-05 18:56:15 cg Exp $' ! version_SVN - ^'$Id: Tools__Inspector2.st,v 1.43 2013-07-26 15:10:27 cg Exp $' + ^'$Id: Tools__Inspector2.st,v 1.44 2014-02-05 18:56:15 cg Exp $' ! ! !Inspector2::NavigationState methodsFor:'accessing'! @@ -1266,7 +1454,8 @@ initializeCommonTabs "Unfinished code" - self initializeClassBrowserTab +"/ JV@2012-04-20: Don't add class tab, only takes time and nobody uses it anyway +"/ self initializeClassBrowserTab "/ tabs add: "/ (Tools::Inspector2Tab new @@ -1277,7 +1466,7 @@ "Created: / 16-01-2008 / 16:56:48 / janfrog" "Modified: / 17-02-2008 / 10:29:54 / janfrog" - "Modified: / 21-08-2011 / 10:03:04 / Jan Vrany " + "Modified (comment): / 20-04-2012 / 20:23:55 / Jan Vrany " ! initializeExtraTabs @@ -1328,19 +1517,19 @@ !Inspector2 class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/Tools__Inspector2.st,v 1.43 2013-07-26 15:10:27 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__Inspector2.st,v 1.44 2014-02-05 18:56:15 cg Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libtool/Tools__Inspector2.st,v 1.43 2013-07-26 15:10:27 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__Inspector2.st,v 1.44 2014-02-05 18:56:15 cg Exp $' ! version_CVS_jvrany - ^ '$Header: /cvs/stx/stx/libtool/Tools__Inspector2.st,v 1.43 2013-07-26 15:10:27 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__Inspector2.st,v 1.44 2014-02-05 18:56:15 cg Exp $' ! version_SVN - ^ '$Id: Tools__Inspector2.st,v 1.43 2013-07-26 15:10:27 cg Exp $' + ^ '$Id: Tools__Inspector2.st,v 1.44 2014-02-05 18:56:15 cg Exp $' ! !