0
|
1 |
"{ Package: 'jv:statascripteditor' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Smalltalk }"
|
|
4 |
|
|
5 |
StandaloneStartup subclass:#StataScriptEditorMain
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Stata Script Editor'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!StataScriptEditorMain class methodsFor:'constants & defaults'!
|
|
14 |
|
|
15 |
applicationRegistryPath
|
|
16 |
"the key under which this application stores its process ID in the registry
|
|
17 |
as a collection of path-components.
|
|
18 |
i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored
|
|
19 |
in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID.
|
|
20 |
(would also be used as a relative path for a temporary lock file under unix).
|
|
21 |
Used to detect if another instance of this application is already running."
|
|
22 |
|
|
23 |
^ #('stx' 'StataScriptEditor')
|
|
24 |
!
|
|
25 |
|
|
26 |
applicationUUID
|
|
27 |
"answer an application-specific unique uuid.
|
|
28 |
This is used as the name of some exclusive OS-resource, which is used to find out,
|
|
29 |
if another instance of this application is already running.
|
|
30 |
Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used.
|
|
31 |
If redefined, please return a real UUID (i.e. UUID fromString:'.....') and not a string or
|
|
32 |
similar possibly conflicting identifier.
|
|
33 |
You can paste a fresh worldwide unique id via the editor's more-misc-paste UUID menuFunction."
|
|
34 |
|
|
35 |
^ UUID fromString:'9cae6e80-ad00-11e4-9cc7-606720e43e2c'
|
|
36 |
! !
|
|
37 |
|
|
38 |
!StataScriptEditorMain class methodsFor:'defaults'!
|
|
39 |
|
|
40 |
allowDebugOption
|
|
41 |
"enable/disable the --debug startup option.
|
|
42 |
Can be redefined in subclasses to enable it"
|
|
43 |
|
|
44 |
^ true
|
|
45 |
|
|
46 |
"Created: / 12-03-2015 / 02:28:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
47 |
!
|
|
48 |
|
|
49 |
suppressRCFileReading
|
|
50 |
"enable/disable the rc-file reading (and also the --rcFileName option).
|
|
51 |
If suppressed, there is no chance to interfere with the startup.
|
|
52 |
Can be redefined in subclasses to disable it"
|
|
53 |
|
|
54 |
^ true
|
|
55 |
|
|
56 |
"Created: / 12-03-2015 / 02:28:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
57 |
! !
|
|
58 |
|
|
59 |
!StataScriptEditorMain class methodsFor:'startup'!
|
|
60 |
|
|
61 |
main:argv
|
|
62 |
"main entry; argv is the array of command arguments (as array of words from space-separated command line).
|
|
63 |
Parse arguments, and proceed to the real work function"
|
|
64 |
|
|
65 |
"/ do not exit here; caller will go into event loop when returning
|
|
66 |
|
|
67 |
Smalltalk openDisplay.
|
|
68 |
StataScriptEditor open
|
|
69 |
|
|
70 |
"Modified: / 12-03-2015 / 03:16:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
71 |
!
|
|
72 |
|
|
73 |
realMain:args
|
|
74 |
"opens the application"
|
|
75 |
|
|
76 |
StataScriptEditor open
|
|
77 |
!
|
|
78 |
|
|
79 |
usage
|
|
80 |
Stderr nextPutLine:'usage: ',self applicationName,' [options...]'.
|
|
81 |
Stderr nextPutLine:' -h .................. output this message'.
|
|
82 |
|
|
83 |
Smalltalk isStandAloneApp ifTrue:[ Smalltalk exit:1 ].
|
|
84 |
! !
|
|
85 |
|
|
86 |
!StataScriptEditorMain class methodsFor:'documentation'!
|
|
87 |
|
|
88 |
version_HG
|
|
89 |
|
|
90 |
^ '$Changeset: <not expanded> $'
|
|
91 |
! !
|
|
92 |
|