VDBScatchPadApplication.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 21 Jun 2019 22:54:50 +0100
changeset 175 a304c250e889
child 264 23960fcb9dac
permissions -rw-r--r--
UI: add "Scratch Pad" tool which can be used by user to keep notes during debug session, to edit (configuration) files and so on.

"
jv:vdb - Visual / VM Debugger
Copyright (C) 2015-now Jan Vrany

This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'

You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
"
"{ Package: 'jv:vdb' }"

"{ NameSpace: Smalltalk }"

WorkspaceApplication subclass:#VDBScatchPadApplication
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'VDB-UI-Others'
!

!VDBScatchPadApplication class methodsFor:'documentation'!

copyright
"
jv:vdb - Visual / VM Debugger
Copyright (C) 2015-now Jan Vrany

This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'

You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
"
! !

!VDBScatchPadApplication methodsFor:'defaults'!

defaultEvaluatorSyntax
    ^nil

    "Created: / 21-06-2019 / 10:59:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

thisIsASmalltalkWorkspace
    "can be redefined in a subclass to disable smalltalk-specific menu items
     (expecco uses workspaces as scratchpads)"

    ^ BlockValue
        with:[:syntax | syntax value == SmalltalkLanguage instance ]                
        argument: self syntaxHolder

    "Created: / 20-06-2019 / 22:08:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 23-06-2019 / 12:09:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBScatchPadApplication methodsFor:'menu-actions'!

loadFile:file encoding: encodingSymbolOrNil into:textView
    "Load contents of `file` into `textView`"

    | mimetype |

    super loadFile:file encoding: encodingSymbolOrNil into:textView.
    mimetype := MIMETypes mimeTypeForFilename: file.
    mimetype = 'application/x-smalltalk-source' ifTrue:[ 
        textView editedLanguage: SmalltalkLanguage instance.
        textView codeAspect: SyntaxHighlighter codeAspectStatements.
        self syntax: SmalltalkLanguage instance.
    ] ifFalse:[ 
        textView editedLanguage: nil.
        textView codeAspect: nil.
        self syntax: nil.
    ].

    "Created: / 21-06-2019 / 10:46:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 21-06-2019 / 12:15:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBScatchPadApplication class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !