*** empty log message ***
authorclaus
Sat, 25 Mar 1995 23:11:46 +0100
changeset 52 6dc870beba69
parent 51 ac84315b8181
child 53 4f5e734bc59f
*** empty log message ***
AppControl.st
AppModel.st
ApplicationController.st
ApplicationModel.st
--- a/AppControl.st	Thu Mar 23 17:54:02 1995 +0100
+++ b/AppControl.st	Sat Mar 25 23:11:46 1995 +0100
@@ -10,14 +10,14 @@
  hereby transferred.
 "
 
-Model subclass:#ApplicationController
+Controller subclass:#ApplicationController
 	 instanceVariableNames:''
 	 classVariableNames:''
 	 poolDictionaries:''
-	 category:'ST80-Compatibility'
+	 category:'Interface-Framework'
 !
 
-!ApplicationModel class methodsFor:'documentation'!
+!ApplicationController class methodsFor:'documentation'!
 
 copyright
 "
@@ -35,7 +35,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview2/Attic/AppControl.st,v 1.1 1995-03-23 16:51:23 claus Exp $
+$Header: /cvs/stx/stx/libview2/Attic/AppControl.st,v 1.2 1995-03-25 22:11:38 claus Exp $
 "
 !
 
--- a/AppModel.st	Thu Mar 23 17:54:02 1995 +0100
+++ b/AppModel.st	Sat Mar 25 23:11:46 1995 +0100
@@ -10,13 +10,17 @@
  hereby transferred.
 "
 
+'From Smalltalk/X, Version:2.10.5 on 24-mar-1995 at 9:31:53 am'!
+
 Model subclass:#ApplicationModel
-	 instanceVariableNames:'builder'
+	 instanceVariableNames:'builder resources'
 	 classVariableNames:''
 	 poolDictionaries:''
-	 category:'ST80-Compatibility'
+	 category:'Interface-Framework'
 !
 
+ApplicationModel class instanceVariableNames:'ClassResources'!
+
 !ApplicationModel class methodsFor:'documentation'!
 
 copyright
@@ -35,7 +39,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview2/Attic/AppModel.st,v 1.1 1995-03-23 16:51:31 claus Exp $
+$Header: /cvs/stx/stx/libview2/Attic/AppModel.st,v 1.2 1995-03-25 22:11:46 claus Exp $
 "
 !
 
@@ -43,19 +47,94 @@
 "
     Since many ST-80 classes are subclasses of ApplicationModel, this class
     is provided here to allow easier porting of ST-80 code.
-    It does not (currently) provide any functionality; therefore, manual
+    It does not (currently) provide much functionality; therefore, manual
     changes have to be made to get those applications to run under ST/X.
     (but at least, this enables you to fileIn that code)
 
+    The classResources have been put into this class to allow ST/X
+    view code to migrate smoothly into ApplicationModels.
+
     Instance variables:
-	builder      ?          dont know what that is used for yet,
-				some subclasses (see manchester goodies)
-				depend on thise being there.
+	resources    ResourcePack       language string translation
+
+	builder      ?                  dont know what that is used for yet,
+					some subclasses (see manchester goodies)
+					depend on thise being there.
 "
 ! !
 
+!ApplicationModel class methodsFor:'initialization'!
+
+initialize 
+    self == ApplicationModel ifTrue:[
+	Smalltalk addDependent:self
+    ]
+
+    "
+     ApplicationModel initialize
+    "
+! !
+
+!ApplicationModel class methodsFor:'instance creation'!
+
+new
+    ^ super new initialize
+! !
+
 !ApplicationModel class methodsFor:'startup'!
 
 open
     self subclassResponsibility
 ! !
+
+!ApplicationModel class methodsFor:'change & update'!
+
+update:something
+    something == #Language ifTrue:[
+	"flush resources on language changes"
+	self flushAllClassResources
+    ]
+! !
+
+!ApplicationModel class methodsFor:'resources'!
+
+classResources
+    "if not already loaded, get the classes resourcePack
+     and return it"
+
+    ClassResources isNil ifTrue:[
+	ClassResources := ResourcePack for:self.
+    ].
+    ^ ClassResources
+!
+
+classResources:aResourcePack
+    "allow setting of the classResources"
+
+    ClassResources := aResourcePack
+!
+
+flushAllClassResources
+    "flush all classes resource translations.
+     Needed after a resource file / language setting has changed."
+
+    ResourcePack flushCachedResourcePacks.
+    self flushClassResources.
+    self allSubclassesDo:[:aClass |
+	aClass flushClassResources.
+    ]
+!
+
+flushClassResources
+    "flush classes resource string translations.
+     Needed whenever a resource file / language setting has changed"
+
+    ClassResources := nil.
+! !
+
+!ApplicationModel methodsFor:'initialization'!
+
+initialize
+    super initialize.
+    resources := self class classResources.
+! !
--- a/ApplicationController.st	Thu Mar 23 17:54:02 1995 +0100
+++ b/ApplicationController.st	Sat Mar 25 23:11:46 1995 +0100
@@ -10,14 +10,14 @@
  hereby transferred.
 "
 
