Ripla

Rich Platform project for Java web applications.

This project is maintained by aktion-hip

Creating Toolbar Items

The toolbar item component, which is a Vaadin component, can be created either by IToolbarItem.getComponent() or by IToolbarItem.getCreator(). IToolbarItem.getComponent() returns the component directly whereas IToolbarItem.getCreator() returns a toolbar item factory org.ripla.web.interfaces.IToolbarItemCreator:

public interface IToolbarItemCreator {
    Component createToolbarItem(RiplaApplication inApplication, User inUser);    
}

The aim of the latter approach is that using the factory, item creation is done by the method IToolbarItemCreator.createToolbarItem() which receives an instance of the Ripla application and a user instance. Thus, item creation can be done depending on the application's state and/or the user's permission.