From c7b733397edc8112bfa4f95a9d9cb80a12a6114f Mon Sep 17 00:00:00 2001 From: Esteban Lorenzano Date: Wed, 16 Oct 2024 15:57:57 +0200 Subject: [PATCH] fix an error, it can't answer self to indicate there is no menu --- .../SpTMorphicTableDataSourceCommons.trait.st | 3 ++- src/Spec2-Commander2/SpDynamicActionGroup.class.st | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Spec2-Adapters-Morphic/SpTMorphicTableDataSourceCommons.trait.st b/src/Spec2-Adapters-Morphic/SpTMorphicTableDataSourceCommons.trait.st index 3d5edd97..0eb29cc5 100644 --- a/src/Spec2-Adapters-Morphic/SpTMorphicTableDataSourceCommons.trait.st +++ b/src/Spec2-Adapters-Morphic/SpTMorphicTableDataSourceCommons.trait.st @@ -34,6 +34,7 @@ SpTMorphicTableDataSourceCommons >> headersByColumn [ SpTMorphicTableDataSourceCommons >> menuColumn: column row: rowIndex [ | menuPresenter | + menuPresenter := nil. "apply actions" self model actions ifNotNil: [ :actions | menuPresenter := self model newMenu. @@ -44,7 +45,7 @@ SpTMorphicTableDataSourceCommons >> menuColumn: column row: rowIndex [ self error: 'You are using contextMenu: and actions: at the same time. Both mechanisms are mutually exclusive.' ]. menuPresenter := aContextMenu ]. - menuPresenter ifNil: [ ^ self ]. + menuPresenter ifNil: [ ^ nil ]. ^ SpBindings value: self model application adapterBindings diff --git a/src/Spec2-Commander2/SpDynamicActionGroup.class.st b/src/Spec2-Commander2/SpDynamicActionGroup.class.st index d67ee11e..87c028ad 100644 --- a/src/Spec2-Commander2/SpDynamicActionGroup.class.st +++ b/src/Spec2-Commander2/SpDynamicActionGroup.class.st @@ -29,6 +29,12 @@ SpDynamicActionGroup class >> newName: aName with: aBlock [ yourself ] +{ #category : 'instance creation' } +SpDynamicActionGroup class >> with: aBlock [ + + ^ self new with: aBlock +] + { #category : 'comparing' } SpDynamicActionGroup >> = anObject [ "Answer whether the receiver and anObject represent the same object."