Example usage for com.vaadin.server FontAwesome LIST

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

Introduction

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

Prototype

FontAwesome LIST

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

Click Source Link

Usage

From source file:com.cavisson.gui.dashboard.components.controls.ValoThemeUI.java

License:Apache License

CssLayout buildMenu() {
    // Add items//from   ww  w.j  a v a 2  s.  c o  m
    menuItems.put("common", "Common UI Elements");
    menuItems.put("labels", "Labels");
    menuItems.put("buttons-and-links", "Buttons & Links");
    menuItems.put("textfields", "Text Fields");
    menuItems.put("datefields", "Date Fields");
    menuItems.put("comboboxes", "Combo Boxes");
    menuItems.put("selects", "Selects");
    menuItems.put("checkboxes", "Check Boxes & Option Groups");
    menuItems.put("sliders", "Sliders & Progress Bars");
    menuItems.put("colorpickers", "Color Pickers");
    menuItems.put("menubars", "Menu Bars");
    menuItems.put("trees", "Trees");
    menuItems.put("tables", "Tables");
    menuItems.put("dragging", "Drag and Drop");
    menuItems.put("panels", "Panels");
    menuItems.put("splitpanels", "Split Panels");
    menuItems.put("tabs", "Tabs");
    menuItems.put("accordions", "Accordions");
    menuItems.put("popupviews", "Popup Views");
    // menuItems.put("calendar", "Calendar");
    menuItems.put("forms", "Forms");

    final HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName("valo-menu-title");
    menu.addComponent(top);
    menu.addComponent(createThemeSelect());

    final Button showMenu = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            if (menu.getStyleName().contains("valo-menu-visible")) {
                menu.removeStyleName("valo-menu-visible");
            } else {
                menu.addStyleName("valo-menu-visible");
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName("valo-menu-toggle");
    showMenu.setIcon(FontAwesome.LIST);
    menu.addComponent(showMenu);

    final Label title = new Label("<h3>Vaadin <strong>Valo Theme</strong></h3>", ContentMode.HTML);
    title.setSizeUndefined();
    top.addComponent(title);
    top.setExpandRatio(title, 1);

    final MenuBar settings = new MenuBar();
    settings.addStyleName("user-menu");
    final StringGenerator sg = new StringGenerator();
    final MenuItem settingsItem = settings.addItem(
            sg.nextString(true) + " " + sg.nextString(true) + sg.nextString(false),
            new ThemeResource("../tests-valo/img/profile-pic-300px.jpg"), null);
    settingsItem.addItem("Edit Profile", null);
    settingsItem.addItem("Preferences", null);
    settingsItem.addSeparator();
    settingsItem.addItem("Sign Out", null);
    menu.addComponent(settings);

    menuItemsLayout.setPrimaryStyleName("valo-menuitems");
    menu.addComponent(menuItemsLayout);

    Label label = null;
    int count = -1;
    for (final Entry<String, String> item : menuItems.entrySet()) {
        if (item.getKey().equals("labels")) {
            label = new Label("Components", ContentMode.HTML);
            label.setPrimaryStyleName("valo-menu-subtitle");
            label.addStyleName("h4");
            label.setSizeUndefined();
            menuItemsLayout.addComponent(label);
        }
        if (item.getKey().equals("panels")) {
            label.setValue(label.getValue() + " <span class=\"valo-menu-badge\">" + count + "</span>");
            count = 0;
            label = new Label("Containers", ContentMode.HTML);
            label.setPrimaryStyleName("valo-menu-subtitle");
            label.addStyleName("h4");
            label.setSizeUndefined();
            menuItemsLayout.addComponent(label);
        }
        if (item.getKey().equals("forms")) {
            label.setValue(label.getValue() + " <span class=\"valo-menu-badge\">" + count + "</span>");
            count = 0;
            label = new Label("Other", ContentMode.HTML);
            label.setPrimaryStyleName("valo-menu-subtitle");
            label.addStyleName("h4");
            label.setSizeUndefined();
            menuItemsLayout.addComponent(label);
        }
        final Button b = new Button(item.getValue(), new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                navigator.navigateTo(item.getKey());
            }
        });
        if (count == 2) {
            b.setCaption(b.getCaption() + " <span class=\"valo-menu-badge\">123</span>");
        }
        b.setHtmlContentAllowed(true);
        b.setPrimaryStyleName("valo-menu-item");
        b.setIcon(testIcon.get());
        menuItemsLayout.addComponent(b);
        count++;
    }
    label.setValue(label.getValue() + " <span class=\"valo-menu-badge\">" + count + "</span>");

    return menu;
}

