added:5 methods
comment/format in: #handlingRefactoringErrorDo:
changed:5 methods
--- a/NewSystemBrowser.st Thu Oct 08 16:02:19 2009 +0200
+++ b/NewSystemBrowser.st Fri Oct 09 09:46:56 2009 +0200
@@ -5629,7 +5629,7 @@
keepLinkedMenu: true
)
(MenuItem
- enabled: hasClassesSelectedAndSubversionRepositoryExists
+ enabled: hasClassesSelectedAndSubversionRepositoryExistsHolder
label: 'SubVersion'
translateLabel: true
isVisible: hasSubversionSupport
@@ -7703,7 +7703,7 @@
labelImage: (ResourceRetriever ToolbarIconLibrary repositoryCVSIcon 'CVS')
)
(MenuItem
- enabled: hasProjectSelectedSubversionRepositoryExists
+ enabled: hasProjectSelectedSubversionRepositoryExistsHolder
label: 'SubVersion'
translateLabel: true
isVisible: hasSubversionSupport
@@ -11017,7 +11017,6 @@
"Created: / 18.2.2000 / 11:58:25 / cg"
! !
-
!NewSystemBrowser class methodsFor:'menu specs-toolbar'!
toolBarMenu
@@ -13340,6 +13339,28 @@
"Created: / 4.2.2000 / 22:02:53 / cg"
!
+hasClassesSelectedAndSubversionRepositoryExists
+ | classes |
+
+ classes := self selectedClasses value.
+ classes size = 0 ifTrue:[^false].
+ ^ classes
+ allSatisfy:
+ [:cls | self hasSubversionRepositoryFor: cls theNonMetaclass package]
+!
+
+hasClassesSelectedAndSubversionRepositoryExistsHolder
+ ^ [
+ | classes |
+
+ classes := self selectedClasses value.
+ classes size = 0 ifTrue:[^false].
+ classes
+ allSatisfy:
+ [:cls | self hasSubversionRepositoryFor: cls theNonMetaclass package]
+ ]
+!
+
hasClassesWithCommonSuperclassAndVariableSelectedAndCanUseRefactoringSupportHolder
^ [ self canUseRefactoringSupport
and:[self hasClassesWithCommonSuperclassSelected
@@ -13962,6 +13983,14 @@
"Created: / 4.2.2000 / 22:09:02 / cg"
!
+hasProjectSelectedSubversionRepositoryExistsHolder
+ ^ [ self hasProjectSelected
+ and:[self selectedProjects value size = 1
+ and:[self hasSubversionRepositoryFor: self selectedProjects value anyOne]]]
+
+ "Created: / 31-03-2008 / 15:07:52 / janfrog"
+!
+
hasProtocolSelected
^ self selectedProtocols value size > 0
@@ -14474,11 +14503,20 @@
"Created: / 4.2.2000 / 22:11:34 / cg"
!
+hasSubversionRepositoryFor: package
+ ^ self hasSubversionSupport
+ "/ use Smalltalk-at to trick the dependency/prerequisite generator
+ and:[(Smalltalk at:#'SVN::RepositoryManager') hasRepositoryForPackage: package]
+
+ "Created: / 31-03-2008 / 15:08:13 / janfrog"
+ "Modified: / 22-08-2009 / 10:49:33 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
hasSubversionSupport
-
|subVersionRepository|
- subVersionRepository := Smalltalk classNamed: #'SVN::RepositoryManager'.
+ "/ use Smalltalk-at to trick the dependency/prerequisite generator
+ subVersionRepository := Smalltalk at: #'SVN::RepositoryManager'.
^ subVersionRepository notNil
and:[ subVersionRepository isLoaded
@@ -25019,6 +25057,7 @@
in:(mthd := self theSingleSelectedMethod) mclass
selector:mthd selector.
refactoring source:(self codeView contentsAsString).
+ refactoring okToRenameAsKnownVariable:true.
"/ refactoring model name:('rename local variable %1 to %2' bindWith:oldName with:newName).
self performRefactoring:refactoring.
@@ -25179,7 +25218,7 @@
handlingRefactoringErrorDo:aBlock
^ Refactoring preconditionSignal
- handle:[:ex |
+ handle:[:ex |
|param answer errMsg dialogMsg|
errMsg := ex description.
@@ -26584,188 +26623,9 @@
!
projectMenuBuild
- "/ intermediate - this will move into a commonly used utility class
- "/ (where all the project code support will be collected).
-
- |buildDirectory package module directory defClass mgr
- repository stxRepository targetDir top|
-
- package := self theSingleSelectedProject.
- module := package asPackageId module.
- directory := package asPackageId directory.
-
- buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ].
- buildDirectory isNil ifTrue:[
- buildDirectory := Filename tempDirectory construct:'stx_build'.
- ].
- buildDirectory := buildDirectory asFilename.
-
-"/ "/ self projectMenuCheckInAll.
-"/ [
-"/ |default directoryIsOKForMe stc |
-"/
-"/ default := (buildDirectory ?
-"/ PreviousBuildDirectory)
-"/ ifNil:[ UserPreferences current buildDirectory].
-"/
-"/ buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:'
-"/ default:default.
-"/
-"/ buildDirectory isEmptyOrNil ifTrue:[^ self].
-"/ buildDirectory := buildDirectory asFilename.
-"/ directoryIsOKForMe := true.
-"/
-"/ buildDirectory exists ifFalse:[
-"/ Dialog warn:(resources string:'Work directory %1 does not exist.' with:buildDirectory).
-"/ directoryIsOKForMe := false.
-"/ ] ifTrue:[
-"/ (buildDirectory construct:'stx') exists ifFalse:[
-"/ Dialog warn:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.' withCRs.
-"/ directoryIsOKForMe := false.
-"/ ] ifTrue:[
-"/ stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc'].
-"/ (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[
-"/ Dialog warn:'Work directory must contain an stc compiler in the stx/stc subDirectory.' withCRs.
-"/ directoryIsOKForMe := false.
-"/ ].
-"/ ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[
-"/ Dialog warn:'Work directory must have had a make run before (for include files to exists).' withCRs.
-"/ directoryIsOKForMe := false.
-"/ ].
-"/ ]
-"/ ]
-"/ ] doUntil:[ directoryIsOKForMe ].
-
- PreviousBuildDirectory := buildDirectory.
-
- defClass := ProjectDefinition definitionClassForPackage:package.
-
- UserPreferences current localBuild ifFalse:[
- SourceCodeManager notNil ifTrue:[
- mgr := SourceCodeManagerUtilities sourceCodeManagerFor:defClass.
- ]
- ].
-
- buildDirectory exists ifFalse:[
- buildDirectory makeDirectory.
- (buildDirectory construct:'stx') makeDirectory.
- ].
- (buildDirectory construct:'stx') exists ifFalse:[
- (buildDirectory construct:'stx') makeDirectory.
- ].
-
- top := Smalltalk packagePath
- detect:[:aPath |
- (aPath asFilename / 'stx' / 'include') exists
- and: [ (aPath asFilename / 'stx' / 'rules') exists ]]
- ifNone:nil.
-
- #(
- 'include'
- 'rules'
- ) do:[:subdir |
- |targetDir|
-
- targetDir := (buildDirectory construct:'stx') construct:subdir.
- targetDir exists ifFalse:[
- targetDir makeDirectory.
- (top asFilename construct:subdir) directoryContentsAsFilenamesDo:[:eachFile |
- eachFile isDirectory ifFalse:[
- eachFile copyTo:(targetDir construct:eachFile baseName)
- ]
- ].
- ].
- ].
-
- mgr notNil ifTrue:[
- "/ check out / generate files there
- repository := (mgr repositoryNameForModule:module) ifNil:[mgr repositoryName].
- stxRepository := mgr repositoryName.
-
- (buildDirectory construct:'stx') exists ifFalse:[
- (module ~= 'stx') ifTrue:[
- OperatingSystem
- executeCommand:('cvs -d ',stxRepository,' co stx')
- inputFrom:nil
- outputTo:Transcript
- errorTo:Transcript
- inDirectory:buildDirectory
- onError:[:status| self error:'cvs update stx failed'].
- ].
- ].
-
- ((buildDirectory construct:module) construct:'CVS') exists ifFalse:[
- OperatingSystem
- executeCommand:('cvs -d ',repository,' co -l ',directory)
- inputFrom:nil
- outputTo:Transcript
- errorTo:Transcript
- inDirectory:buildDirectory
- onError:[:status| self error:'cvs update failed'].
- ].
- OperatingSystem
- executeCommand:'cvs upd -d'
- inputFrom:nil
- outputTo:Transcript
- errorTo:Transcript
- inDirectory:(buildDirectory construct:module)
- onError:[:status| self error:'cvs update failed'].
- ] ifFalse:[
- "/ local build
- "/ fileout the project
-
- (buildDirectory construct:'stx') recursiveMakeDirectory.
- (module ~= 'stx') ifTrue:[
- (buildDirectory construct:module) makeDirectory.
- ].
-
- "/ need rules in stx
- ((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:'rules')
- recursiveCopyTo:(buildDirectory construct:'stx').
-
- "/ file out the package(s)
-self halt.
- ((Array with:package) , (defClass allPreRequisites))
- do:[:eachPackageToFileout |
- |packageModule packageDirectory packageTargetDir|
-
- packageModule := eachPackageToFileout asPackageId module.
- packageDirectory := eachPackageToFileout asPackageId directory.
- packageTargetDir := ((buildDirectory construct:packageModule) construct:packageDirectory) recursiveMakeDirectory.
-
- (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls |
- cls isPrivate ifFalse:[
- cls autoload.
- cls fileOutIn:packageTargetDir
- ]
- ].
- ].
-
- "/ generate support files there
- targetDir := ((buildDirectory construct:module) construct:directory) recursiveMakeDirectory.
- #('bmake.bat' 'Make.spec' 'Make.proto' 'libInit.cc' 'abbrev.stc'
- 'bc.mak'
- ) do:[:f |
- |contents|
-
- contents := defClass generateFile:f.
- (targetDir construct:f) contents:contents.
- ].
-self halt.
- ].
-self halt.
-
- OperatingSystem
- executeCommand:(ParserFlags makeCommand)
- inputFrom:nil
- outputTo:Transcript
- errorTo:Transcript
- inDirectory:((buildDirectory construct:module) construct:directory)
- onError:[:status| self error:'make failed'].
-
- "Created: / 09-08-2006 / 18:37:19 / fm"
- "Modified: / 09-08-2006 / 19:55:50 / fm"
- "Modified: / 22-09-2006 / 17:37:11 / cg"
+ ProjectBuilder new
+ package:self theSingleSelectedProject;
+ build
!
projectMenuCheckInAll
@@ -33117,8 +32977,6 @@
"Modified: / 1.3.2000 / 21:03:34 / cg"
! !
-
-
!NewSystemBrowser methodsFor:'menu actions-variables'!
browseVarRefsOrModsWithTitle:browserTitle boxTitle:boxTitle variables:varType access:accessType all:browseAll
@@ -43140,11 +42998,11 @@
!NewSystemBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.1340 2009-10-08 10:53:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.1341 2009-10-09 07:46:56 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.1340 2009-10-08 10:53:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Attic/NewSystemBrowser.st,v 1.1341 2009-10-09 07:46:56 cg Exp $'
! !
NewSystemBrowser initialize!
--- a/Tools__NewSystemBrowser.st Thu Oct 08 16:02:19 2009 +0200
+++ b/Tools__NewSystemBrowser.st Fri Oct 09 09:46:56 2009 +0200
@@ -5629,7 +5629,7 @@
keepLinkedMenu: true
)
(MenuItem
- enabled: hasClassesSelectedAndSubversionRepositoryExists
+ enabled: hasClassesSelectedAndSubversionRepositoryExistsHolder
label: 'SubVersion'
translateLabel: true
isVisible: hasSubversionSupport
@@ -7703,7 +7703,7 @@
labelImage: (ResourceRetriever ToolbarIconLibrary repositoryCVSIcon 'CVS')
)
(MenuItem
- enabled: hasProjectSelectedSubversionRepositoryExists
+ enabled: hasProjectSelectedSubversionRepositoryExistsHolder
label: 'SubVersion'
translateLabel: true
isVisible: hasSubversionSupport
@@ -11017,7 +11017,6 @@
"Created: / 18.2.2000 / 11:58:25 / cg"
! !
-
!NewSystemBrowser class methodsFor:'menu specs-toolbar'!
toolBarMenu
@@ -13340,6 +13339,28 @@
"Created: / 4.2.2000 / 22:02:53 / cg"
!
+hasClassesSelectedAndSubversionRepositoryExists
+ | classes |
+
+ classes := self selectedClasses value.
+ classes size = 0 ifTrue:[^false].
+ ^ classes
+ allSatisfy:
+ [:cls | self hasSubversionRepositoryFor: cls theNonMetaclass package]
+!
+
+hasClassesSelectedAndSubversionRepositoryExistsHolder
+ ^ [
+ | classes |
+
+ classes := self selectedClasses value.
+ classes size = 0 ifTrue:[^false].
+ classes
+ allSatisfy:
+ [:cls | self hasSubversionRepositoryFor: cls theNonMetaclass package]
+ ]
+!
+
hasClassesWithCommonSuperclassAndVariableSelectedAndCanUseRefactoringSupportHolder
^ [ self canUseRefactoringSupport
and:[self hasClassesWithCommonSuperclassSelected
@@ -13962,6 +13983,14 @@
"Created: / 4.2.2000 / 22:09:02 / cg"
!
+hasProjectSelectedSubversionRepositoryExistsHolder
+ ^ [ self hasProjectSelected
+ and:[self selectedProjects value size = 1
+ and:[self hasSubversionRepositoryFor: self selectedProjects value anyOne]]]
+
+ "Created: / 31-03-2008 / 15:07:52 / janfrog"
+!
+
hasProtocolSelected
^ self selectedProtocols value size > 0
@@ -14474,11 +14503,20 @@
"Created: / 4.2.2000 / 22:11:34 / cg"
!
+hasSubversionRepositoryFor: package
+ ^ self hasSubversionSupport
+ "/ use Smalltalk-at to trick the dependency/prerequisite generator
+ and:[(Smalltalk at:#'SVN::RepositoryManager') hasRepositoryForPackage: package]
+
+ "Created: / 31-03-2008 / 15:08:13 / janfrog"
+ "Modified: / 22-08-2009 / 10:49:33 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
hasSubversionSupport
-
|subVersionRepository|
- subVersionRepository := Smalltalk classNamed: #'SVN::RepositoryManager'.
+ "/ use Smalltalk-at to trick the dependency/prerequisite generator
+ subVersionRepository := Smalltalk at: #'SVN::RepositoryManager'.
^ subVersionRepository notNil
and:[ subVersionRepository isLoaded
@@ -25019,6 +25057,7 @@
in:(mthd := self theSingleSelectedMethod) mclass
selector:mthd selector.
refactoring source:(self codeView contentsAsString).
+ refactoring okToRenameAsKnownVariable:true.
"/ refactoring model name:('rename local variable %1 to %2' bindWith:oldName with:newName).
self performRefactoring:refactoring.
@@ -25179,7 +25218,7 @@
handlingRefactoringErrorDo:aBlock
^ Refactoring preconditionSignal
- handle:[:ex |
+ handle:[:ex |
|param answer errMsg dialogMsg|
errMsg := ex description.
@@ -26584,188 +26623,9 @@
!
projectMenuBuild
- "/ intermediate - this will move into a commonly used utility class
- "/ (where all the project code support will be collected).
-
- |buildDirectory package module directory defClass mgr
- repository stxRepository targetDir top|
-
- package := self theSingleSelectedProject.
- module := package asPackageId module.
- directory := package asPackageId directory.
-
- buildDirectory := PreviousBuildDirectory ifNil:[ UserPreferences current buildDirectory ].
- buildDirectory isNil ifTrue:[
- buildDirectory := Filename tempDirectory construct:'stx_build'.
- ].
- buildDirectory := buildDirectory asFilename.
-
-"/ "/ self projectMenuCheckInAll.
-"/ [
-"/ |default directoryIsOKForMe stc |
-"/
-"/ default := (buildDirectory ?
-"/ PreviousBuildDirectory)
-"/ ifNil:[ UserPreferences current buildDirectory].
-"/
-"/ buildDirectory := Dialog requestDirectoryName:'Temporary Work-ROOT for build:'
-"/ default:default.
-"/
-"/ buildDirectory isEmptyOrNil ifTrue:[^ self].
-"/ buildDirectory := buildDirectory asFilename.
-"/ directoryIsOKForMe := true.
-"/
-"/ buildDirectory exists ifFalse:[
-"/ Dialog warn:(resources string:'Work directory %1 does not exist.' with:buildDirectory).
-"/ directoryIsOKForMe := false.
-"/ ] ifTrue:[
-"/ (buildDirectory construct:'stx') exists ifFalse:[
-"/ Dialog warn:'Work directory must contain an stx subDirectory,\which contains (at least) the stc and include subdirectories.' withCRs.
-"/ directoryIsOKForMe := false.
-"/ ] ifTrue:[
-"/ stc := (OperatingSystem isMSDOSlike) ifTrue:['stc.exe'] ifFalse:['stc'].
-"/ (((buildDirectory construct:'stx')construct:'stc')construct:stc) exists ifFalse:[
-"/ Dialog warn:'Work directory must contain an stc compiler in the stx/stc subDirectory.' withCRs.
-"/ directoryIsOKForMe := false.
-"/ ].
-"/ ((buildDirectory construct:'stx')construct:'include') exists ifFalse:[
-"/ Dialog warn:'Work directory must have had a make run before (for include files to exists).' withCRs.
-"/ directoryIsOKForMe := false.
-"/ ].
-"/ ]
-"/ ]
-"/ ] doUntil:[ directoryIsOKForMe ].
-
- PreviousBuildDirectory := buildDirectory.
-
- defClass := ProjectDefinition definitionClassForPackage:package.
-
- UserPreferences current localBuild ifFalse:[
- SourceCodeManager notNil ifTrue:[
- mgr := SourceCodeManagerUtilities sourceCodeManagerFor:defClass.
- ]
- ].
-
- buildDirectory exists ifFalse:[
- buildDirectory makeDirectory.
- (buildDirectory construct:'stx') makeDirectory.
- ].
- (buildDirectory construct:'stx') exists ifFalse:[
- (buildDirectory construct:'stx') makeDirectory.
- ].
-
- top := Smalltalk packagePath
- detect:[:aPath |
- (aPath asFilename / 'stx' / 'include') exists
- and: [ (aPath asFilename / 'stx' / 'rules') exists ]]
- ifNone:nil.
-
- #(
- 'include'
- 'rules'
- ) do:[:subdir |
- |targetDir|
-
- targetDir := (buildDirectory construct:'stx') construct:subdir.
- targetDir exists ifFalse:[
- targetDir makeDirectory.
- (top asFilename construct:subdir) directoryContentsAsFilenamesDo:[:eachFile |
- eachFile isDirectory ifFalse:[
- eachFile copyTo:(targetDir construct:eachFile baseName)
- ]
- ].
- ].
- ].
-
- mgr notNil ifTrue:[
- "/ check out / generate files there
- repository := (mgr repositoryNameForModule:module) ifNil:[mgr repositoryName].
- stxRepository := mgr repositoryName.
-
- (buildDirectory construct:'stx') exists ifFalse:[
- (module ~= 'stx') ifTrue:[
- OperatingSystem
- executeCommand:('cvs -d ',stxRepository,' co stx')
- inputFrom:nil
- outputTo:Transcript
- errorTo:Transcript
- inDirectory:buildDirectory
- onError:[:status| self error:'cvs update stx failed'].
- ].
- ].
-
- ((buildDirectory construct:module) construct:'CVS') exists ifFalse:[
- OperatingSystem
- executeCommand:('cvs -d ',repository,' co -l ',directory)
- inputFrom:nil
- outputTo:Transcript
- errorTo:Transcript
- inDirectory:buildDirectory
- onError:[:status| self error:'cvs update failed'].
- ].
- OperatingSystem
- executeCommand:'cvs upd -d'
- inputFrom:nil
- outputTo:Transcript
- errorTo:Transcript
- inDirectory:(buildDirectory construct:module)
- onError:[:status| self error:'cvs update failed'].
- ] ifFalse:[
- "/ local build
- "/ fileout the project
-
- (buildDirectory construct:'stx') recursiveMakeDirectory.
- (module ~= 'stx') ifTrue:[
- (buildDirectory construct:module) makeDirectory.
- ].
-
- "/ need rules in stx
- ((Smalltalk projectDirectoryForPackage:'stx') asFilename construct:'rules')
- recursiveCopyTo:(buildDirectory construct:'stx').
-
- "/ file out the package(s)
-self halt.
- ((Array with:package) , (defClass allPreRequisites))
- do:[:eachPackageToFileout |
- |packageModule packageDirectory packageTargetDir|
-
- packageModule := eachPackageToFileout asPackageId module.
- packageDirectory := eachPackageToFileout asPackageId directory.
- packageTargetDir := ((buildDirectory construct:packageModule) construct:packageDirectory) recursiveMakeDirectory.
-
- (Smalltalk allClassesInPackage:eachPackageToFileout) do:[:cls |
- cls isPrivate ifFalse:[
- cls autoload.
- cls fileOutIn:packageTargetDir
- ]
- ].
- ].
-
- "/ generate support files there
- targetDir := ((buildDirectory construct:module) construct:directory) recursiveMakeDirectory.
- #('bmake.bat' 'Make.spec' 'Make.proto' 'libInit.cc' 'abbrev.stc'
- 'bc.mak'
- ) do:[:f |
- |contents|
-
- contents := defClass generateFile:f.
- (targetDir construct:f) contents:contents.
- ].
-self halt.
- ].
-self halt.
-
- OperatingSystem
- executeCommand:(ParserFlags makeCommand)
- inputFrom:nil
- outputTo:Transcript
- errorTo:Transcript
- inDirectory:((buildDirectory construct:module) construct:directory)
- onError:[:status| self error:'make failed'].
-
- "Created: / 09-08-2006 / 18:37:19 / fm"
- "Modified: / 09-08-2006 / 19:55:50 / fm"
- "Modified: / 22-09-2006 / 17:37:11 / cg"
+ ProjectBuilder new
+ package:self theSingleSelectedProject;
+ build
!
projectMenuCheckInAll
@@ -33117,8 +32977,6 @@
"Modified: / 1.3.2000 / 21:03:34 / cg"
! !
-
-
!NewSystemBrowser methodsFor:'menu actions-variables'!
browseVarRefsOrModsWithTitle:browserTitle boxTitle:boxTitle variables:varType access:accessType all:browseAll
@@ -43140,11 +42998,11 @@
!NewSystemBrowser class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1340 2009-10-08 10:53:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1341 2009-10-09 07:46:56 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1340 2009-10-08 10:53:23 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1341 2009-10-09 07:46:56 cg Exp $'
! !
NewSystemBrowser initialize!