So I have created a specialized SWGEditAlbumCommand
which inherit
from SW2EditPageCommand. I have also created a
SWGAlbum>>editCommand returning a new SWGEditAlbumCommand.
My problem is that 2 'Edit' links appears in the command widget.
One from SW2EditPageCommand and one from SWGEditAlbumCommand. How
can I hide the one from SW2EditPageCommand ?
That is a problem, that is not easy and nice to solve. It should work
out of the box if you directly subclass SW2EditCommand, but obviously
you want to reuse code from SW2EditPageCommand.
You might want to try something like:
SWGAlbum>>isValidCommand: aCommandClass in: aContext
^ (super isValidCommand: aCommandClass in: aContext)
and: [ aCommandClass ~= SW2EditPageCommand ].
Other question, how can I replace the 'Edit'
button on top-left of
the window (next to 'View') for it to launch my SWGEditAlbumCommand
and not SW2EditPageCommand ?
That should work with the above code, no?
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch