Add register view to frame details application (`VDBFrameApplication`)
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 01 Oct 2018 12:11:59 +0100
changeset 112 d293d117e978
parent 111 a70313e80780
child 113 1a40f33af921
Add register view to frame details application (`VDBFrameApplication`) Finally!
VDBAbstractApplication.st
VDBFrameApplication.st
VDBRegisterListApplication.st
VDBTabbingContainer.st
VDBVariableObjectListApplication.st
--- a/VDBAbstractApplication.st	Fri Sep 28 10:09:50 2018 +0100
+++ b/VDBAbstractApplication.st	Mon Oct 01 12:11:59 2018 +0100
@@ -42,13 +42,13 @@
     s := self windowSpec.
     s do: [:e | 
         (e isArray and:[ e first == #WindowSpec ]) ifTrue:[
-            ^ e at: 3
+            ^ self resources string: (e at: 3)
         ]
     ].
     ^ self name
 
     "Created: / 16-12-2017 / 00:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 16-12-2017 / 22:32:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-10-2018 / 12:07:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBAbstractApplication class methodsFor:'accessing - defaults'!
--- a/VDBFrameApplication.st	Fri Sep 28 10:09:50 2018 +0100
+++ b/VDBFrameApplication.st	Mon Oct 01 12:11:59 2018 +0100
@@ -10,8 +10,8 @@
 
 "{ NameSpace: Smalltalk }"
 
-VDBAbstractApplication subclass:#VDBFrameApplication
-	instanceVariableNames:'frameHolder variableObjectListHolder'
+VDBTabbingContainer subclass:#VDBFrameApplication
+	instanceVariableNames:'frameHolder variableObjectListHolder registerListHolder'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'VDB-UI-Others'
@@ -30,65 +30,12 @@
 "
 ! !
 
-!VDBFrameApplication 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:VDBFrameApplication andSelector:#windowSpec
-     VDBFrameApplication new openInterface:#windowSpec
-     VDBFrameApplication open
-    "
-
-    <resource: #canvas>
+!VDBFrameApplication class methodsFor:'accessing'!
 
-    ^ 
-    #(FullSpec
-       name: windowSpec
-       uuid: 'aa3ebd80-08c8-11e8-bb5a-0021ccd5e3d3'
-       window: 
-      (WindowSpec
-         label: 'Frame'
-         name: 'Frame'
-         uuid: '8a56b5e1-08c8-11e8-bb5a-0021ccd5e3d3'
-         min: (Point 10 10)
-         bounds: (Rectangle 0 0 300 300)
-       )
-       component: 
-      (SpecCollection
-         collection: (
-          (SubCanvasSpec
-             name: 'VariableObjectList'
-             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
-             uuid: '8a56dcf0-08c8-11e8-bb5a-0021ccd5e3d3'
-             hasHorizontalScrollBar: false
-             hasVerticalScrollBar: false
-             miniScrollerVertical: false
-             majorKey: VDBVariableObjectListApplication
-             subAspectHolders: 
-            (Array
-               
-              (SubChannelInfoSpec
-                 subAspect: debuggerHolder
-                 aspect: debuggerHolder
-               ) 
-              (SubChannelInfoSpec
-                 subAspect: variableObjectListHolder
-                 aspect: variableObjectListHolder
-               )
-             )
-             createNewApplication: true
-             createNewBuilder: false
-           )
-          )
-        
-       )
-     )
+windowTitle
+    ^ self resources string: 'Frame'
+
+    "Created: / 01-10-2018 / 12:05:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBFrameApplication class methodsFor:'plugIn spec'!
@@ -156,6 +103,39 @@
     ].
 !
 
+registerListHolder
+    "return/create the 'variableObjectListHolder' value holder (automatically generated)"
+
+    registerListHolder isNil ifTrue:[
+        registerListHolder := ValueHolder with: #().
+        registerListHolder addDependent:self.
+    ].
+    ^ registerListHolder
+
+    "Created: / 01-10-2018 / 10:07:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+registerListHolder:something
+    "set the 'variableObjectListHolder' value holder (automatically generated)"
+
+    |oldValue newValue|
+
+    registerListHolder notNil ifTrue:[
+        oldValue := registerListHolder value.
+        registerListHolder removeDependent:self.
+    ].
+    registerListHolder := something.
+    registerListHolder notNil ifTrue:[
+        registerListHolder addDependent:self.
+    ].
+    newValue := registerListHolder value.
+    oldValue ~~ newValue ifTrue:[
+        self update:#value with:newValue from:registerListHolder.
+    ].
+
+    "Created: / 01-10-2018 / 10:08:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 variableObjectListHolder
     "return/create the 'variableObjectListHolder' value holder (automatically generated)"
 