From source file:com.esofthead.mycollab.vaadin.web.ui.DepotWithChart.java

License:Open Source License

public DepotWithChart() {
    super("", new MVerticalLayout());

    toggleViewBtn = new Button(null, new Button.ClickListener() {
        @Override// ww  w  .j ava  2 s .  c o m
        public void buttonClick(Button.ClickEvent clickEvent) {
            isPlainMode = !isPlainMode;
            if (isPlainMode) {
                toggleViewBtn.setIcon(FontAwesome.BAR_CHART_O);
                toggleViewBtn.setDescription("Chart mode");
                displayPlainMode();
            } else {
                toggleViewBtn.setIcon(FontAwesome.LIST);
                toggleViewBtn.setDescription("Simple mode");
                displayChartMode();
            }
        }
    });
    toggleViewBtn.setStyleName(UIConstants.BUTTON_ICON_ONLY);
    toggleViewBtn.setIcon(FontAwesome.BAR_CHART_O);
    toggleViewBtn.setDescription("Simple mode");
    addHeaderElement(toggleViewBtn);
    setContentBorder(true);
    this.setMargin(new MarginInfo(false, false, true, false));
}

From source file:com.hybridbpm.ui.MainMenu.java

License:Apache License

public MainMenu() {
    setSizeUndefined();//from   w w w.java 2  s  . co  m
    Design.read(this);
    settingsItem = settings.addItem("", null);
    profileItem = settingsItem.addItem("Profile", this);
    settingsItem.addSeparator();
    signOutItem = settingsItem.addItem("Sign Out", this);
    valoMenuToggleButton.addClickListener(this);
    valoMenuToggleButton.setIcon(FontAwesome.LIST);
    developerButton.setIcon(FontAwesome.EYE_SLASH);
    developerButton.setDescription("Turn on developer mode");
    developerButton.addClickListener(this);
}

From source file:com.kpg.diary.ui.MenuLayout.java

License:Apache License

/**
 * Builds the menu./*from w  w  w.  j  a  v  a  2  s  .c o  m*/
 *
 * @param navigator
 *            the navigator
 * @return the css layout
 */
private CssLayout buildMenu(Navigator navigator) {
    // Add items
    menuItemsMap();
    HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    top.addStyleName(ValoTheme.MENU_TITLE);

    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName(ValoTheme.MENU_TITLE);
    menu.addComponent(top);
    // menu.addComponent(createThemeSelect());
    menu.addComponent(top);
    Button showMenu = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            if (menu.getStyleName().contains("valo-menu-visible")) {
                menu.removeStyleName("valo-menu-visible");
            } else {
                menu.addStyleName("valo-menu-visible");
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName("valo-menu-toggle");
    showMenu.setIcon(FontAwesome.LIST);
    menu.addComponent(showMenu);

    Label title = new Label("<h2>Diary</h2>", ContentMode.HTML);
    title.setSizeUndefined();
    top.addComponent(title);
    top.setExpandRatio(title, 1);
    menuItemsLayout.setPrimaryStyleName("valo-menuitems");
    menu.addComponent(menuItemsLayout);
    for (final Entry<String, String> item : menuItems.entrySet()) {
        Button b = new Button(item.getValue(), new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                navigator.navigateTo(item.getKey());
            }
        });
        b.setHtmlContentAllowed(true);
        b.setPrimaryStyleName(ValoTheme.MENU_ITEM);
        if (IConstants.NavigationMenu.ADDRESS.getKey().equals(item.getKey())) {
            b.setIcon(FontAwesome.BOOK);
        } else if (IConstants.NavigationMenu.PERSON.getKey().equals(item.getKey())) {
            b.setIcon(FontAwesome.USER);
        } else {
            b.setIcon(FontAwesome.APPLE);
        }
        menuItemsLayout.addComponent(b);
    }
    return menu;
}

From source file:com.lst.deploymentautomation.vaadin.core.AppLayout.java

License:Open Source License

private void initLayout() {
    addStyleName("app-layout");
    setSizeFull();/*from www  . j a  v  a2s .  c  om*/

    //main page layout
    layout = new CustomLayout("page");
    layout.setSizeFull();
    setCompositionRoot(layout);

    //navigation menu
    VerticalLayout navLayout = new VerticalLayout();
    navLayout.setSizeFull();
    layout.addComponent(navLayout, "usermenu");
    navigation = new NavigationMenu();
    navigation.addStyleName("navigation-menu");
    layout.addComponent(navigation, "navigation");

    final UserInfo user = ((LspsUI) UI.getCurrent()).getUser();
    LspsUI ui = (LspsUI) UI.getCurrent();

    if (user.hasRight(HumanRights.READ_ALL_TODO) || user.hasRight(HumanRights.READ_OWN_TODO)) {
        addViewItem(navigation, TodoListView.TITLE, TodoListView.ID, FontAwesome.LIST);
    }
    /*if (user.hasRight(HumanRights.ACCESS_DOCUMENTS)) {
       addViewItem(navigation, DocumentsView.TITLE, DocumentsView.ID, FontAwesome.FILE_TEXT_O);
    }
    if (user.hasRight(EngineRights.READ_MODEL) && user.hasRight(EngineRights.CREATE_MODEL_INSTANCE)) {
       addViewItem(navigation, RunModelView.TITLE, RunModelView.ID, FontAwesome.CARET_SQUARE_O_RIGHT);
    }*/

    addNavigationCommandItem(navigation, "Initialize deployment", new NavigationMenu.OpenDocumentCommand(ui, "",
            "'deployment-automation-ui'::InitiateDeploymentDoc", null), FontAwesome.PLAY);
    addNavigationCommandItem(navigation, "Deployments list",
            new NavigationMenu.OpenDocumentCommand(ui, "", "'deployment-automation-ui'::DeploymentsList", null),
            FontAwesome.LIST_OL);

    //user menu
    userMenu = new NavigationMenu();
    userMenu.addStyleName("navigation-menu");
    navLayout.addComponent(userMenu);

    addViewItem(userMenu, SettingsView.TITLE, SettingsView.ID, FontAwesome.COG);

    NavigationCommand logoutCmd = new LogoutCommand((LspsUI) getUI());
    MenuItem logout = addNavigationCommandItem(userMenu, logoutCmd.getTitle(), logoutCmd,
            FontAwesome.POWER_OFF);
    String fullName = user.getPerson().getFullName();
    logout.setDescription(ui.getMessage("nav.logout", fullName));

    boolean collapsed = user.getSettingBoolean("collapsedMenu", false);

    if (collapsed == true) {
        UI.getCurrent().addStyleName("l-menu-collapsed");
    }

    Button button = new Button("");
    button.addStyleName("l-menu-expander");
    button.addStyleName("link");
    navLayout.addComponent(button);
    button.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            boolean collapsed = user.getSettingBoolean("collapsedMenu", false);
            if (collapsed) {
                UI.getCurrent().removeStyleName("l-menu-collapsed");
            } else {
                UI.getCurrent().addStyleName("l-menu-collapsed");
            }
            user.setSetting("collapsedMenu", !collapsed);
        }
    });
}

From source file:com.mycollab.vaadin.web.ui.DepotWithChart.java

License:Open Source License

public DepotWithChart() {
    super("", new MVerticalLayout());

    toggleViewBtn = new MButton("", clickEvent -> {
        isPlainMode = !isPlainMode;/*w  w  w.j a  v  a2s.c  o m*/
        if (isPlainMode) {
            toggleViewBtn.setIcon(FontAwesome.BAR_CHART_O);
            toggleViewBtn.setDescription(UserUIContext.getMessage(GenericI18Enum.OPT_CHART_MODE));
            displayPlainMode();
        } else {
            toggleViewBtn.setIcon(FontAwesome.LIST);
            toggleViewBtn.setDescription(UserUIContext.getMessage(GenericI18Enum.OPT_SIMPLE_MODE));
            displayChartMode();
        }
    }).withIcon(FontAwesome.BAR_CHART_O).withStyleName(WebThemes.BUTTON_ICON_ONLY);
    toggleViewBtn.setDescription(UserUIContext.getMessage(GenericI18Enum.OPT_SIMPLE_MODE));
    addHeaderElement(toggleViewBtn);
    setContentBorder(true);
    this.setMargin(new MarginInfo(false, false, true, false));
}

