Example usage for com.vaadin.server FontAwesome HTML5

List of usage examples for com.vaadin.server FontAwesome HTML5

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome HTML5.

Prototype

FontAwesome HTML5

To view the source code for com.vaadin.server FontAwesome HTML5.

Click Source Link

Usage

From source file:com.hybridbpm.ui.component.dashboard.ViewConfigurationLayout.java

License:Apache License

public ViewConfigurationLayout(ViewDefinition viewDefinition) {
    Design.read(this);
    this.viewDefinition = viewDefinition;
    if (this.viewDefinition != null) {
        this.viewDefinition = HybridbpmUI.getDashboardAPI().getViewDefinitionById(viewDefinition.getId());
        permissions = HybridbpmUI.getDashboardAPI().getViewPermissions(this.viewDefinition.getId().toString());
    } else {//from  w  w w  .  j  ava  2s .  c o  m
        Integer o = HybridbpmUI.getDashboardAPI().getNextViewOrder();
        this.viewDefinition = new ViewDefinition(o, "view" + o, "View " + o, FontAwesome.HTML5.name());
        permissions = HybridbpmUI.getDashboardAPI().getDefaultPermissions();
    }

    for (FontAwesome fontAwesome : FontAwesome.values()) {
        Item item = iconComboBox.addItem(fontAwesome.name());
        iconComboBox.setItemIcon(fontAwesome.name(), fontAwesome);
        iconComboBox.setItemCaption(fontAwesome.name(), fontAwesome.name());
    }
    iconComboBox.setItemCaptionMode(AbstractSelect.ItemCaptionMode.EXPLICIT);

    binder.setItemDataSource(this.viewDefinition);
    binder.bind(urlTextField, "url");
    binder.bind(titleTextField, "title");
    binder.bind(iconComboBox, "icon");
    binder.setBuffered(true);

    accessTable.addContainerProperty("role", String.class, null, "Role", null, Table.Align.LEFT);
    accessTable.addContainerProperty("canView", CheckBox.class, null, "Can view", null, Table.Align.CENTER);
    accessTable.setColumnWidth("canView", 100);
    accessTable.setVisibleColumns("role", "canView");

    for (Role role : HybridbpmUI.getAccessAPI().getAllRoles()) {
        Item item = accessTable.addItem(role);
        item.getItemProperty("role").setValue(role.getName());
        CheckBox checkBox = new CheckBox(null, containsPermission(role));
        checkBox.setEnabled(!Objects.equals(role.getName(), Role.ADMINISTRATOR));
        item.getItemProperty("canView").setValue(checkBox);
    }
}