Tools__InternationalLanguageTranslationEditor.st
changeset 2047 5f9b26862c57
parent 2035 ea8ec7c3fbeb
child 2048 dcec4e818069
--- a/Tools__InternationalLanguageTranslationEditor.st	Wed May 10 17:02:35 2006 +0200
+++ b/Tools__InternationalLanguageTranslationEditor.st	Mon May 15 11:08:40 2006 +0200
@@ -432,6 +432,61 @@
       )
 ! !
 
+!InternationalLanguageTranslationEditor class methodsFor:'tableColumns specs'!
+
+keyTableColumn
+    "This resource specification was automatically generated
+     by the DataSetBuilder of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the DataSetBuilder may not be able to read the specification."
+
+    "
+     DataSetBuilder new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#keyTableColumn
+    "
+
+    <resource: #tableColumns>
+
+    ^#(
+      (DataSetColumnSpec
+         label: 'Key'
+         labelButtonType: Button
+         minWidth: 50
+         model: keyStringInRow:
+       )
+      )
+!
+
+languageTableColumn
+    "This resource specification was automatically generated
+     by the DataSetBuilder of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the DataSetBuilder may not be able to read the specification."
+
+    "
+     DataSetBuilder new openOnClass:Tools::InternationalLanguageTranslationEditor andSelector:#keyTableColumn
+    "
+
+    <resource: #tableColumns>
+
+    ^#(
+              #(DataSetColumnSpec
+                 label: #lang
+                 labelAlignment: center
+                 labelButtonType: Button
+                 minWidth: 50
+                 model: #columnInRow:at:
+                 canSelect: true
+                 isResizeable: true
+                 showRowSeparator: true
+                 showColSeparator: true
+                 backgroundSelector: #getBackgroundForRow:rowNr:col:
+               )
+
+      )
+! !
+
 !InternationalLanguageTranslationEditor methodsFor:'aspects'!
 
 keyStringAndLanguageSelectionTable
@@ -790,7 +845,7 @@
 !
 
 runApplicationAndCollectTranslations
-    |applicationClass newTranslations pseudoPack app|
+    |applicationClass newTranslations pseudoPack app startSelector|
 
     monitoredApplication notNil ifTrue:[
         monitoredApplication terminate.
@@ -804,6 +859,26 @@
                 okLabel:'OK' 
                 initialAnswer:(lastExtractedApplicationClass ? LastExtractedApplicationClass ).
     applicationClass isNil ifTrue:[^ self ].
+    applicationClass isNamespace ifTrue:[
+        Dialog warn:'Entered class is a NameSpace'.
+        ^ self.
+    ].
+
+    applicationClass isVisualStartable ifTrue:[
+        startSelector := #open
+    ] ifFalse:[
+        startSelector := Dialog
+                    request:'Entered class seems to be no application class. Ok to start using selector:'
+                    initialAnswer:((applicationClass respondsTo:#'start')
+                                        ifTrue:#'start'
+                                        ifFalse:#'new')
+                    okLabel:'START'
+                    title:'Start Application'.
+        startSelector isNil ifTrue:[
+            ^ self
+        ].
+        startSelector := startSelector asSymbol.
+    ].
 
     lastExtractedApplicationClass := LastExtractedApplicationClass := applicationClass.
 
@@ -817,7 +892,7 @@
     monitoredApplication := [
         [
             app := applicationClass new.
-            app open.
+            app perform:startSelector.
             app window waitUntilVisible.
             app window waitUntilClosed.
         ] ensure:[
@@ -1148,37 +1223,13 @@
 
     spec := OrderedCollection new.
 
-    spec add:
-      #(DataSetColumnSpec
-         label: 'Key'
-         labelAlignment: center
-         labelButtonType: Button
-         minWidth: 50
-         model: keyStringInRow:
-         isResizeable: true
-         canSelect: true
-         showRowSeparator: true
-         showColSeparator: true
-       ).
+    spec add:(self class keyTableColumn first).
 
     self shownLanguages do:[:lang |
         |entry|
 
-        entry :=
-              #(DataSetColumnSpec
-                 label: lang
-                 labelAlignment: center
-                 labelButtonType: Button
-                 minWidth: 50
-                 model: #columnInRow:at:
-                 canSelect: true
-                 isResizeable: true
-                 showRowSeparator: true
-                 showColSeparator: true
-                 backgroundSelector: #getBackgroundForRow:rowNr:col:
-               ).
-        entry := entry copy.
-        entry replaceAll:#lang with:lang.
+        entry := self class languageTableColumn first.
+        entry := entry copy replaceAll:#lang with:lang.
         spec add: entry 
     ].
     ^ spec