- What's the point of the inheritance check?
You are right, the inheritance check is completely useless in the
current version of Pier. A few years ago the commands to add and edit
different structure classes were different subclasses of an abstract
add and edit command. Luckily this is no longer the case and therefor
this method can be simplified to:
PRCommandsWidget>>items
| commands |
commands := self context commands.
^ self commandClasses select: [ :each | commands includes: each ]
I applied the same refactoring to PRViewsWidget which does the same
unnecessary and complicated checks.
- Shouldn't the list of commands in the widget be
a subset of the
commands allowed in the context?
Exactly, this is what the new code is doing. It takes the selected
classes in the selected order, and then removes all that are not
useable in the current context.
- Why shouldnt the widget just show the commands that
the context
allows?
To allow people to customize (see the settings of the widget) what
commands to show in what order. For example by using two different
PRCommandsWidget's you can logically split commands like Login/Logout
and Add/Edit/Remove page from each other.
Name: Pier-Seaside-lr.191
Author: lr
Time: 15 August 2007, 9:03:35 pm
UUID: 86949e29-2ca2-438d-bb37-9e8faa2cd905
Ancestors: Pier-Seaside-lr.189
- Fixed PRCommandsWidget>>items and PRViewsWidget>>items that was
doing far too much expecting a different command model that has been
dropped from pier a long time ago
- Kudos to Matthias Berth that reported this problem
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch