VDBBreakpointListApplication.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 21 Jun 2019 22:54:50 +0100
changeset 175 a304c250e889
parent 161 103644ba5941
child 241 9996050286c5
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 }"

VDBAbstractTreeApplication subclass:#VDBBreakpointListApplication
	instanceVariableNames:'selectedBreakpointHolder'
	classVariableNames:''
	poolDictionaries:''
	category:'VDB-UI-Others'
!

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

!VDBBreakpointListApplication class methodsFor:'accessing'!

defaultWindowTitle
    ^ self resources string: 'Breakpoints'

    "Created: / 11-07-2017 / 16:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 03-10-2018 / 15:39:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBBreakpointListApplication class methodsFor:'interface specs'!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

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

    "
     UIPainter new openOnClass:VDBBreakpointListApplication andSelector:#windowSpec
     VDBBreakpointListApplication new openInterface:#windowSpec
     VDBBreakpointListApplication open
    "

    <resource: #canvas>

    ^ 
    #(FullSpec
       name: windowSpec
       uuid: 'bd3ef320-8c37-11e9-a7d4-606720e43e2c'
       window: 
      (WindowSpec
         label: 'VDBAbstractListApplication'
         name: 'VDBAbstractListApplication'
         uuid: '475530e1-4fae-11e9-b432-606720e43e2c'
         min: (Point 10 10)
         bounds: (Rectangle 0 0 300 577)
       )
       component: 
      (SpecCollection
         collection: (
          (VariableVerticalPanelSpec
             name: 'VariableVerticalPanel1'
             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
             uuid: '475530e2-4fae-11e9-b432-606720e43e2c'
             showHandle: true
             snapMode: both
             handlePosition: left
             component: 
            (SpecCollection
               collection: (
                (TransparentBoxSpec
                   name: 'ListBox'
                   uuid: 'bd3ef321-8c37-11e9-a7d4-606720e43e2c'
                   component: 
                  (SpecCollection
                     collection: (
                      (HierarchicalListViewSpec
                         name: 'Breakpoints'
                         layout: (LayoutFrame 0 0 0 0 0 1 0 1)
                         uuid: '475530e3-4fae-11e9-b432-606720e43e2c'
                         model: internalSelectionHolder
                         menu: contextMenu
                         hasHorizontalScrollBar: true
                         hasVerticalScrollBar: true
                         listModel: internalListHolder
                         useIndex: false
                         highlightMode: line
                         doubleClickSelector: doDoubleClick
                         showLines: false
                         useDefaultIcons: false
                         showRoot: false
                         postBuildCallback: postBuildInternalListView:
                       )
                      )
                    
                   )
                 )
                (SubCanvasSpec
                   name: 'BreakpointCanvas'
                   uuid: '475557f0-4fae-11e9-b432-606720e43e2c'
                   hasHorizontalScrollBar: false
                   hasVerticalScrollBar: false
                   majorKey: VDBBreakpointApplication
                   subAspectHolders: 
                  (Array
                     
                    (SubChannelInfoSpec
                       subAspect: breakpointHolder
                       aspect: selectedBreakpointHolder
                     ) 
                    (SubChannelInfoSpec
                       subAspect: debuggerHolder
                       aspect: debuggerHolder
                     )
                   )
                   createNewApplication: true
                   createNewBuilder: false
                 )
                )
              
             )
             handles: (Any 0.5 1.0)
           )
          )
        
       )
     )
! !

!VDBBreakpointListApplication class methodsFor:'plugIn spec'!

aspectSelectors
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

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

    "Return a description of exported aspects;
     these can be connected to aspects of an embedding application
     (if this app is embedded in a subCanvas)."

    ^ #(
        #debuggerHolder
      ).

! !

!VDBBreakpointListApplication class methodsFor:'startup-web applications'!

initialPageSpec
    "this is only required for web-applications"

    ^ self shouldImplement
!

pageSpecs
    "this is only required for web-applications"

    ^ self shouldImplement
! !

!VDBBreakpointListApplication methodsFor:'aspects'!

selectedBreakpointHolder
    "return/create the 'selectedBreakpointHolder' value holder (automatically generated)"

    selectedBreakpointHolder isNil ifTrue:[
        selectedBreakpointHolder := ValueHolder new.
    ].
    ^ selectedBreakpointHolder
!

selectedBreakpointHolder:aValueModel
    "set the 'selectedBreakpointHolder' value holder (automatically generated)"

    selectedBreakpointHolder := aValueModel.
! !

!VDBBreakpointListApplication methodsFor:'change & update-delayed'!

delayedUpdateInternalList
    | root list |

    debugger isNil ifTrue:[
        self internalListHolder root children:#().
        ^ self.
    ].  
    root := self internalListHolder root.
    list := debugger breakpoints collect:[:b | VDBBreakpointPresenter new setBreakpoint: b; parent: root ].
    root children:list.
    root expand.
    self delayedInvalidateInternalList

    "Modified: / 26-03-2019 / 10:17:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

delayedUpdateSelection
    | breakpointP |

    breakpointP := self internalSelectionHolder value.    
    self selectedBreakpointHolder value: (breakpointP notNil ifTrue:[ breakpointP breakpoint ] ifFalse:[ nil ])

    "Modified: / 10-07-2017 / 16:44:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (comment): / 12-07-2017 / 10:37:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBBreakpointListApplication methodsFor:'event handling'!

onBreakpointCreatedEvent: aGDBBreakpointCreatedEvent
    self enqueueDelayedUpdateContents.

    "Created: / 10-07-2017 / 17:59:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 14-02-2019 / 16:32:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

onBreakpointDeletedEvent: aGDBBreakpointDeletedEvent
    self enqueueDelayedUpdateContents.

    "Created: / 10-07-2017 / 17:59:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 14-02-2019 / 16:32:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

onBreakpointModifiedEvent: aGDBBreakpointModifiedEvent
    self enqueueDelayedInvalidateInternalList

    "Created: / 10-07-2017 / 18:00:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 07-10-2018 / 22:09:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBBreakpointListApplication methodsFor:'initialization & release'!

subscribe   
    "Register for debugger events. To be overrided by subclasses"

    debugger announcer  
        when: GDBBreakpointCreatedEvent  send: #onBreakpointCreatedEvent:  to: self;
        when: GDBBreakpointModifiedEvent send: #onBreakpointModifiedEvent: to: self;
        when: GDBBreakpointDeletedEvent  send: #onBreakpointDeletedEvent:  to: self.

    "Created: / 10-07-2017 / 17:59:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!VDBBreakpointListApplication class methodsFor:'documentation'!

version_HG

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