Tools__Inspector2.st
branchjv
changeset 16572 ab23beb4bba6
parent 16571 cf319f2e56d0
parent 16549 10a4b1ae8153
child 16664 ef51c9c52b52
equal deleted inserted replaced
16571:cf319f2e56d0 16572:ab23beb4bba6
    22 	poolDictionaries:''
    22 	poolDictionaries:''
    23 	category:'Interface-Inspector2'
    23 	category:'Interface-Inspector2'
    24 !
    24 !
    25 
    25 
    26 Model subclass:#NavigationState
    26 Model subclass:#NavigationState
    27 	instanceVariableNames:'theObject index tabs selectionIndex'
    27 	instanceVariableNames:'application theObject index tabs selectionIndex displayString'
    28 	classVariableNames:''
    28 	classVariableNames:''
    29 	poolDictionaries:''
    29 	poolDictionaries:''
    30 	privateIn:Inspector2
    30 	privateIn:Inspector2
    31 !
    31 !
    32 
    32 
   912 
   912 
   913 showAlphabeticalHolder
   913 showAlphabeticalHolder
   914       ^ builder booleanValueAspectFor:#showAlphabeticalHolder
   914       ^ builder booleanValueAspectFor:#showAlphabeticalHolder
   915 !
   915 !
   916 
   916 
       
   917 sortOrderHolder
       
   918       ^ builder 
       
   919             valueAspectFor:#sortOrderHolder 
       
   920             initialValue:(InspectorView defaultSortOrder) 
       
   921 !
       
   922 
   917 tabLabelsAspect
   923 tabLabelsAspect
   918     ^ (AspectAdaptor forAspect:#tabLabels) 
   924     ^ (AspectAdaptor forAspect:#tabLabels) 
   919         subjectChannel:self navigationStateAspect
   925         subjectChannel:self navigationStateAspect
   920 
   926 
   921     "Created: / 16-01-2008 / 17:29:52 / janfrog"
   927     "Created: / 16-01-2008 / 17:29:52 / janfrog"
  1040     "compatibiliy with InspectorView - must be implemented"
  1046     "compatibiliy with InspectorView - must be implemented"
  1041 
  1047 
  1042     #todo
  1048     #todo
  1043 ! !
  1049 ! !
  1044 
  1050 
  1045 
       
  1046 !Inspector2 methodsFor:'hooks'!
       
  1047 
       
  1048 postBuildEvaluationLanguageCombo: aComboBoxView
       
  1049 "/    aComboBoxView font: (aComboBoxView font asSize: (aComboBoxView font size * 1.5) rounded)
       
  1050 
       
  1051     "Modified: / 26-10-2013 / 01:00:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1052 ! !
       
  1053 
  1051 
  1054 !Inspector2 methodsFor:'menu'!
  1052 !Inspector2 methodsFor:'menu'!
  1055 
  1053 
  1056 backButtonMenuChannel
  1054 backButtonMenuChannel
  1057     ^ [ self navigationHistoryHolder goBackMenu ]
  1055     ^ [ self navigationHistoryHolder goBackMenu ]
  1209     "Modified (format): / 19-08-2011 / 09:01:20 / cg"
  1207     "Modified (format): / 19-08-2011 / 09:01:20 / cg"
  1210     "Modified: / 04-02-2015 / 15:27:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1208     "Modified: / 04-02-2015 / 15:27:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1211 !
  1209 !
  1212 
  1210 
  1213 openOn: anObject
  1211 openOn: anObject
       
  1212     self createBuilder.
  1214     self inspect: anObject.    
  1213     self inspect: anObject.    
  1215     self openWithExtent:LastExtent.
  1214     self openWithExtent:LastExtent.
  1216 
  1215 
  1217     "Modified: / 13-01-2008 / 13:55:27 / janfrog"
  1216     "Modified: / 13-01-2008 / 13:55:27 / janfrog"
  1218     "Modified: / 11-07-2011 / 22:31:42 / cg"
  1217     "Modified: / 11-07-2011 / 22:31:42 / cg"
       
  1218 !
       
  1219 
       
  1220 postBuildEvaluationLanguageCombo: aComboBoxView
       
  1221 "/    aComboBoxView font: (aComboBoxView font asSize: (aComboBoxView font size * 1.5) rounded)
       
  1222 
       
  1223     "Modified: / 26-10-2013 / 01:00:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1219 !
  1224 !
  1220 
  1225 
  1221 postBuildWith:aBuilder
  1226 postBuildWith:aBuilder
  1222     super postBuildWith:aBuilder.
  1227     super postBuildWith:aBuilder.
  1223     self updateWindowLabel.
  1228     self updateWindowLabel.
  1254 
  1259 
  1255 navigationStateFor: anObject
  1260 navigationStateFor: anObject
  1256     | current new |
  1261     | current new |
  1257 
  1262 
  1258     new := NavigationState for: anObject.
  1263     new := NavigationState for: anObject.
       
  1264     new application:self.
  1259     current := self currentState.
  1265     current := self currentState.
  1260     (current notNil "and:[anObject isKindOf: current theObject class]") ifTrue:[ 
  1266     (current notNil "and:[anObject isKindOf: current theObject class]") ifTrue:[ 
  1261         | currentTabLabel newSelectionIndex |
  1267         | currentTabLabel newSelectionIndex |
  1262 
  1268 
  1263         currentTabLabel := current tabLabels at: current selectionIndex.
  1269         currentTabLabel := current tabLabels at: current selectionIndex.
  1276     "Created: / 04-02-2015 / 15:27:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1282     "Created: / 04-02-2015 / 15:27:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1277     "Modified: / 13-02-2015 / 20:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1283     "Modified: / 13-02-2015 / 20:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1278 !
  1284 !
  1279 
  1285 
  1280 setDoItActionForLanguage: language
  1286 setDoItActionForLanguage: language
  1281 
       
  1282 
       
  1283     self currentState tabViews do:[:view | 
  1287     self currentState tabViews do:[:view | 
  1284         (view respondsTo: #workspace) ifTrue:[
  1288         (view respondsTo: #workspace) ifTrue:[
  1285             view workspace editedLanguage: language.
  1289             view workspace 
  1286             view workspace doItAction: 
  1290                 editedLanguage: language;
  1287                 [:theCode |
  1291                 doItAction: 
  1288                     |evaluator|
  1292                     [:theCode |
  1289 
  1293                         |evaluator|
  1290                     (evaluator := language evaluatorClass)
  1294 
  1291                     notNil ifTrue:[
  1295                         (evaluator := language evaluatorClass) notNil ifTrue:[
  1292                         evaluator
  1296                             evaluator
  1293                             evaluate:theCode 
  1297                                 evaluate:theCode in:nil 
  1294                             in:nil 
  1298                                 receiver:self currentObject 
  1295                             receiver:self currentObject 
  1299                                 notifying:view workspace 
  1296                             notifying:view workspace 
  1300                                 logged:true ifFail:nil
  1297                             logged:true 
  1301                         ] ifFalse:[
  1298                             ifFail:nil
  1302                             'object''s class provides no evaluator'
  1299                     ] ifFalse:[
  1303                         ]
  1300                         'object''s class provides no evaluator'
  1304                     ].
  1301                     ]
       
  1302                 ].
       
  1303         ].
  1305         ].
  1304     ]
  1306     ]
  1305 
  1307 
  1306     "Created: / 26-10-2013 / 01:13:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1308     "Created: / 26-10-2013 / 01:13:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1307     "Modified: / 10-03-2015 / 09:46:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1309     "Modified: / 10-03-2015 / 09:46:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1328 version_SVN
  1330 version_SVN
  1329     ^'$Id$'
  1331     ^'$Id$'
  1330 ! !
  1332 ! !
  1331 
  1333 
  1332 !Inspector2::NavigationState methodsFor:'accessing'!
  1334 !Inspector2::NavigationState methodsFor:'accessing'!
       
  1335 
       
  1336 application
       
  1337     ^ application
       
  1338 !
       
  1339 
       
  1340 application:anInspectorApp
       
  1341     application := anInspectorApp.
       
  1342 !
  1333 
  1343 
  1334 index
  1344 index
  1335     ^ index
  1345     ^ index
  1336 !
  1346 !
  1337 
  1347 
  1428 initializeTab: selector
  1438 initializeTab: selector
  1429     "Initializes a extra tab specified by given selector"
  1439     "Initializes a extra tab specified by given selector"
  1430 
  1440 
  1431     | tab |
  1441     | tab |
  1432 
  1442 
  1433     tab := [ theObject perform: selector ] 
  1443     tab := 
  1434                 on: Error 
  1444         [ theObject perform: selector ] 
  1435                 do:[:ex|
  1445             on: Error 
  1436                     "/ for debugging:  
  1446             do:[:ex|
  1437                     "/ ex reject.
  1447                 "/ for debugging:  
  1438                     Transcript show:'error in inspector setup: ',ex description.    
  1448                 "/ ex reject.
  1439                     Tools::Inspector2Tab new 
  1449                 Transcript show:'error in inspector setup: ',ex description.    
  1440                         label: selector;
  1450                 Tools::Inspector2Tab new
  1441                         text:
  1451                     application:application;
  1442                             (ex description, Character cr, Character cr,
  1452                     label: selector;
  1443                              ex suspendedContext fullPrintAllString)
  1453                     text:
  1444                 ].
  1454                         (ex description, Character cr, Character cr,
       
  1455                          ex suspendedContext fullPrintAllString)
       
  1456             ].
  1445     (tab notNil and:[tab isKindOf: Tools::Inspector2Tab]) ifTrue:[
  1457     (tab notNil and:[tab isKindOf: Tools::Inspector2Tab]) ifTrue:[
  1446         tabs add: tab
  1458         tabs add: tab.
       
  1459         (tab view respondsTo:#sortOrderHolder) ifTrue:[ 
       
  1460             tab view sortOrderHolder:(application sortOrderHolder)
       
  1461         ].
  1447     ]
  1462     ]
  1448 
  1463 
  1449     "Created: / 03-02-2015 / 11:03:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1464     "Created: / 03-02-2015 / 11:03:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1450 !
  1465 !
  1451 
  1466