MenuRegistration is probably missing a MenuGroupSpec object
When I see this code, I think that we are missing a MenuGroupSpec to work with MenuSpec and we could also rename PluggableMenuSpec into MenuSpec. buildMenuSpec: aMenu "recursiveley build the menu spec aMenu passed as argument" self itemList ifNotNil: [:l | | m | m := isGroup ifFalse: [PluggableMenuSpec withModel: nil] ifTrue: [aMenu]. (l reject: [:i | i precondition value not]) do: [:i | i buildMenuSpec: m]. isGroup ifFalse: [self spec subMenu: m]]. isGroup ifTrue: [self spec separator ifTrue: [self itemList ifNotNil: [self itemList last spec separator: true]]] ifFalse: [aMenu items add: self spec] https://pharo.fogbugz.com/default.asp?13044
Thatâs exactly the reason why one was introduced in Spec :) Ben On 05 Mar 2014, at 12:05, Pharo4Stef <pharo4Stef@free.fr> wrote:
When I see this code, I think that we are missing a MenuGroupSpec to work with MenuSpec and we could also rename PluggableMenuSpec into MenuSpec.
buildMenuSpec: aMenu "recursiveley build the menu spec aMenu passed as argument" self itemList ifNotNil: [:l | | m | m := isGroup ifFalse: [PluggableMenuSpec withModel: nil] ifTrue: [aMenu]. (l reject: [:i | i precondition value not]) do: [:i | i buildMenuSpec: m]. isGroup ifFalse: [self spec subMenu: m]]. isGroup ifTrue: [self spec separator ifTrue: [self itemList ifNotNil: [self itemList last spec separator: true]]] ifFalse: [aMenu items add: self spec]
On 05 Mar 2014, at 12:13, Benjamin <Benjamin.VanRyseghem.Pharo@gmail.com> wrote:
Thatâs exactly the reason why one was introduced in Spec :)
:) Now the MenuRegistation looks like an abstractBuilder I want to merge en redesign menuspec and subclasses and pluggva BTW I plan to add on/off in the menu item description to avoid to have to parse the label :) STef
Ben
On 05 Mar 2014, at 12:05, Pharo4Stef <pharo4Stef@free.fr> wrote:
When I see this code, I think that we are missing a MenuGroupSpec to work with MenuSpec and we could also rename PluggableMenuSpec into MenuSpec.
buildMenuSpec: aMenu "recursiveley build the menu spec aMenu passed as argument" self itemList ifNotNil: [:l | | m | m := isGroup ifFalse: [PluggableMenuSpec withModel: nil] ifTrue: [aMenu]. (l reject: [:i | i precondition value not]) do: [:i | i buildMenuSpec: m]. isGroup ifFalse: [self spec subMenu: m]]. isGroup ifTrue: [self spec separator ifTrue: [self itemList ifNotNil: [self itemList last spec separator: true]]] ifFalse: [aMenu items add: self spec]
participants (2)
-
Benjamin -
Pharo4Stef