Skip to content

Commit

Permalink
Merge pull request #1604 from koendehondt/gh1603-menu-item-enablement
Browse files Browse the repository at this point in the history
Use a block to determine the enablement state of a menu item that is created based on a command
  • Loading branch information
jecisc authored Sep 17, 2024
2 parents 0c0d08a + 452b920 commit 5b6ba6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Spec2-Commander2/CmUICommandDisplayStrategy.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ Extension { #name : 'CmUICommandDisplayStrategy' }

{ #category : '*Spec2-Commander2' }
CmUICommandDisplayStrategy >> display: aCmSpecCommand in: aMenuOrGroupPresenter do: aBlock [

aMenuOrGroupPresenter
addItem: [ :item |
aBlock value: item.
item enabled: aCmSpecCommand canBeExecuted.
item enabled: [ aCmSpecCommand canBeExecuted ].
item ]
]

0 comments on commit 5b6ba6a

Please sign in to comment.