-Model subclass:#ApplicationController
+Controller subclass:#ApplicationController
 	 instanceVariableNames:''
 	 classVariableNames:''
 	 poolDictionaries:''
-	 category:'ST80-Compatibility'
+	 category:'Interface-Framework'
 !
 
-!ApplicationModel class methodsFor:'documentation'!
+!ApplicationController class methodsFor:'documentation'!
 
 copyright
 "
@@ -35,7 +35,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview2/ApplicationController.st,v 1.1 1995-03-23 16:51:23 claus Exp $
+$Header: /cvs/stx/stx/libview2/ApplicationController.st,v 1.2 1995-03-25 22:11:38 claus Exp $
 "
 !
 
--- a/ApplicationModel.st	Thu Mar 23 17:54:02 1995 +0100
+++ b/ApplicationModel.st	Sat Mar 25 23:11:46 1995 +0100
@@ -10,13 +10,17 @@
  hereby transferred.
 "
 
+'From Smalltalk/X, Version:2.10.5 on 24-mar-1995 at 9:31:53 am'!
+
 Model subclass:#ApplicationModel
-	 instanceVariableNames:'builder'
+	 instanceVariableNames:'builder resources'
 	 classVariableNames:''
 	 poolDictionaries:''
-	 category:'ST80-Compatibility'
+	 category:'Interface-Framework'
 !
 
+ApplicationModel class instanceVariableNames:'ClassResources'!
+
 !ApplicationModel class methodsFor:'documentation'!
 
 copyright
@@ -35,7 +39,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.1 1995-03-23 16:51:31 claus Exp $
+$Header: /cvs/stx/stx/libview2/ApplicationModel.st,v 1.2 1995-03-25 22:11:46 claus Exp $
 "
 !
 
@@ -43,19 +47,94 @@
 "
     Since many ST-80 classes are subclasses of ApplicationModel, this class
     is provided here to allow easier porting of ST-80 code.
-    It does not (currently) provide any functionality; therefore, manual
+    It does not (currently) provide much functionality; therefore, manual
     changes have to be made to get those applications to run under ST/X.
     (but at least, this enables you to fileIn that code)
 
+    The classResources have been put into this class to allow ST/X
+    view code to migrate smoothly into ApplicationModels.
+
     Instance variables:
-	builder      ?          dont know what that is used for yet,
-				some subclasses (see manchester goodies)
-				depend on thise being there.
+	resources    ResourcePack       language string translation
+
+	builder      ?                  dont know what that is used for yet,
+					some subclasses (see manchester goodies)
+					depend on thise being there.
 "
 ! !
 
+!ApplicationModel class methodsFor:'initialization'!
+
+initialize 
+    self == ApplicationModel ifTrue:[
+	Smalltalk addDependent:self
+    ]
+
+    "
+     ApplicationModel initialize
+    "
+! !
+
+!ApplicationModel class methodsFor:'instance creation'!
+
+new
+    ^ super new initialize
+! !
+
 !ApplicationModel class methodsFor:'startup'!
 
 open
     self subclassResponsibility
 ! !
+
+!ApplicationModel class methodsFor:'change & update'!
+
+update:something
+    something == #Language ifTrue:[
+	"flush resources on language changes"
+	self flushAllClassResources
+    ]
+! !
+
+!ApplicationModel class methodsFor:'resources'!
+
+classResources
+    "if not already loaded, get the classes resourcePack
+     and return it"
+
+    ClassResources isNil ifTrue:[
+	ClassResources := ResourcePack for:self.
+    ].
+    ^ ClassResources
+!
+
+classResources:aResourcePack
+    "allow setting of the classResources"
+
+    ClassResources := aResourcePack
+!
+
+flushAllClassResources
+    "flush all classes resource translations.
+     Needed after a resource file / language setting has changed."
+
+    ResourcePack flushCachedResourcePacks.
+    self flushClassResources.
+    self allSubclassesDo:[:aClass |
+	aClass flushClassResources.
+    ]
+!
+
+flushClassResources
+    "flush classes resource string translations.
+     Needed whenever a resource file / language setting has changed"
+
+    ClassResources := nil.
+! !
+
+!ApplicationModel methodsFor:'initialization'!
+
+initialize
+    super initialize.
+    resources := self class classResources.
+! !