Tools__TagsBrowser.st
changeset 10766 eaaed81115db
parent 10765 9f7805ebbad2
child 10768 dcbc7f03c1a0
equal deleted inserted replaced
10765:9f7805ebbad2 10766:eaaed81115db
    73 'Show only Functions (see Popup Menu for more Options)'
    73 'Show only Functions (see Popup Menu for more Options)'
    74 
    74 
    75     )
    75     )
    76 
    76 
    77     "Created: / 06-10-2011 / 12:04:51 / cg"
    77     "Created: / 06-10-2011 / 12:04:51 / cg"
       
    78 !
       
    79 
       
    80 helpSpec
       
    81     "This resource specification was automatically generated
       
    82      by the UIHelpTool of ST/X."
       
    83 
       
    84     "Do not manually edit this!! If it is corrupted,
       
    85      the UIHelpTool may not be able to read the specification."
       
    86 
       
    87     "
       
    88      UIHelpTool openOnClass:Tools::TagsBrowser    
       
    89     "
       
    90 
       
    91     <resource: #help>
       
    92 
       
    93     ^ super helpSpec addPairsFrom:#(
       
    94 
       
    95 #functionsOnly
       
    96 ''
       
    97 
       
    98 )
    78 ! !
    99 ! !
    79 
   100 
    80 !TagsBrowser class methodsFor:'interface specs'!
   101 !TagsBrowser class methodsFor:'interface specs'!
    81 
   102 
    82 windowSpec
   103 windowSpec
   977             activeHelpKey: functionsOnly
   998             activeHelpKey: functionsOnly
   978             label: 'FunctionsOnly'
   999             label: 'FunctionsOnly'
   979             itemValue: functionsOnly:
  1000             itemValue: functionsOnly:
   980             translateLabel: true
  1001             translateLabel: true
   981             isButton: true
  1002             isButton: true
   982             indication: functionsOnly
  1003             indication: functionsOnlyHolder
   983             labelImage: (ResourceRetriever ToolbarIconLibrary functionsOnly16x16Icon)
  1004             labelImage: (ResourceRetriever ToolbarIconLibrary functionsOnly16x16Icon)
   984           )
  1005           )
   985          )
  1006          )
   986         nil
  1007         nil
   987         nil
  1008         nil
  1126 functionsOnly
  1147 functionsOnly
  1127     ^ tagList functionsOnly
  1148     ^ tagList functionsOnly
  1128 !
  1149 !
  1129 
  1150 
  1130 functionsOnly:aBool
  1151 functionsOnly:aBool
       
  1152     self functionsOnlyHolder value:aBool.
  1131     aBool ifTrue:[
  1153     aBool ifTrue:[
  1132         tagList hideFunctions:false.
  1154         tagList hideFunctions:false.
  1133     ].
  1155     ].
  1134     tagList functionsOnly:aBool.
  1156     tagList functionsOnly:aBool.
  1135     self updateTagList
  1157     self updateTagList
       
  1158 
       
  1159     "Modified: / 06-10-2011 / 14:03:45 / cg"
  1136 !
  1160 !
  1137 
  1161 
  1138 hideClasses
  1162 hideClasses
  1139     ^ tagList hideClasses
  1163     ^ tagList hideClasses
  1140 !
  1164 !
  1837     "Created: / 07-05-2011 / 15:38:20 / cg"
  1861     "Created: / 07-05-2011 / 15:38:20 / cg"
  1838 ! !
  1862 ! !
  1839 
  1863 
  1840 !TagsBrowser methodsFor:'menu actions'!
  1864 !TagsBrowser methodsFor:'menu actions'!
  1841 
  1865 
       
  1866 keepingSelectionDo:aBlock
       
  1867     |oldSelection oldLabel|
       
  1868 
       
  1869     oldSelection := tagView selectionValue.
       
  1870     aBlock value.
       
  1871 
       
  1872     oldSelection notNil ifTrue:[ 
       
  1873         oldLabel := oldSelection label.
       
  1874         tagView selectElementForWhich:[:el | el label = oldLabel] ifAbsent:[self halt].
       
  1875     ].
       
  1876 
       
  1877     "Created: / 06-10-2011 / 13:41:57 / cg"
       
  1878 !
       
  1879 
  1842 middleButtonMenu
  1880 middleButtonMenu
  1843     ^ [ 
  1881     ^ [ 
  1844         |menu suffix file item|
  1882         |menu suffix file item|
  1845 
  1883 
  1846         menus isNil ifTrue:[
  1884         menus isNil ifTrue:[
  1888         menu
  1926         menu
  1889       ]
  1927       ]
  1890 !
  1928 !
  1891 
  1929 
  1892 sortByLineNumber
  1930 sortByLineNumber
  1893     tagList sortedByLineNumber:true.
  1931     self keepingSelectionDo:[
  1894     self sortIsByName value:false.
  1932         tagList sortedByLineNumber:true.
  1895     self sortIsByLineNumber value:true.
  1933         self sortIsByName value:false.
       
  1934         self sortIsByLineNumber value:true.
       
  1935     ]
  1896 
  1936 
  1897     "Created: / 03-08-2011 / 11:04:51 / cg"
  1937     "Created: / 03-08-2011 / 11:04:51 / cg"
  1898 !
  1938 !
  1899 
  1939 
  1900 sortByName
  1940 sortByName
  1901     tagList sortedByNameIgnoringLeadingUnderscoresAndCase: "sortedByName:" true.
  1941     self keepingSelectionDo:[
  1902     self sortIsByLineNumber value:false.
  1942         tagList sortedByNameIgnoringLeadingUnderscoresAndCase: "sortedByName:" true.
  1903     self sortIsByName value:true.
  1943         self sortIsByLineNumber value:false.
       
  1944         self sortIsByName value:true.
       
  1945     ].
  1904 
  1946 
  1905     "Created: / 03-08-2011 / 11:04:37 / cg"
  1947     "Created: / 03-08-2011 / 11:04:37 / cg"
  1906 !
  1948 !
  1907 
  1949 
  1908 updateTagList
  1950 updateTagList
  1909     "reload tags
  1951     "reload tags
  1910     "
  1952     "
  1911 
  1953 
  1912     |file target|
  1954     |file target oldSelection|
  1913 
  1955 
  1914     (true "(self tagsVisibilityHolder value == true)"
  1956     (true "(self tagsVisibilityHolder value == true)"
  1915         and:[(file := self editedFile) notNil
  1957         and:[(file := self editedFile) notNil
  1916         and:[tagList supportsFile:file]]
  1958         and:[tagList supportsFile:file]]
  1917     ) ifTrue:[
  1959     ) ifTrue:[
  1918         (target := self buildTarget) notNil ifTrue:[
  1960         (target := self buildTarget) notNil ifTrue:[
  1919             (target isRemote and:[self tagsRemoteHolder value]) ifFalse:[
  1961             (target isRemote and:[self tagsRemoteHolder value]) ifFalse:[
  1920                 target := nil
  1962                 target := nil
  1921             ]
  1963             ]
  1922         ].
  1964         ].
  1923         tagView generateTagsFor:file onTarget:target
  1965         oldSelection := tagView selectionValue.
       
  1966         tagView generateTagsFor:file onTarget:target 
       
  1967                 finally:[
       
  1968                     |oldLabel|
       
  1969 
       
  1970                     oldSelection notNil ifTrue:[ 
       
  1971                         oldLabel := oldSelection label.
       
  1972                         tagView selectElementForWhich:[:el | el label = oldLabel] ifAbsent:[self halt].
       
  1973                     ].
       
  1974                 ].
  1924     ] ifFalse:[
  1975     ] ifFalse:[
  1925         tagView stopGeneratingTags
  1976         tagView stopGeneratingTags.
  1926     ].
  1977         tagView clearList.
  1927 
  1978     ].
  1928     "Modified: / 07-05-2011 / 11:50:50 / cg"
  1979 
       
  1980     "Modified: / 06-10-2011 / 14:05:30 / cg"
  1929 ! !
  1981 ! !
  1930 
  1982 
  1931 !TagsBrowser methodsFor:'startup & release'!
  1983 !TagsBrowser methodsFor:'startup & release'!
  1932 
  1984 
  1933 cloneWith:anApplication
  1985 cloneWith:anApplication
  2078     ]
  2130     ]
  2079 ! !
  2131 ! !
  2080 
  2132 
  2081 !TagsBrowser::TagView methodsFor:'generating tags'!
  2133 !TagsBrowser::TagView methodsFor:'generating tags'!
  2082 
  2134 
  2083 generateTagsFor:aFile onTarget:aTarget
  2135 generateTagsFor:aFile onTarget:aTarget finally:aBlock
  2084     "generate tags for a file (optionally on a remote target)
  2136     "generate tags for a file (optionally on a remote target)
  2085     "
  2137     "
  2086     |tagFile|
  2138     |tagFile|
  2087 
  2139 
  2088     Tag autoload.
  2140     Tag autoload.
  2127                     bestTag notNil ifTrue:[
  2179                     bestTag notNil ifTrue:[
  2128                         self setSelection:(list identityIndexOf:bestTag).
  2180                         self setSelection:(list identityIndexOf:bestTag).
  2129                     ].
  2181                     ].
  2130                     tagLineNr := nil
  2182                     tagLineNr := nil
  2131                 ].
  2183                 ].
       
  2184                 aBlock value.
  2132             ]
  2185             ]
  2133         ] valueNowOrOnUnwindDo:[
  2186         ] valueNowOrOnUnwindDo:[
  2134             process := nil.
  2187             process := nil.
  2135             self enabled:true.
  2188             self enabled:true.
  2136         ].
  2189         ].
  2137     ] forkAt:4.
  2190     ] forkAt:4.
  2138 
  2191 
  2139     process priorityRange:(4 to:8).
  2192     process priorityRange:(4 to:8).
  2140 
  2193 
  2141     "Modified: / 07-05-2011 / 15:39:26 / cg"
  2194     "Created: / 06-10-2011 / 13:56:18 / cg"
  2142 !
  2195 !
  2143 
  2196 
  2144 stopGeneratingTags
  2197 stopGeneratingTags
  2145     "stop the process which generates the tags
  2198     "stop the process which generates the tags
  2146     "
  2199     "
  2155             task terminateWithAllSubprocessesInGroup.
  2208             task terminateWithAllSubprocessesInGroup.
  2156             task waitUntilTerminated.
  2209             task waitUntilTerminated.
  2157         ]
  2210         ]
  2158     ].
  2211     ].
  2159     fileName := nil.
  2212     fileName := nil.
  2160     list removeAll.
  2213     "/ list removeAll.
       
  2214 
       
  2215     "Modified (comment): / 06-10-2011 / 14:01:30 / cg"
  2161 ! !
  2216 ! !
  2162 
  2217 
  2163 !TagsBrowser::TagView methodsFor:'initialize & release'!
  2218 !TagsBrowser::TagView methodsFor:'initialize & release'!
  2164 
  2219 
  2165 destroy
  2220 destroy
  2193 ! !
  2248 ! !
  2194 
  2249 
  2195 !TagsBrowser class methodsFor:'documentation'!
  2250 !TagsBrowser class methodsFor:'documentation'!
  2196 
  2251 
  2197 version
  2252 version
  2198     ^ '$Header: /cvs/stx/stx/libtool/Tools__TagsBrowser.st,v 1.14 2011-10-06 10:50:51 cg Exp $'
  2253     ^ '$Header: /cvs/stx/stx/libtool/Tools__TagsBrowser.st,v 1.15 2011-10-06 12:06:07 cg Exp $'
  2199 !
  2254 !
  2200 
  2255 
  2201 version_CVS
  2256 version_CVS
  2202     ^ '$Header: /cvs/stx/stx/libtool/Tools__TagsBrowser.st,v 1.14 2011-10-06 10:50:51 cg Exp $'
  2257     ^ '$Header: /cvs/stx/stx/libtool/Tools__TagsBrowser.st,v 1.15 2011-10-06 12:06:07 cg Exp $'
  2203 !
  2258 !
  2204 
  2259 
  2205 version_SVN
  2260 version_SVN
  2206     ^ '§Id§'
  2261     ^ '§Id§'
  2207 ! !
  2262 ! !