From source file:com.selzlein.lojavirtual.vaadin.core.AppLayout.java

License:Open Source License

private void buildMenu() {
    if (user.hasRight(HumanRights.READ_ALL_TODO) || user.hasRight(HumanRights.READ_OWN_TODO)) {
        todoMenuItem = menu.addViewMenuItem(TodoListView.TITLE, TodoListView.ID, FontAwesome.LIST, todoBadge);
    }//from  w  w  w  . java2 s. co  m
    if (user.hasRight(HumanRights.ACCESS_DOCUMENTS)) {
        documentMenuItem = menu.addViewMenuItem(DocumentsView.TITLE, DocumentsView.ID, FontAwesome.FILE_TEXT_O,
                documentBadge);

    }
    if (user.hasRight(EngineRights.READ_MODEL) && user.hasRight(EngineRights.CREATE_MODEL_INSTANCE)) {
        runModelMenuItem = menu.addViewMenuItem(RunModelView.TITLE, RunModelView.ID,
                FontAwesome.CARET_SQUARE_O_RIGHT, runModelBadge);
    }

    // Examples:
    // 1. add link to a custom document but only if the user has rights to access it.
    //      if (hasRightToOpenDocument("ExampleModule::exampleDoc")) {
    //         menu.addDocumentItem("example", "ExampleModule::exampleDoc", null, FontAwesome.ADN, null);
    //      }

    // 2. run model instance
    //      menu.addRunModelItem("example2", "ExampleModule", null, FontAwesome.ADJUST, null);

    // 3. menu separator
    //      menu.addMenuSeparator("example", 123);
}

From source file:com.selzlein.lojavirtual.vaadin.core.NavigationMenu.java

License:Open Source License

private void buildTopMenu() {
    final HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName("valo-menu-title");
    final Label title = new Label("<h3>LSPS <strong>ProcessApplication</strong></h3>", ContentMode.HTML);
    title.setSizeUndefined();/* w w w. j av a  2 s  .  com*/
    top.addComponent(title);
    top.setExpandRatio(title, 1);
    this.addComponent(top);

    final NavigationMenu menuWrapp = this;
    final Button showMenu = new Button("Menu", new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final ClickEvent event) {
            if (menuWrapp.getStyleName().contains("valo-menu-visible")) {
                menuWrapp.removeStyleName("valo-menu-visible");
            } else {
                menuWrapp.addStyleName("valo-menu-visible");
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName("valo-menu-toggle");
    showMenu.setIcon(FontAwesome.LIST);
    this.addComponent(showMenu);
}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.DashboardMenu.java

private Component buildToggleButton() {
    Button valoMenuToggleButton = new Button("Menu", new ClickListener() {
        @Override/*w  w  w. j ava 2  s  . co  m*/
        public void buttonClick(final ClickEvent event) {
            if (getCompositionRoot().getStyleName().contains(STYLE_VISIBLE)) {
                getCompositionRoot().removeStyleName(STYLE_VISIBLE);
            } else {
                getCompositionRoot().addStyleName(STYLE_VISIBLE);
            }
        }
    });
    valoMenuToggleButton.setIcon(FontAwesome.LIST);
    valoMenuToggleButton.addStyleName("valo-menu-toggle");
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    valoMenuToggleButton.addStyleName(ValoTheme.BUTTON_SMALL);
    return valoMenuToggleButton;
}

From source file:de.kaiserpfalzEdv.vaadin.about.AboutViewImpl.java

License:Apache License

private void initializeModuleVersions() {
    versionLayout = createVerticalLayout("about.modules.caption", "about.modules.description",
            FontAwesome.LIST);

    BeanItemContainer<ModuleVersion> data = new BeanItemContainer<>(ModuleVersion.class);
    data.addAll(versions);/*from  w ww.  j a  v  a 2 s  .  co m*/

    Grid display = new Grid(data);
    display.setSizeFull();
    display.setFrozenColumnCount(1);
    display.setColumns("caption", "description", "version");

    formatColumn(display, "caption", "about.modules", 25);
    formatColumn(display, "description", "about.modules", 50);
    formatColumn(display, "version", "about.modules", 25);
    versionLayout.addComponent(display);
}