Rich Platform project for Java web applications.
This project is maintained by aktion-hip
As mentioned elsewhere, each use case bundle provides its menu to the application's main menu bar. Such a menu consists of at least one menu item, the menu root node, which is displayed on the menu bar. If the menu is more elaborated, the menu contains many menu items on various submenus. Such a use case menu is completely controlled by it's use case.
An extendible menu is a different kind of menu. In this case, the use case only provides the skeleton of the menu and leaves it open to other bundles to contribute their menu items to the same menu.
The Demo application's Configuration menu is an example of such an extendible menu.
An extendible menu has to be provided by a use case bundle. This bundle has to implement the IUseCase.getMenu() method (see Use Case Service) such that this method returns an extendible menu, i.e an implementation of org.ripla.interfaces.IMenuExtendible. The Ripla platform provides org.ripla.web.menu.AbstractExtendibleMenu as base class for extendible menus.
public interface IMenuExtendible extends IMenuItem { String getMenuID(); ExtendibleMenuMarker[] getMarkers(); }
IMenuExtendible.getMenuID() returns the menu's identification. Bundles that want to contribute to this extendible menu have to know its ID.
IMenuExtendible.getMarkers() returns an array of org.ripla.util.ExtendibleMenuMarkers. With a menu marker, the extendible menu can define vertex points where menu contributions can be attached. An extendible menu can define a start, additions and end vertex point for example. Bundles that want to contribute items to this menu position their contributions either before, after or appending to one of this markers. Menu markers, therefore, provide a tool to position the menu contributions provided by different bundles.
Bundles that want to provide contributions to an extendible menu have to implement service providers for org.ripla.services.IExtendibleMenuContribution.
public interface IExtendibleMenuContribution extends IMenuElement { String getExtendibleMenuID(); ExtendibleMenuMarker.Position getPosition(); }
IExtendibleMenuContribution.getExtendibleMenuID() return the ID of the extendible menu this item is provided for.
IExtendibleMenuContribution.getPosition() returns the position within the extendible menu this menu is provided for, e.g.
public class SampleMenu implements IExtendibleMenuContribution { public String getExtendibleMenuID() { return "org.ripla.web.demo.extendible"; } public Position getPosition() { return new Position(PositionType.APPEND, "start"); } //... }
In this example, the SampleMenu item contributes to the extendible menu identified by org.ripla.web.demo.extendible. The item is appended to the start marker.