Example usage for com.vaadin.server FontAwesome POWER_OFF

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

Introduction

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

Prototype

FontAwesome POWER_OFF

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

Click Source Link

Usage

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

License:Open Source License

private void initLayout() {
    addStyleName("app-layout");
    setSizeFull();/*from  ww w. jav  a  2  s  .  c  o  m*/

    //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:tad.grupo7.ccamistadeslargas.AdminIndexView.java

public AdminIndexView() {
    setMenuCaption("CCAmistadesLargas - ADMIN");
    String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath()
            + "/WEB-INF/wallpaper2.jpg";
    FileResource resource = new FileResource(new File(basepath));
    Image image = new Image(null, resource);
    image.setSizeFull();//www.  j av  a 2s .c o m
    addComponent(image);
    addMenuItem("Listado", FontAwesome.LIST, () -> {
        removeAllComponents();
        addComponent(new ListadoLayout());
    });
    addMenuItem("Grafica", FontAwesome.PIE_CHART, () -> {
        removeAllComponents();
        addComponent(new GraficaLayout());
    });
    addMenuItem("Cerrar sesin", FontAwesome.POWER_OFF, () -> {
        Session.destroy();
        UI.getCurrent().getNavigator().navigateTo("");
    });
}

From source file:tad.grupo7.ccamistadeslargas.IndexView.java

public IndexView() {
    setMenuCaption("CCAmistadesLargas");
    String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath()
            + "/WEB-INF/wallpaper2.jpg";
    FileResource resource = new FileResource(new File(basepath));
    Image image = new Image(null, resource);
    image.setSizeFull();/*from  www  .j  av  a2 s.  c  om*/
    addComponent(image);
    addMenuItem("Perfil", FontAwesome.USER, () -> {
        removeAllComponents();
        addComponent(new PerfilLayout());
    });
    addMenuItem("Eventos", FontAwesome.COMPASS, () -> {
        removeAllComponents();
        addComponent(new EventosLayout());
    });
    addMenuItem("Amigos", FontAwesome.USERS, () -> {
        removeAllComponents();
        addComponent(new AmigosLayout());
    });
    addMenuItem("Cerrar sesin", FontAwesome.POWER_OFF, () -> {
        Session.destroy();
        UI.getCurrent().getNavigator().navigateTo("");
    });
}

From source file:ui.button.LogoutButton.java

License:Apache License

public LogoutButton(Integer userId, String language) {
    super("", FontAwesome.POWER_OFF);
    this.language = language;
    this.caption = Translator.getTranslation("Logout", language);
    addClickListener(this);
    setDescription(caption);/*from w  ww  . j a  v  a2  s  .com*/
}