Hi guys

I would like to know if there is a pattern to build extensible menu in Spec.
For example, I extending Epicea to support pillar fileout so that I
can turn a coding section into a pillar steps of action.

I wanted to extend the epicea browser to get my menu in:
But the code is like that:

EPLogBrowserModel >> addMenuItemsForSelectedItemsIn: aMenu

  aMenu addGroup: [ :aGroup |
    self menuActionsForSelectedItems do: [ :oldStyleMenuItemArray |
         aGroup addItem: [ :anItem |
               name: oldStyleMenuItemArray first;
               description: oldStyleMenuItemArray third;
               icon: (self iconNamed: oldStyleMenuItemArray fourth);
               action: [ self perform: oldStyleMenuItemArray second ] ] ] ].

  aMenu addGroup: [ :aGroup |
     aGroup addItem: [ :anItem |
              name: 'Filters';
              icon: (self iconNamed: #smallFindIcon);
              subMenu: self filtersSubMenu ] ].

  aMenu addGroup: [ :aGroup |
        aGroup addItem: [ :anItem |
             name: 'File Out';
             description: 'Write selected entries to an Ombu file';
             icon: (self iconNamed: #smallSaveAsIcon);
             action: [ self fileOutSelection ] ] ].

EPLogBrowserModel >> menuMorphForSelectedItems

         | aMenu |
         aMenu := MenuModel new.
         showEntryItemMenu ifTrue: [ self
addMenuItemsForSelectedItemsIn: aMenu ].
         ^ aMenu buildWithSpecAsPopup

So I would like to improve Epicea but I face the problem of the limits
of Spec (presumably).
I'm thinking to add a <specMenu: 10> pragma to handle this case.
Any thought.


Reply via email to