Rich Platform project for Java web applications.
This project is maintained by aktion-hip
The service provider of the skin service (org.ripla.services.ISkinService) has to provide the skin id and the factory that create the skin instances for each UI created.
public interface ISkinService { String getSkinID(); String getSkinName(); ISkin createSkin(); }
ISkin.getSkinID() returns the skin's ID (String). The skin is registered at the application's skin registery using this ID. Note: the skin's ID has to match the name of the skin resources folder in the skin's fragment bundle (see Ripla Skins).
ISkin.getSkinName() returns the name of the skin that will be displayed e.g. in the skin select view (String).
ISkin.createSkin() supplies the skin logic, e.g. the view components to display header, footer etc. The skin resouces are provided by a fragment bundle. See Ripla Skins for more information about skin creation.
public interface ISkin { boolean hasHeader(); Component getHeader(); boolean hasFooter(); Component getFooter(); boolean hasToolBar(); Label getToolbarSeparator(); boolean hasMenuBar(); HorizontalLayout getMenuBarComponent(); HorizontalLayout getMenuBarLayout(); Resource getSubMenuIcon(); }
ISkin.hasHeader() returns true if the application should display a header view, else false (boolean).
ISkin.getHeader() returns the skin's header component, i.e. a Vaadin object.
ISkin.hasFooter() returns true if the application should display a footer view, else false (boolean).
ISkin.getFooter() returns the skin's footer component, i.e. a Vaadin object.
ISkin.hasToolBar() returns true if the application should display a tool bar, else false (boolean).
ISkin.getToolbarSeparator() returns the object displayed between the toolbar items, i.e. a Vaadin label object.
ISkin.hasMenuBar() returns true if the application should display a menu bar, else false (boolean).
ISkin.getMenuBarMedium() returns the layout component containing the menu bar. This component is added to the application's body component. This component has to contain the MenuBar. May be null for the default menu bar component.
ISkin.getMenuBar() returns the menu bar layout, i.e. a Vaadin layout component. May be null for the default menu bar layout. This layout has to be added to the MenuBarMedium. This layout is the component where the application's Vaadin MenuBar (i.e. the main menu items) is added to. In simple cases, the MenuBar layout is the MenuBarMedium.
ISkin.getSubMenuIcon() returns the icon for the sub menu, may be null. The menu items in the main menu may display an indicator for the sub menu. Such an indicator can be provided by this method.
The algorithm how the Ripla application creates the application's main menu is as follows: The application looks up the skin's menu bar medium. If none is provided, a default component is created. After that, the application creates a Vaadin menu bar object and populates it with the menu items retrieved from the use case bundles. After that, the application looks up the skin's menu bar layout. If none is provided, the menu bar object is added to the default menu bar component. Otherwise, the menu bar object is added to the menu bar layout provided by the skin. Thus, the menu bar layout has to be properly added to the menu bar medium, else, the application's main menu will not be displayed correctly.
The separation of menu bar component and layout allows the creation of stylish menu bars. See org.ripla.web.demo.skin.stylish for an example.