I need something like that for events in ICalMagritte
where
either duration or end has to be nil. I define a condition on
the object
(event) like this:
MACondition subclass: #ICMEventCondition
value: aCheckedMemento
^(self endOf: aCheckedMemento) isNil
or: [ (self durationOf: aCheckedMemento) isNil ]
endOf: aCheckedMemento
^aCheckedMemento cache at: ICEvent descriptionEnd
durationOf: aCheckedMemento
^aCheckedMemento cache at: ICEvent descriptionDuration
ICEvent class >> #descriptionContainer
^super descriptionContainer
addCondition: ICMEventCondition new labelled:
ICMEventCondition defaultLabel;
yourself
There are probably better ways but this works nice for me.
Cheers
Philippe
Sweet, exactly what I needed, thanks.
Ramon Leon
http://onsmalltalk.com