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| |
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 ]. |