Skip to content
Permalink
Browse files

Merge pull request #657 from tesonep/issue/fixingEditableColumns

Issue/fixing editable columns
  • Loading branch information...
tesonep committed Jul 17, 2019
2 parents 3f3ac6d + 54b9fa0 commit c630a0ea7222228381b18083366894c1872af2aa
@@ -71,6 +71,14 @@ SpMorphicListAdapter >> hasFilter [
^ self widget submorphs anySatisfy: [ :each | each isKindOf: RubTextFieldMorph "This morph is the explicit filter of the list" ]
]

{ #category : #testing }
SpMorphicListAdapter >> isEditableRow: aRow column: aColumn [

^ (self widget dataSource
cellColumn: (self widget columns at: aColumn)
row: aRow) submorphs allSatisfy: [ :e | e asReadOnlyMorph == e ]
]

{ #category : #accessing }
SpMorphicListAdapter >> isShowColumnHeaders [

@@ -64,6 +64,14 @@ SpMorphicTableAdapter >> ensureAtLeastOneColumnIn: tableMorph [
tableMorph addColumn: (self newColumnFrom: self defaultColumn)
]

{ #category : #testing }
SpMorphicTableAdapter >> isEditableRow: aRow column: aColumn [

^ (self widget dataSource
cellColumn: (self widget columns at: aColumn)
row: aRow) submorphs allSatisfy: [ :e | e asReadOnlyMorph == e ]
]

{ #category : #testing }
SpMorphicTableAdapter >> isResizable [
^ self model isResizable
@@ -24,7 +24,7 @@ SpMorphicTableCellBuilder >> addCell: anObject column: aTableColumn [

anObject ifNil: [ ^ self ].

morph := anObject asMorph.
morph := anObject asMorph asReadOnlyMorph.
aTableColumn isExpandable ifFalse: [
morph
hResizing: #rigid;
@@ -16,7 +16,7 @@ SpAbstractListAdapterMultipleSelectionTest >> initializeTestedInstance [

presenter
beMultipleSelection;
items: #(10 20 30)
items: {10. 20. 30. 'aaa' asText}
]

{ #category : #tests }
@@ -75,6 +75,12 @@ SpAbstractListAdapterMultipleSelectionTest >> testSelectWidgetIndexRaisesSelecti
self assert: (selectedIndex includes: 1)
]

{ #category : #'tests-widget-to-model' }
SpAbstractListAdapterMultipleSelectionTest >> testStringColumnsShouldBeNonEditable [

self assert: (self adapter isEditableRow: 4 column: 1)
]

{ #category : #'tests-widget-to-model' }
SpAbstractListAdapterMultipleSelectionTest >> testSubscribeToEventDoesNotRaiseEvent [

@@ -14,5 +14,5 @@ SpTableAdapterMultipleSelectionTest >> initializeTestedInstance [

super initializeTestedInstance.

presenter addColumn: (SpStringTableColumn evaluated: [ :e | e asString ])
presenter addColumn: (SpStringTableColumn evaluated: [ :e | e ])
]

0 comments on commit c630a0e

Please sign in to comment.
You can’t perform that action at this time.