Faculty of Information Technology
Software Engineering Group

Ticket #120: libtool_fix_1_of_1_rev_9f54cb54204c_Issue__120__Fixed_regression_with_Inspector2_not_showing_custom_presentations.patch

File libtool_fix_1_of_1_rev_9f54cb54204c_Issue__120__Fixed_regression_with_Inspector2_not_showing_custom_presentations.patch, 7.4 KB (added by Jan Vrany, 3 years ago)
  • Tools__Inspector2.st

    # HG changeset patch
    # User Jan Vrany <jan.vrany@fit.cvut.cz>
    # Date 1486634207 0
    #      Thu Feb 09 09:56:47 2017 +0000
    # Branch jv
    # Node ID 9f54cb54204c6a6b75f65f7ab9bc90cc6cac932a
    # Parent  a294c60caf42b68bfcbb6fd4a7623f5354e48200
    Issue #120: Fixed regression with Inspector2 not showing custom presentations
    
    The cause was misuse and inconsistence between #application:, #applicationHolder:,
    introduced by following commit:
    
      * 9ff9bed9f98e: #OTHER by stefan
    
    This commit cleans up a lot of code, making it simpler. Also fixes
    the regression.
    
    https://swing.fit.cvut.cz/projects/stx-jv/ticket/120
    
    diff -r a294c60caf42 -r 9f54cb54204c Tools__Inspector2.st
    a b  
    2424!
    2525
    2626Model subclass:#NavigationState
    27         instanceVariableNames:'application theObject index tabs selectionIndex displayString'
     27        instanceVariableNames:'inspector theObject index tabs selectionIndex displayString'
    2828        classVariableNames:''
    2929        poolDictionaries:''
    3030        privateIn:Inspector2
     
    13051305    | current new |
    13061306
    13071307    new := NavigationState for: anObject.
    1308     new application:self.
     1308    new inspector:self.
    13091309    current := self currentState.
    13101310    (current notNil "and:[anObject isKindOf: current theObject class]") ifTrue:[
    13111311        | currentTabLabel newSelectionIndex |
     
    13241324    ^ new
    13251325
    13261326    "Created: / 04-02-2015 / 15:27:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1327     "Modified: / 13-02-2015 / 20:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     1327    "Modified: / 09-02-2017 / 09:27:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    13281328!
    13291329
    13301330setDoItActionForLanguage: language
     
    13531353    "Modified: / 10-03-2015 / 09:46:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    13541354! !
    13551355
    1356 
    13571356!Inspector2::NavigationState class methodsFor:'creating classes'!
    13581357
    13591358for:anObject
     
    13781377
    13791378!Inspector2::NavigationState methodsFor:'accessing'!
    13801379
    1381 application
    1382     ^ application
    1383 !
    1384 
    13851380application:anInspectorApp
    1386     application := anInspectorApp.
     1381    <resource: #obsolete>
     1382    inspector := anInspectorApp.
    13871383!
    13881384
    13891385index
     
    13941390    index := something.
    13951391!
    13961392
     1393inspector
     1394    ^ inspector
     1395
     1396    "Created: / 09-02-2017 / 09:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     1397!
     1398
     1399inspector:anInspectorApp
     1400    inspector := anInspectorApp.
     1401
     1402    "Created: / 09-02-2017 / 09:27:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     1403!
     1404
    13971405selectionIndex
    13981406    selectionIndex isNil ifTrue:[^1].
    13991407    selectionIndex < 1 ifTrue:[^1].
     
    14881496            "kludge for ProtoObject, which does neither implement this selector
    14891497             nor #perform:"
    14901498            tab := Tools::Inspector2Tab new
     1499                        inspector: inspector;
    14911500                        priority: 90;
    14921501                        label:'Basic';
    14931502                        view: (InspectorView new inspect:theObject);
     
    15001509        "/ ex reject.
    15011510        Logger error:'inspector setup: %1' with:ex description.   
    15021511        tab := Tools::Inspector2Tab new
    1503             application:application;
     1512            inspector: inspector;
    15041513            label:selector;
    15051514            text:(ex description, Character cr, Character cr,
    15061515                  ex suspendedContext fullPrintAllString)
     
    15081517
    15091518    (tab isKindOf:Tools::Inspector2Tab) ifTrue:[
    15101519        tabs add: tab.
    1511         tab
    1512             application:application;
    1513             setupView.
     1520        tab inspector: inspector.           
    15141521    ]
    15151522
    15161523    "Created: / 03-02-2015 / 11:03:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  • Tools__Inspector2Tab.st

    diff -r a294c60caf42 -r 9f54cb54204c Tools__Inspector2Tab.st
    a b  
    1414"{ NameSpace: Tools }"
    1515
    1616Object subclass:#Inspector2Tab
    17         instanceVariableNames:'label view application priority viewHolder applicationHolder'
     17        instanceVariableNames:'inspector label view application priority'
    1818        classVariableNames:''
    1919        poolDictionaries:''
    2020        category:'Interface-Inspector2'
     
    8686    ^ self new
    8787            priority: 0;
    8888            label:label;
    89             viewHolder: makeView;
     89            view: makeView;
    9090            yourself
    9191
    9292    "
    9393     GenericToolbarIconLibrary systemBrowserIcon inspect
    9494    "
     95
     96    "Modified: / 09-02-2017 / 00:33:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    9597! !
    9698
    9799!Inspector2Tab methodsFor:'accessing'!
    98100
    99 application
    100     ^ application
    101 
    102     "Created: / 16-01-2008 / 16:51:05 / janfrog"
    103 !
    104 
    105 application:anApplicationModelOrBlock
    106     application := anApplicationModelOrBlock.
     101application:anApplicationModelOrBlockOrValueModel
     102    view := [
     103        ApplicationSubView new
     104            client: anApplicationModelOrBlockOrValueModel value;
     105            yourself
     106    ].
    107107
    108108    "Created: / 16-01-2008 / 16:51:05 / janfrog"
    109109    "Modified: / 17-02-2008 / 08:58:34 / janfrog"
     110    "Modified: / 09-02-2017 / 09:23:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    110111!
    111112
    112 applicationHolder:something
    113     applicationHolder := something.
     113applicationHolder:aValueModelOrBlock
     114    <resource: #obsolete> "/ use #application:
     115    self application: aValueModelOrBlock
     116
     117    "Modified: / 09-02-2017 / 09:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     118!
     119
     120inspector: anInspector2
     121    inspector := anInspector2
     122
     123    "Created: / 09-02-2017 / 00:53:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    114124!
    115125
    116126label
     
    148158
    149159view
    150160    view isNil ifTrue:[
    151         viewHolder notNil ifTrue:[
    152             view := viewHolder value
    153         ] ifFalse:[
    154             applicationHolder notNil ifTrue:[
    155                 view := ApplicationSubView new.
    156                 view client: applicationHolder value.
    157             ]
     161        application notNil ifTrue:[
     162            view := ApplicationSubView new.
     163            view client: application value.
    158164        ]
     165    ] ifFalse:[
     166        view isBlock ifTrue:[
     167            view := view value.
     168        ].
    159169    ].
     170    self setupView.
    160171    ^ view
    161172
    162173    "Created: / 16-01-2008 / 16:51:05 / janfrog"
    163174    "Modified: / 17-02-2008 / 10:38:59 / janfrog"
    164175    "Modified: / 13-06-2012 / 14:57:25 / cg"
    165     "Modified: / 24-03-2014 / 18:25:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     176    "Modified: / 09-02-2017 / 09:24:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    166177!
    167178
    168 view:aViewOrBlock
    169     aViewOrBlock isBlock ifTrue:[
    170         viewHolder := aViewOrBlock
    171     ] ifFalse:[
    172         view := aViewOrBlock.
    173     ]
     179view:aViewOrBlockOrValueModel
     180    view := aViewOrBlockOrValueModel.
     181
    174182
    175183    "Created: / 16-01-2008 / 16:51:05 / janfrog"
    176184    "Modified: / 17-02-2008 / 08:58:46 / janfrog"
    177185    "Modified: / 21-05-2015 / 21:31:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    178186!
    179187
    180 viewHolder:something
    181     viewHolder := something.
     188viewHolder:aValueModelOrBlock
     189    <resource: #obsolete> "/ use #view:
     190    self view: aValueModelOrBlock
     191
     192    "Modified: / 09-02-2017 / 09:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    182193!
    183194
    184195viewOrNil
     
    193204
    194205    (view respondsTo:#setMasterInspectorApplication:) ifTrue:[
    195206        "this is for BridgeOjectInspectorView"
    196         view setMasterInspectorApplication:application.
     207        view setMasterInspectorApplication:inspector.
    197208    ].
    198209    (view respondsTo:#sortOrderHolder:) ifTrue:[
    199         view sortOrderHolder:(application sortOrderHolder)
     210        view sortOrderHolder:(inspector sortOrderHolder)
    200211    ].
     212
     213    "Modified: / 09-02-2017 / 09:24:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    201214! !
    202215
    203216!Inspector2Tab class methodsFor:'documentation'!