BrowserView.st
changeset 3579 363b8d49d0cf
parent 3578 d92a384c03d9
child 3582 27b7e3482d29
equal deleted inserted replaced
3578:d92a384c03d9 3579:363b8d49d0cf
  8998 
  8998 
  8999     codeMenu notNil ifTrue:[
  8999     codeMenu notNil ifTrue:[
  9000         m subMenuAt:#codeMenu put:codeMenu.
  9000         m subMenuAt:#codeMenu put:codeMenu.
  9001     ].
  9001     ].
  9002 
  9002 
  9003     self environment ~~ Smalltalk ifTrue:[
  9003     self isSimulatedEnvironment ifTrue:[
  9004         m disableAll:#(methodCategoryNewCategory methodCategoryCreateAccessMethods methodCategoryRemove
  9004         m disableAll:#(methodCategoryNewCategory methodCategoryCreateAccessMethods methodCategoryRemove
  9005                        methodCategoryRename codeMenu methodCategoryCopyCategory
  9005                        methodCategoryRename codeMenu methodCategoryCopyCategory
       
  9006                        methodCategorySpawnCategory 
  9006                       )
  9007                       )
  9007     ].
  9008     ].
  9008 
  9009 
  9009     ^ m
  9010     ^ m
  9010 
  9011 
  9669         openOn:codeView contents asString string
  9670         openOn:codeView contents asString string
  9670         label:(resources string:'code here')
  9671         label:(resources string:'code here')
  9671         and:method source asString string
  9672         and:method source asString string
  9672         label:'method compare'.      
  9673         label:'method compare'.      
  9673     v label:'comparing with ' , className , ' ' , methodName.
  9674     v label:'comparing with ' , className , ' ' , methodName.
       
  9675 
       
  9676     "Modified: 7.11.1996 / 18:53:55 / cg"
       
  9677 !
       
  9678 
       
  9679 methodCompareSourceAgainstCurrent
       
  9680     "compare with some other methods source"
       
  9681 
       
  9682     |prev v classAndMethod words className methodName 
       
  9683      meta class method codeHere codeRemote selector|
       
  9684 
       
  9685     self checkMethodSelected ifFalse:[^ self].
       
  9686     class := currentMethod mclass.
       
  9687     selector := currentMethod selector.
       
  9688 
       
  9689     codeHere := ((Smalltalk at:(class name asSymbol)) compiledMethodAt:selector) source.
       
  9690     codeRemote := currentMethod source.
       
  9691 
       
  9692     v := DiffTextView 
       
  9693         openOn:codeHere asString string
       
  9694         label:(resources string:'method here')
       
  9695         and:codeRemote asString string
       
  9696         label:'method remote'.      
       
  9697     v label:'comparing with local version'.
  9674 
  9698 
  9675     "Modified: 7.11.1996 / 18:53:55 / cg"
  9699     "Modified: 7.11.1996 / 18:53:55 / cg"
  9676 !
  9700 !
  9677 
  9701 
  9678 methodCompareWithPreviousVersion
  9702 methodCompareWithPreviousVersion
 10043     <resource: #programMenu >
 10067     <resource: #programMenu >
 10044     <resource: #keyboard ( #Cmds #Cmdi #Cmdg #Cmdt #Cmda #Ctrl) >
 10068     <resource: #keyboard ( #Cmds #Cmdi #Cmdg #Cmdt #Cmda #Ctrl) >
 10045 
 10069 
 10046     |specialMenu m items
 10070     |specialMenu m items
 10047      newItems brkItems fileItems mthdItems
 10071      newItems brkItems fileItems mthdItems
 10048      searchItems sepLocalItems sepMthdItems localSearchItems|
 10072      searchItems sepLocalItems sepMthdItems|
 10049 
 10073 
 10050     currentMethod notNil ifTrue:[
 10074     currentMethod notNil ifTrue:[
 10051         currentMethod isCountingMemoryUsage ifTrue:[
 10075         currentMethod isCountingMemoryUsage ifTrue:[
 10052             brkItems := #(
 10076             brkItems := #(
 10053                                 ('-'               nil)
 10077                                 ('-'               nil)
 10098                     ]
 10122                     ]
 10099                 ]
 10123                 ]
 10100             ]
 10124             ]
 10101         ].
 10125         ].
 10102 
 10126 
 10103         currentMethod isJavaMethod ifTrue:[
 10127         self isSimulatedEnvironment ifTrue:[
       
 10128             brkItems := #().
       
 10129             items := #(
       
 10130                             ('Compare against...'        methodCompareSource  )
       
 10131                             ('Compare against current'   methodCompareSourceAgainstCurrent  )
       
 10132                             ('Inspect Method'            methodInspect        )
       
 10133                       ).
       
 10134         ] ifFalse:[
 10104             items := #(
 10135             items := #(
 10105                             ('Compare against...'        methodCompareSource  )
 10136                             ('Compare against...'        methodCompareSource  )
 10106                             ('Inspect Method'            methodInspect        )
 10137                             ('Inspect Method'            methodInspect        )
       
 10138                       ).
       
 10139         ].
       
 10140 
       
 10141         currentMethod isJavaMethod ifTrue:[
       
 10142             items := items , #(
 10107                             ('Decompile'                 methodDecompile      )
 10143                             ('Decompile'                 methodDecompile      )
 10108                             ('-'                         nil                  )
 10144                             ('-'                         nil                  )
 10109                             ('Flush code'                methodFlushCode      )
 10145                             ('Flush code'                methodFlushCode      )
 10110                        ).
 10146                        ).
 10111             items := items , brkItems.
       
 10112 
       
 10113         ] ifFalse:[
 10147         ] ifFalse:[
 10114 
 10148 
 10115             items := #(
 10149             items := items , #(
 10116                             ('Compare against...'        methodCompareSource  )
       
 10117                             ('Inspect Method'            methodInspect        )
       
 10118                             ('stc-compile'               methodSTCCompile     )
 10150                             ('stc-compile'               methodSTCCompile     )
 10119                             ('Decompile'                 methodDecompile      )
 10151                             ('Decompile'                 methodDecompile      )
 10120                             ('-'                         nil                  )
 10152                             ('-'                         nil                  )
 10121                             ('Package...'                methodModifyPackage  )
 10153                             ('Package...'                methodModifyPackage  )
 10122                        ).
 10154                        ).
 10137                               ('-'             nil          )
 10169                               ('-'             nil          )
 10138                           )
 10170                           )
 10139                           , items.
 10171                           , items.
 10140             ].
 10172             ].
 10141 
 10173 
 10142             items := items , brkItems.
 10174         ].
 10143         ].
 10175         items := items , brkItems.
 10144 
 10176 
 10145         specialMenu := PopUpMenu itemList:items resources:resources.
 10177         specialMenu := PopUpMenu itemList:items resources:resources.
 10146 
 10178 
 10147         currentClass owningClass notNil ifTrue:[
 10179         currentClass owningClass notNil ifTrue:[
 10148             specialMenu disable:#methodModifyPackage
 10180             specialMenu disable:#methodModifyPackage
 14921 ! !
 14953 ! !
 14922 
 14954 
 14923 !BrowserView class methodsFor:'documentation'!
 14955 !BrowserView class methodsFor:'documentation'!
 14924 
 14956 
 14925 version
 14957 version
 14926     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.712 2002-02-18 16:21:45 cg Exp $'
 14958     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.713 2002-02-18 17:31:17 cg Exp $'
 14927 ! !
 14959 ! !
 14928 BrowserView initialize!
 14960 BrowserView initialize!