Example usage for com.vaadin.server FontAwesome USER_SECRET

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

Introduction

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

Prototype

FontAwesome USER_SECRET

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

Click Source Link

Usage

From source file:com.hack23.cia.web.impl.ui.application.views.common.menufactory.impl.AbstractMenuItemFactoryImpl.java

License:Apache License

/**
 * Creates the admin menu.//  ww w.j  a va 2 s  . c o  m
 *
 * @param mainViewItem
 *            the main view item
 */
private static void createAdminMenu(final MenuItem mainViewItem) {
    if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN)) {
        final MenuItem adminMenuItem = mainViewItem.addItem(ADMIN_TEXT, FontAwesome.SERVER, null);

        final MenuItem configurationMenuItem = adminMenuItem.addItem(CONFIGURATION, FontAwesome.GEARS, null);
        configurationMenuItem.addItem(APPLICATION_CONFIGURATION, FontAwesome.GEARS, COMMAND6);

        configurationMenuItem.addItem(AGENCY, FontAwesome.SERVER, COMMAND7);
        configurationMenuItem.addItem(PORTAL, FontAwesome.SITEMAP, COMMAND8);
        configurationMenuItem.addItem(COUNTRY, FontAwesome.FLAG, COMMAND9);
        configurationMenuItem.addItem(LANGUAGE, FontAwesome.LANGUAGE, COMMAND10);
        configurationMenuItem.addItem(LANGUAGE_CONTENT, FontAwesome.FILE_TEXT, COMMAND11);

        final MenuItem managementMenuItem = adminMenuItem.addItem(MANAGEMENT, FontAwesome.SERVER, null);

        managementMenuItem.addItem(AGENT_OPERATIONS_TEXT, FontAwesome.USER_SECRET, COMMAND12);

        managementMenuItem.addItem(DATA_SUMMARY_TEXT, FontAwesome.DATABASE, COMMAND13);

        managementMenuItem.addItem("Email", FontAwesome.MAIL_FORWARD, COMMAND19);

        managementMenuItem.addItem(SYSTEM_PERFORMANCE, FontAwesome.DASHBOARD, COMMAND14);

        final MenuItem userActivityMenuItem = adminMenuItem.addItem(USER_ACTIVITY, FontAwesome.DATABASE, null);
        userActivityMenuItem.addItem(APPLICATION_SESSION, FontAwesome.LAPTOP, COMMAND15);
        userActivityMenuItem.addItem(APPLICATION_EVENT, FontAwesome.ARROWS, COMMAND16);
        userActivityMenuItem.addItem(APPLICATION_EVENT_CHARTS, FontAwesome.ARROWS, COMMAND20);

        userActivityMenuItem.addItem(USERACCOUNT, FontAwesome.GROUP, COMMAND17);

    }
}

From source file:com.hack23.cia.web.impl.ui.application.views.common.pagelinks.impl.PageLinkFactoryImpl.java

License:Apache License

@Override
public Link createAdminAgentOperationViewPageLink() {
    final Link pageLink = new Link(ADMIN_AGENT_OPERATIONS_LINK_TEXT,
            new ExternalResource(LINK_SEPARATOR + AdminViews.ADMIN_AGENT_OPERATIONVIEW_NAME));
    pageLink.setId(ViewAction.VISIT_ADMIN_AGENT_OPERATION_VIEW.name());
    pageLink.setIcon(FontAwesome.USER_SECRET);
    return pageLink;
}

From source file:com.hack23.cia.web.impl.ui.application.views.user.home.pagemode.UserHomeSecuritySettingsPageModContentFactoryImpl.java

License:Apache License

@Secured({ "ROLE_USER", "ROLE_ADMIN" })
@Override/* w ww  .  jav  a  2 s  .  c om*/
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId);

    LabelFactory.createHeader2Label(panelContent, SECURITY_SETTINGS);

    final Long userIdFromSecurityContext = UserContextUtil.getUserInternalIdFromSecurityContext();

    if (userIdFromSecurityContext == null) {
        UI.getCurrent().getNavigator().navigateTo(CommonsViews.MAIN_VIEW_NAME);
    } else {

        final Button googleAuthButton = new Button(ENABLE_GOOGLE_AUTHENTICATOR, FontAwesome.USER_SECRET);
        googleAuthButton.setId(ENABLE_GOOGLE_AUTHENTICATOR);

        final SetGoogleAuthenticatorCredentialRequest googleAuthRequest = new SetGoogleAuthenticatorCredentialRequest();
        googleAuthRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
        googleAuthButton.addClickListener(
                new SetGoogleAuthenticatorCredentialClickListener(googleAuthRequest, getApplicationManager()));

        panelContent.addComponent(googleAuthButton);

    }

    panel.setCaption(USERHOME + SECURITY_SETTINGS);

    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_USER_HOME_VIEW, ApplicationEventGroup.USER,
            NAME, parameters, pageId);

    return panelContent;

}