VDBInstructionsAndSourcePresenter.st
changeset 77 163d914fae79
child 78 5b61031de9a7
equal deleted inserted replaced
76:4c97e72ece4e 77:163d914fae79
       
     1 "
       
     2 jv:vdb - Visual / VM Debugger
       
     3 Copyright (C) 2015-now Jan Vrany
       
     4 
       
     5 This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'
       
     6 
       
     7 You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
       
     8 "
       
     9 "{ Package: 'jv:vdb' }"
       
    10 
       
    11 "{ NameSpace: Smalltalk }"
       
    12 
       
    13 VDBAbstractPresenter subclass:#VDBInstructionsAndSourcePresenter
       
    14 	instanceVariableNames:'instructionsAndSource'
       
    15 	classVariableNames:''
       
    16 	poolDictionaries:''
       
    17 	category:'VDB-Presentation'
       
    18 !
       
    19 
       
    20 !VDBInstructionsAndSourcePresenter class methodsFor:'documentation'!
       
    21 
       
    22 copyright
       
    23 "
       
    24 jv:vdb - Visual / VM Debugger
       
    25 Copyright (C) 2015-now Jan Vrany
       
    26 
       
    27 This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License'
       
    28 
       
    29 You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/
       
    30 "
       
    31 ! !
       
    32 
       
    33 !VDBInstructionsAndSourcePresenter methodsFor:'accessing'!
       
    34 
       
    35 subject
       
    36     "Return an instance of GDB object that this presenter displays."
       
    37 
       
    38     ^ instructionsAndSource
       
    39 
       
    40     "Created: / 22-06-2018 / 15:10:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    41 ! !
       
    42 
       
    43 !VDBInstructionsAndSourcePresenter methodsFor:'initialization'!
       
    44 
       
    45 setInstructionsAndSource: aGDBInstructionsAndSourceLine
       
    46     instructionsAndSource := aGDBInstructionsAndSourceLine
       
    47 
       
    48     "Created: / 22-06-2018 / 12:40:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    49 ! !
       
    50 
       
    51 !VDBInstructionsAndSourcePresenter methodsFor:'protocol-accessing'!
       
    52 
       
    53 fetchChildren
       
    54     ^ instructionsAndSource instructions collect:[ :i | VDBInstructionPresenter new setInstruction: i; parent: self ]
       
    55 
       
    56     "Created: / 22-06-2018 / 12:19:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    57 !
       
    58 
       
    59 label
       
    60     ^ instructionsAndSource file, ':  ', instructionsAndSource line printString
       
    61 
       
    62     "Created: / 22-06-2018 / 12:22:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    63 ! !
       
    64 
       
    65 !VDBInstructionsAndSourcePresenter methodsFor:'protocol-displaying'!
       
    66 
       
    67 displayLabel:aLabel h:lH on:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
       
    68     | color |
       
    69 
       
    70     color := aGC paint.
       
    71     aGC paint: Color gray.
       
    72     [
       
    73        super displayLabel:aLabel h:lH on:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
       
    74     ] ensure:[ 
       
    75         aGC paint: color.
       
    76     ].
       
    77 
       
    78     "Created: / 22-06-2018 / 15:12:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    79 ! !
       
    80 
       
    81 !VDBInstructionsAndSourcePresenter methodsFor:'testing'!
       
    82 
       
    83 isInstructionsAndSourcePresenter
       
    84     ^ true
       
    85 ! !
       
    86