177 defaultPatternLoad |
197 defaultPatternLoad |
178 ^ '*.do; *.smcl' |
198 ^ '*.do; *.smcl' |
179 |
199 |
180 "Created: / 25-10-2006 / 14:57:18 / cg" |
200 "Created: / 25-10-2006 / 14:57:18 / cg" |
181 "Modified: / 10-02-2015 / 22:33:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
201 "Modified: / 10-02-2015 / 22:33:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
202 ! ! |
|
203 |
|
204 !StataScriptEditor methodsFor:'help'! |
|
205 |
|
206 aboutThisApplicationText |
|
207 "text for an about box for this application. |
|
208 Extracts some common info (i.e. class revision, author etc.) from |
|
209 the classes documentation." |
|
210 |
|
211 ^ resources |
|
212 stringWithCRs: 'STATA Script Editor (rev %1)\\https://bitbucket.org/janvrany/jv-statascripteditor/wiki/Home\\(C) 2015 Jan Vrany' |
|
213 with: (self class revision ? '0.1') |
|
214 |
|
215 "Created: / 17-03-2015 / 04:14:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
216 ! ! |
|
217 |
|
218 !StataScriptEditor methodsFor:'hooks'! |
|
219 |
|
220 postBuildWith:aBuilder |
|
221 super postBuildWith:aBuilder. |
|
222 self window label:self windowLabelPrefix |
|
223 |
|
224 "Created: / 17-03-2015 / 04:22:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
182 ! ! |
225 ! ! |
183 |
226 |
184 !StataScriptEditor methodsFor:'menu actions'! |
227 !StataScriptEditor methodsFor:'menu actions'! |
185 |
228 |
186 menuSave |
229 menuSave |
192 "*** (and replace this comment by something more useful ;-)" |
235 "*** (and replace this comment by something more useful ;-)" |
193 |
236 |
194 "action to be added ..." |
237 "action to be added ..." |
195 |
238 |
196 Transcript showCR:self class name, ': action for #menuSave ...'. |
239 Transcript showCR:self class name, ': action for #menuSave ...'. |
|
240 ! |
|
241 |
|
242 openBug |
|
243 OperatingSystem |
|
244 openApplicationForDocument: 'https://bitbucket.org/janvrany/jv-statascripteditor/issues/new' |
|
245 operation: #open |
|
246 |
|
247 "Modified: / 17-03-2015 / 04:19:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
248 ! |
|
249 |
|
250 openDocumentation |
|
251 OperatingSystem |
|
252 openApplicationForDocument: 'https://bitbucket.org/janvrany/jv-statascripteditor/wiki/Home' |
|
253 operation: #open |
|
254 |
|
255 "Modified: / 17-03-2015 / 04:17:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
197 ! ! |
256 ! ! |
198 |
257 |
199 !StataScriptEditor methodsFor:'menu-actions'! |
258 !StataScriptEditor methodsFor:'menu-actions'! |
200 |
259 |
201 loadFile:aFileName encoding:encodingSymbolOrNil label:label |
260 loadFile:aFileName encoding:encodingSymbolOrNil label:label |
202 |file ws| |
261 |file ws| |
203 |
262 |
204 file := aFileName asFilename. |
263 file := aFileName asFilename. |
205 ws := self selectedWorkspacesTextView. |
|
206 [ |
264 [ |
207 | contents | |
265 | contents | |
208 |
266 |
209 file suffix = 'smcl' ifTrue:[ |
267 file suffix = 'smcl' ifTrue:[ |
210 contents := StataScriptLogImporter new import: file |
268 contents := StataScriptLogImporter new import: file |
211 ] ifFalse:[ |
269 ] ifFalse:[ |
212 contents := file contents. |
270 contents := file contents. |
213 ]. |
271 ]. |
|
272 |
|
273 ws := self selectedWorkspacesTextView. |
|
274 ws contents asString indexOfNonSeparator ~~ 0 ifTrue:[ |
|
275 self addWindow: self createWorkspace named: label. |
|
276 ws := self selectedWorkspacesTextView. |
|
277 ]. |
|
278 |
214 |
279 |
215 encodingSymbolOrNil notNil ifTrue:[ |
280 encodingSymbolOrNil notNil ifTrue:[ |
216 contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'. |
281 contents := contents encodeFrom:encodingSymbolOrNil into:#'unicode'. |
217 ws externalEncoding:encodingSymbolOrNil. |
282 ws externalEncoding:encodingSymbolOrNil. |
218 ]. |
283 ]. |