BrowserView.st
changeset 2349 7a106d001d6c
parent 2348 b4fd9d8bb6dc
child 2350 805ad1edff78
equal deleted inserted replaced
2348:b4fd9d8bb6dc 2349:7a106d001d6c
  1922 !
  1922 !
  1923 
  1923 
  1924 classCategoryUpdate
  1924 classCategoryUpdate
  1925     "update class category list and dependants"
  1925     "update class category list and dependants"
  1926 
  1926 
  1927     |oldClassName oldMethodCategory|
  1927     |oldClass oldClassName oldMethodCategory newClass|
  1928 
  1928 
  1929     classCategoryListView notNil ifTrue:[
  1929     classCategoryListView notNil ifTrue:[
  1930 	self setListOfNamespaces.
  1930         self setListOfNamespaces.
  1931 
  1931 
  1932 	currentClass notNil ifTrue:[
  1932         (oldClass := currentClass) notNil ifTrue:[
  1933 	    oldClassName := currentClass name.
  1933             oldClassName := currentClass name.
  1934 	    (oldClassName endsWith:'-old') ifTrue:[
  1934             (oldClassName endsWith:'-old') ifTrue:[
  1935 		oldClassName := oldClassName copyWithoutLast:4 "copyTo:(oldClassName size - 4)"
  1935                 oldClassName := oldClassName copyWithoutLast:4 "copyTo:(oldClassName size - 4)"
  1936 	    ]
  1936             ]
  1937 	].
  1937         ].
  1938 	oldMethodCategory := currentMethodCategory.
  1938         oldMethodCategory := currentMethodCategory.
  1939 
  1939 
  1940 	classCategoryListView setContents:(self listOfAllClassCategories).
  1940         classCategoryListView setContents:(self listOfAllClassCategories).
  1941 	currentClassCategory notNil ifTrue:[
  1941         currentClassCategory notNil ifTrue:[
  1942 	    classCategoryListView setSelectElement:currentClassCategory.
  1942             classCategoryListView setSelectElement:currentClassCategory.
  1943 	    self classCategorySelectionChanged.
  1943             self classCategorySelectionChanged.
  1944 	    oldClassName notNil ifTrue:[
  1944             oldClassName notNil ifTrue:[
  1945 		classListView setSelectElement:oldClassName.
  1945                 classListView setSelectElement:oldClassName.
  1946 		self changeCurrentClass:(Smalltalk at:oldClassName asSymbol).
  1946                 oldClass isJavaClass ifTrue:[
  1947 		self classSelectionChanged.
  1947                     newClass := (Java at:oldClassName).
  1948 		oldMethodCategory notNil ifTrue:[
  1948                 ] ifFalse:[
  1949 		    methodCategoryListView setSelectElement:oldMethodCategory.
  1949                     newClass := (Smalltalk at:oldClassName asSymbol).
  1950 		    currentMethodCategory := oldMethodCategory.
  1950                 ].
  1951 		    self methodCategorySelectionChanged
  1951                 newClass isNil ifTrue:[
  1952 		]
  1952                     self warn:'oops - ' , oldClassName , ' is gone.'.
  1953 	    ]
  1953                 ] ifFalse:[
  1954 	].
  1954                     self changeCurrentClass:newClass.
  1955 
  1955                     self classSelectionChanged.
  1956 	self updateNamespaceList
  1956                     oldMethodCategory notNil ifTrue:[
       
  1957                         methodCategoryListView setSelectElement:oldMethodCategory.
       
  1958                         currentMethodCategory := oldMethodCategory.
       
  1959                         self methodCategorySelectionChanged
       
  1960                     ]
       
  1961                 ]
       
  1962             ]
       
  1963         ].
       
  1964 
       
  1965         self updateNamespaceList
  1957     ]
  1966     ]
  1958 
  1967 
  1959     "Modified: / 10.4.1998 / 12:25:38 / cg"
  1968     "Modified: / 10.4.1998 / 12:25:38 / cg"
  1960 ! !
  1969 ! !
  1961 
  1970 
  2871                         "/ class redefines comment ?
  2880                         "/ class redefines comment ?
  2872                         s := nil
  2881                         s := nil
  2873                     ]
  2882                     ]
  2874                 ].
  2883                 ].
  2875             ].
  2884             ].
  2876             aStream cr; cr; cr; cr; cr.
  2885             cls isJavaClass ifFalse:[
  2877             aStream emphasis:(self commentEmphasisAndColor).
  2886                 aStream cr; cr; cr; cr; cr.
  2878             s isNil ifTrue:[
  2887                 aStream emphasis:(self commentEmphasisAndColor).
  2879                 aStream nextPut:$" ; cr; nextPutLine:' no comment or documentation method found'.
  2888                 s isNil ifTrue:[
  2880             ] ifFalse:[
  2889                     aStream nextPut:$" ; cr; nextPutLine:' no comment or documentation method found'.
  2881                 aStream nextPut:$" ; cr; nextPutLine:' Documentation:'.
  2890                 ] ifFalse:[
  2882                 aStream cr; nextPutLine:s; cr.
  2891                     aStream nextPut:$" ; cr; nextPutLine:' Documentation:'.
  2883                 aStream nextPutLine:' Notice: '.
  2892                     aStream cr; nextPutLine:s; cr.
  2884                 aStream nextPutAll:'   the above text has been extracted from the classes '.
  2893                     aStream nextPutLine:' Notice: '.
  2885                 aStream nextPutLine:(isComment ifTrue:['comment.'] ifFalse:['documentation method.']).
  2894                     aStream nextPutAll:'   the above text has been extracted from the classes '.
  2886                 aStream nextPutLine:'   Any change in it will be lost if you ''accept'' here.'.
  2895                     aStream nextPutLine:(isComment ifTrue:['comment.'] ifFalse:['documentation method.']).
  2887                 aStream nextPutAll:'   To change the '.
  2896                     aStream nextPutLine:'   Any change in it will be lost if you ''accept'' here.'.
  2888                 aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation']).
  2897                     aStream nextPutAll:'   To change the '.
  2889                 aStream nextPutAll:', switch to the '.
  2898                     aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation']).
  2890                 aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation method']).
  2899                     aStream nextPutAll:', switch to the '.
  2891                 aStream nextPutLine:' and ''accept'' any changes there.'.
  2900                     aStream nextPutAll:(isComment ifTrue:['comment'] ifFalse:['documentation method']).
  2892             ].
  2901                     aStream nextPutLine:' and ''accept'' any changes there.'.
  2893             aStream nextPut:$".
  2902                 ].
  2894             aStream emphasis:nil.
  2903                 aStream nextPut:$".
       
  2904                 aStream emphasis:nil.
       
  2905             ]
  2895         ].
  2906         ].
  2896 
  2907 
  2897         src := aStream contents.
  2908         src := aStream contents.
  2898         UserPreferences current syntaxColoring ifTrue:[
  2909         UserPreferences current syntaxColoring ifTrue:[
  2899             highlighter := cls syntaxHighlighterClass.
  2910             highlighter := cls syntaxHighlighterClass.
 12134 !
 12145 !
 12135 
 12146 
 12136 setAcceptActionForClass
 12147 setAcceptActionForClass
 12137     "tell the codeView what to do on accept and explain"
 12148     "tell the codeView what to do on accept and explain"
 12138 
 12149 
       
 12150     currentClass isJavaClass ifTrue:[
       
 12151         ^ self setAcceptActionForJavaClass.
       
 12152     ].
       
 12153 
 12139     (currentClass isNamespace and:[currentClass ~~ Smalltalk]) ifTrue:[
 12154     (currentClass isNamespace and:[currentClass ~~ Smalltalk]) ifTrue:[
 12140         codeView acceptAction:nil
 12155         codeView acceptAction:nil
 12141     ] ifFalse:[
 12156     ] ifFalse:[
 12142         codeView acceptAction:[:theCode |
 12157         codeView acceptAction:[:theCode |
 12143             |ns|
 12158             |ns|
 12213             codeView cursor:Cursor normal.
 12228             codeView cursor:Cursor normal.
 12214         ].
 12229         ].
 12215     ]
 12230     ]
 12216 
 12231 
 12217     "Modified: / 17.6.1998 / 11:39:02 / cg"
 12232     "Modified: / 17.6.1998 / 11:39:02 / cg"
       
 12233 !
       
 12234 
       
 12235 setAcceptActionForJavaClass
       
 12236     "tell the codeView what to do on accept and explain"
       
 12237 
       
 12238     self setAcceptActionForNewJavaClass 
 12218 !
 12239 !
 12219 
 12240 
 12220 setAcceptActionForNewClass
 12241 setAcceptActionForNewClass
 12221     "tell the codeView what to do on accept and explain"
 12242     "tell the codeView what to do on accept and explain"
 12222 
 12243 
 12270                 cls isBehavior ifTrue:[
 12291                 cls isBehavior ifTrue:[
 12271                     codeView modified:false.
 12292                     codeView modified:false.
 12272                     self classCategoryUpdate.
 12293                     self classCategoryUpdate.
 12273                     self updateClassListWithScroll:false.
 12294                     self updateClassListWithScroll:false.
 12274                     self switchToClassNamed:(cls name).
 12295                     self switchToClassNamed:(cls name).
       
 12296                     self updateCodeView.
 12275                 ]
 12297                 ]
 12276             ]
 12298             ]
 12277         ].
 12299         ].
 12278         codeView cursor:(Cursor normal).
 12300         codeView cursor:(Cursor normal).
 12279     ].
 12301     ].
 13813 ! !
 13835 ! !
 13814 
 13836 
 13815 !BrowserView class methodsFor:'documentation'!
 13837 !BrowserView class methodsFor:'documentation'!
 13816 
 13838 
 13817 version
 13839 version
 13818     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.543 1999-08-20 13:43:39 cg Exp $'
 13840     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.544 1999-08-20 14:20:59 cg Exp $'
 13819 ! !
 13841 ! !
 13820 BrowserView initialize!
 13842 BrowserView initialize!