VDBAbstractListApplication.st
changeset 72 4e8268dabaf7
parent 62 8a52495c2108
child 78 5b61031de9a7
--- a/VDBAbstractListApplication.st	Wed Apr 04 23:16:30 2018 +0100
+++ b/VDBAbstractListApplication.st	Mon Apr 09 21:43:54 2018 +0100
@@ -56,10 +56,12 @@
     ^ 
     #(FullSpec
        name: windowSpec
+       uuid: '0f7dc3f0-3c2f-11e8-93ae-0021ccd5e3d3'
        window: 
       (WindowSpec
          label: 'VDBAbstractListApplication'
          name: 'VDBAbstractListApplication'
+         uuid: '0f7dc3f1-3c2f-11e8-93ae-0021ccd5e3d3'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 300)
        )
@@ -69,6 +71,7 @@
           (SelectionInListModelViewSpec
              name: 'SelectionInListModelView1'
              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+             uuid: '0f7dc3f2-3c2f-11e8-93ae-0021ccd5e3d3'
              model: internalSelectionHolder
              menu: contextMenu
              hasHorizontalScrollBar: true
@@ -77,6 +80,7 @@
              useIndex: false
              highlightMode: line
              doubleClickSelector: doDoubleClick
+             selectConditionSelector: internalCanSelect:
              postBuildCallback: postBuildInternalListView:
            )
           )
@@ -84,7 +88,7 @@
        )
      )
 
-    "Modified: / 11-07-2017 / 15:19:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 09-04-2018 / 20:52:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBAbstractListApplication class methodsFor:'menu specs'!
@@ -201,27 +205,6 @@
     ^ self == VDBAbstractListApplication.
 ! !
 
-!VDBAbstractListApplication methodsFor:'actions'!
-
-postBuildInternalListView: aView
-    <resource: #uiCallback>
-
-    | columns |
-
-    internalListView := aView.
-    internalListView font: CodeView defaultFont.
-
-    columns := self class columnsSpec.
-    columns notEmptyOrNil ifTrue:[
-        | renderer |
-
-        renderer := aView setupTableRenderer.
-        renderer columnDescriptors: columns
-    ].
-
-    "Modified: / 11-06-2017 / 22:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
 !VDBAbstractListApplication methodsFor:'aspects'!
 
 backgroundColorFor: aVDBPresenter
@@ -323,6 +306,25 @@
 
     "Created: / 18-09-2014 / 00:29:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 20-09-2014 / 23:50:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+postBuildInternalListView: aView
+    <resource: #uiCallback>
+
+    | columns |
+
+    internalListView := aView.
+    internalListView font: CodeView defaultFont.
+
+    columns := self class columnsSpec.
+    columns notEmptyOrNil ifTrue:[
+        | renderer |
+
+        renderer := aView setupTableRenderer.
+        renderer columnDescriptors: columns
+    ].
+
+    "Modified: / 11-06-2017 / 22:16:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !VDBAbstractListApplication methodsFor:'menu'!
@@ -397,8 +399,25 @@
     "Modified: / 12-06-2017 / 12:00:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!VDBAbstractListApplication methodsFor:'private'!
+
+internalCanSelect: index
+    | item |
+
+    item := internalListHolder value at: index.
+    ^self canSelect: item
+
+    "Created: / 09-04-2018 / 20:52:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !VDBAbstractListApplication methodsFor:'queries'!
 
+canSelect: anItem
+    ^ true
+
+    "Modified: / 09-04-2018 / 20:50:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 hasSelection
     ^ self internalSelectionHolder value notEmptyOrNil