VDBRegisterPresenter.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 Mar 2019 14:07:49 +0000
changeset 149 adaffe052a41
parent 110 7150377a44e1
child 229 229ed681f4aa
permissions -rw-r--r--
Show log output in simple console This needed because, for example, python errors and stacktrace is reported on log stream, not on output stream.

"
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 }"

VDBAbstractPresenter subclass:#VDBRegisterPresenter
	instanceVariableNames:'register'
	classVariableNames:''
	poolDictionaries:''
	category:'VDB-Presentation'
!

!VDBRegisterPresenter 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/
"
! !

!VDBRegisterPresenter class methodsFor:'menu specs'!

contextMenu
    "This resource specification was automatically generated
     by the MenuEditor of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the MenuEditor may not be able to read the specification."


    "
     MenuEditor new openOnClass:VDBRegisterPresenter andSelector:#contextMenu
     (Menu new fromLiteralArrayEncoding:(VDBRegisterPresenter contextMenu)) startUp
    "

    <resource: #menu>

    ^ 
     #(Menu
        (
         (MenuItem
            label: 'Copy Value'
            itemValue: doCopyValue
            isVisible: true
          )
         )
        nil
        nil
      )
! !

!VDBRegisterPresenter methodsFor:'accessing'!

label
    ^ register name

    "Created: / 27-02-2015 / 15:57:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 27-09-2018 / 21:04:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

register
    ^ register

    "Created: / 27-09-2018 / 20:39:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

subject
    "Return an instance of GDB object that this presenter displays."

    ^ register

    "Modified: / 05-02-2018 / 13:08:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

tooltip
    ^ self valueString

    "Created: / 29-07-2018 / 21:35:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

value
    ^ register value

    "Created: / 02-06-2017 / 07:32:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 28-01-2018 / 22:49:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

valueString
    ^ register value

    "Created: / 11-06-2017 / 23:25:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 01-09-2018 / 00:55:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBRegisterPresenter methodsFor:'initialization'!

setRegister:aGDBRegisterWithValue 
    register := aGDBRegisterWithValue

    "Created: / 27-09-2018 / 20:38:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBRegisterPresenter methodsFor:'menu actions'!

doCopyValue
    self doCopy: register value.

    "Created: / 16-01-2018 / 23:28:56 / jv"
    "Modified: / 28-01-2018 / 22:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBRegisterPresenter methodsFor:'protocol-queries'!

hasChildren
    ^ false

    "Created: / 28-01-2018 / 22:49:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 27-09-2018 / 20:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBRegisterPresenter methodsFor:'testing'!

isRegisterPresenter
    ^ true
! !