Interface IIconEnum

  • public interface IIconEnum
    To associate an icon to each enum option.
    For example:
            public enum Priority implements IIconEnum {  
                    LOW("transfer-down"), MEDIUM("square-medium"), HIGH("transfer-up");
                    private String icon;
                    private Priority(String icon) {
                            this.icon = icon;
                    public String getIcon() {
                            return icon;
    Just make your enum to implement IIconEnum that forces you to have a getIcon() method. This method has to return an icon id from Material Design Icons. OpenXava can use these icons in several parts of the UI.
    Javier Paniza