ConfigurableFeatures.st
changeset 17166 d51ac1087219
parent 16627 bdf2205fd15c
child 18120 e3a375d5f6a8
--- a/ConfigurableFeatures.st	Sat Nov 29 19:20:34 2014 +0100
+++ b/ConfigurableFeatures.st	Mon Dec 01 12:24:54 2014 +0100
@@ -24,6 +24,18 @@
 "
 ! !
 
+!ConfigurableFeatures class methodsFor:'initialization'!
+
+initialize
+    "Invoked at system start or when the class is dynamically loaded."
+
+    "/ please change as required (and remove this comment)
+
+    LoadedFeatures := Dictionary new
+
+    "Modified: / 01-12-2014 / 11:16:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ConfigurableFeatures class methodsFor:'queries'!
 
 allFeatures
@@ -219,6 +231,42 @@
     "Created: / 03-01-2012 / 15:43:28 / cg"
 !
 
+hasRefactoryBrowser
+    "Return true, if refactory browser support is available"
+
+    (LoadedFeatures includesKey: #RefactoryBrowser) ifFalse:[ 
+        "/ Called for the very first time
+
+        #(
+            #'stx:goodies/refactoryBrowser/browser'
+            #'stx:goodies/refactoryBrowser/changes'
+            #'stx:goodies/refactoryBrowser/helpers'
+            #'stx:goodies/refactoryBrowser/lint'
+            #'stx:goodies/refactoryBrowser/parser'
+            #'stx:goodies/refactoryBrowser/refactoring'
+        ) do:[:each | 
+            (ProjectDefinition definitionClassForPackage: each) isNil ifTrue:[
+                | loaded |
+
+                loaded := [ Smalltalk loadPackage: each ] on: PackageLoadError do:[ false ].
+                loaded ifFalse:[ 
+                    LoadedFeatures at: #RefactoryBrowser put: false.
+                    ^ false.
+                ].
+            ]
+        ].
+        LoadedFeatures at: #RefactoryBrowser put: true.
+        ^ true
+    ].
+    ^ LoadedFeatures includesKey: #RefactoryBrowser
+
+    "
+    ConfigurableFeatures includesFeature: #RefactoryBrowser    
+    "
+
+    "Created: / 01-12-2014 / 11:16:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 hasSCMSupportEnabledFor:aSourceCodeManagerClassName
     |scm|
 
@@ -253,10 +301,12 @@
 !ConfigurableFeatures class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.10 2014-06-25 07:46:15 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.11 2014-12-01 11:24:54 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.10 2014-06-25 07:46:15 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.11 2014-12-01 11:24:54 vrany Exp $'
 ! !
 
+
+ConfigurableFeatures initialize!