--- a/Tools_NavigatorModel.st Wed Sep 04 23:50:52 2013 +0200
+++ b/Tools_NavigatorModel.st Thu Sep 05 12:46:11 2013 +0200
@@ -14,7 +14,7 @@
"{ NameSpace: Tools }"
ApplicationModel subclass:#NavigatorModel
- instanceVariableNames:''
+ instanceVariableNames:'environment'
classVariableNames:'AllEntry SuperSendEntry UncommentedEntry'
poolDictionaries:''
category:'Interface-Browsers-New'
@@ -34,6 +34,31 @@
other person. No title to or ownership of the software is
hereby transferred.
"
+!
+
+documentation
+"
+ A base abstract superclass for all tools browsing the code.
+
+ The `environment` instvar should be used to access the code elements
+ (classes, packages, namespace). The tool should never access Smalltalk
+ directly, but the `environment`. By default, the `environment` is
+ initialized to Smalltalk. The `environment` could be whatever object
+ you like, but it MUST be polymorph with Smalltalk. Also, all classes-like
+ objects it returns MUST be polymorph with Class. Otherwise, expect
+ a lot of DNUs.
+
+ [author:]
+ Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ [instance variables:]
+ environment
+
+ [class variables:]
+
+ [see also:]
+
+"
! !
!NavigatorModel class methodsFor:'initialization'!
@@ -329,6 +354,50 @@
"Created: / 06-04-2010 / 11:09:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 07-09-2011 / 10:45:45 / cg"
"Modified: / 19-01-2012 / 10:43:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isAbstract
+ ^ self == Tools::NavigatorModel
+
+ "Created: / 03-09-2013 / 15:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!NavigatorModel methodsFor:'accessing'!
+
+environment
+ ^ environment
+
+ "Created: / 03-09-2013 / 19:19:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+environment:env
+ environment := env.
+! !
+
+!NavigatorModel methodsFor:'hooks'!
+
+commonPreBuild
+ | topApp |
+
+ super commonPreBuild.
+ topApp := self topApplication.
+ (topApp notNil and:[topApp ~~ self]) ifTrue:[
+ "Fetch the environment from the top application, fallback to previous environment"
+ self environment: (topApp perform:#environment ifNotUnderstood:[environment])
+ ]
+
+ "Created: / 03-09-2013 / 16:25:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 03-09-2013 / 18:31:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!NavigatorModel methodsFor:'initialization'!
+
+initialize
+
+ super initialize.
+ environment := Smalltalk.
+
+ "Created: / 03-09-2013 / 15:35:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!NavigatorModel methodsFor:'misc'!
@@ -356,15 +425,21 @@
!NavigatorModel class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/Tools_NavigatorModel.st,v 1.23 2012-11-07 13:57:05 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools_NavigatorModel.st,v 1.24 2013-09-05 10:46:11 vrany Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Tools_NavigatorModel.st,v 1.23 2012-11-07 13:57:05 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools_NavigatorModel.st,v 1.24 2013-09-05 10:46:11 vrany Exp $'
+!
+
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
!
version_SVN
^ '§Id: Tools__NavigatorModel.st 7802 2011-07-05 18:33:36Z vranyj1 §'
! !
+
NavigatorModel initialize!