@@ -189,6 +169,12 @@
 
 !VDBFrameApplication methodsFor:'change & update'!
 
+enqueueDelayedUpdateRegisterList
+    self enqueueDelayedUpdate:#delayedpdateRegisterList
+
+    "Created: / 01-10-2018 / 10:06:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 enqueueDelayedUpdateVariableObjectList
     self enqueueDelayedUpdate:#delayedUpdateVariableObjectList
 
@@ -200,11 +186,13 @@
 
     sender == frameHolder ifTrue:[ 
          self enqueueDelayedUpdateVariableObjectList.
+         self enqueueDelayedUpdateRegisterList.
          ^ self.
     ].
     super update:aspect with:param from:sender
 
     "Created: / 03-02-2018 / 09:48:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-10-2018 / 12:02:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBFrameApplication methodsFor:'change & update-delayed'!
@@ -232,6 +220,40 @@
 
     "Created: / 03-02-2018 / 07:30:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 05-07-2018 / 11:57:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+delayedpdateRegisterList
+    | frame  list |
+
+    debugger isNil ifTrue:[
+        self registerListHolder value:#().
+        ^ self.
+    ].
+    frame := frameHolder value.
+    frame isNil ifTrue:[
+        self registerListHolder value:#().
+        ^ self.
+    ].
+    list := frame registers.
+    self registerListHolder value:list.
+
+    "Created: / 01-10-2018 / 10:07:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!VDBFrameApplication methodsFor:'initialization & release'!
+
+initialize
+    super initialize.
+    self addApplication: (VDBVariableObjectListApplication new
+                            debuggerHolder: self debuggerHolder;
+                            variableObjectListHolder: self variableObjectListHolder;
+                            yourself).
+    self addApplication: (VDBRegisterListApplication new
+                            debuggerHolder: self debuggerHolder;
+                            registerListHolder: self registerListHolder;
+                            yourself)
+
+    "Created: / 01-10-2018 / 10:03:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBFrameApplication class methodsFor:'documentation'!
--- a/VDBRegisterListApplication.st	Fri Sep 28 10:09:50 2018 +0100
+++ b/VDBRegisterListApplication.st	Mon Oct 01 12:11:59 2018 +0100
@@ -33,10 +33,10 @@
 !VDBRegisterListApplication class methodsFor:'accessing'!
 
 windowTitle
-    ^ 'Registers'
+    ^ self resources string: 'Registers'
 
     "Created: / 11-07-2017 / 16:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-09-2018 / 20:32:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-10-2018 / 12:08:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBRegisterListApplication class methodsFor:'interface specs'!
--- a/VDBTabbingContainer.st	Fri Sep 28 10:09:50 2018 +0100
+++ b/VDBTabbingContainer.st	Mon Oct 01 12:11:59 2018 +0100
@@ -178,6 +178,54 @@
     "Created: / 10-06-2014 / 17:01:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!VDBTabbingContainer methodsFor:'selection'!
+
+selectApplication: anApplication
+    | component |
+
+    component := components detect:[ :each | each application == anApplication ].
+    self selectComponent: component.
+
+    "Created: / 01-10-2018 / 11:58:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selectApplicationClass: aClass
+    | component |
+
+    component := components detect:[ :each | each application class == aClass ].
+    self selectComponent: component.
+
+    "Created: / 01-10-2018 / 11:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selectComponent: aView
+    | index |
+
+    index := components indexOf: aView.
+    self assert: index ~= 0.
+    self tabSelectionIndexHolder value: index
+
+    "Created: / 01-10-2018 / 11:57:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selectedApplication
+    ^ self selectedComponent application
+
+    "Created: / 01-10-2018 / 12:00:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selectedApplicationClass
+    ^ self selectedApplication class
+
+    "Created: / 01-10-2018 / 12:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selectedComponent
+    ^ components at: self tabSelectionIndexHolder value
+
+    "Created: / 01-10-2018 / 11:59:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !VDBTabbingContainer class methodsFor:'documentation'!
 
 version_HG
--- a/VDBVariableObjectListApplication.st	Fri Sep 28 10:09:50 2018 +0100
+++ b/VDBVariableObjectListApplication.st	Mon Oct 01 12:11:59 2018 +0100
@@ -33,9 +33,10 @@
 !VDBVariableObjectListApplication class methodsFor:'accessing'!
 
 windowTitle
-    ^ 'Variables'
+    ^  self resources string: 'Variables'
 
     "Created: / 11-07-2017 / 16:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 01-10-2018 / 12:08:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBVariableObjectListApplication class methodsFor:'interface specs'!