From ec8aa89b764f35f7d49c1b3dbf17a8b16361dfaf Mon Sep 17 00:00:00 2001 From: Pablo Tesone Date: Tue, 11 Oct 2016 11:16:27 +0200 Subject: [PATCH] Changing the selectionAction and selectionCondition to use enabledCondition. There is a problem in FastTable, but as soon I can fix it (publish the change) it will be working as a charm --- .../instance/selectionAction..st | 14 ++++++-------- .../instance/selectionCondition..st | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Iceberg.package/GLMGenericAction.extension/instance/selectionAction..st b/Iceberg.package/GLMGenericAction.extension/instance/selectionAction..st index 6b7d7716f7..8c58b2b076 100644 --- a/Iceberg.package/GLMGenericAction.extension/instance/selectionAction..st +++ b/Iceberg.package/GLMGenericAction.extension/instance/selectionAction..st @@ -3,11 +3,9 @@ selectionAction: actionSelector "action selector will be sent to the presentation selection. If it accepts one argument, the presentation will be sent." - ^ self action: [ :presentation | - (MessageSend - receiver: presentation selection - selector: actionSelector) - cull: presentation ]; - condition: [ :presentation | - "This is a minimal condition, that can be overriden (refined) later" - presentation selection notNil ]. + ^ self + action: [ :presentation | + presentation selection + ifNotNil: [ :sel | (MessageSend receiver: sel selector: actionSelector) cull: presentation ] ]; + enabledCondition: + [ :presentation | "This is a minimal condition, that can be overriden (refined) later" presentation selection notNil ] \ No newline at end of file diff --git a/Iceberg.package/GLMGenericAction.extension/instance/selectionCondition..st b/Iceberg.package/GLMGenericAction.extension/instance/selectionCondition..st index f5e0886f99..0e6967537f 100644 --- a/Iceberg.package/GLMGenericAction.extension/instance/selectionCondition..st +++ b/Iceberg.package/GLMGenericAction.extension/instance/selectionCondition..st @@ -3,6 +3,6 @@ selectionCondition: selectionCondition "selectionCondition can be anything that can respond #cull: such as a block or unary symbol. It will only be evaluated if the presentation has a (not nil) selected element." - ^ self condition: [ :presentation | + ^ self enabledCondition: [ :presentation | presentation selection notNil and: [ selectionCondition cull: presentation selection ]] \ No newline at end of file