Example usage for com.vaadin.server FontAwesome ENVELOPE_O

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

Introduction

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

Prototype

FontAwesome ENVELOPE_O

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

Click Source Link

Usage

From source file:annis.gui.components.ExceptionDialog.java

License:Apache License

public ExceptionDialog(Throwable ex, String caption) {
    this.cause = ex;
    Preconditions.checkNotNull(ex);//from ww  w . j  av a  2  s  .co  m

    layout = new VerticalLayout();
    setContent(layout);
    layout.setWidth("100%");
    layout.setHeight("-1");

    if (caption == null) {
        setCaption("Unexpected error");
    } else {
        setCaption(caption);
    }

    Label lblInfo = new Label("An unexpected error occured.<br />The error message was:", ContentMode.HTML);
    lblInfo.setHeight("-1px");
    lblInfo.setWidth("100%");
    layout.addComponent(lblInfo);
    lblInfo.addStyleName("exception-message-caption");

    String message = ex.getMessage();
    if (message == null || message.isEmpty()) {
        message = "<no message>";
    }
    Label lblMessage = new Label(message);
    lblMessage.addStyleName("exception-message-content");
    lblMessage.setHeight("-1px");
    lblMessage.setWidth("100%");
    layout.addComponent(lblMessage);

    actionsLayout = new HorizontalLayout();
    actionsLayout.addStyleName("exception-dlg-details");
    actionsLayout.setWidth("100%");
    actionsLayout.setHeight("-1px");
    layout.addComponent(actionsLayout);

    btDetails = new Button("Show Details", this);
    btDetails.setStyleName(BaseTheme.BUTTON_LINK);
    actionsLayout.addComponent(btDetails);

    btReportBug = new Button("Report Problem", this);
    btReportBug.setStyleName(BaseTheme.BUTTON_LINK);
    btReportBug.setVisible(false);
    btReportBug.setIcon(FontAwesome.ENVELOPE_O);
    UI ui = UI.getCurrent();
    if (ui instanceof AnnisUI) {
        btReportBug.setVisible(((AnnisUI) ui).canReportBugs());
    }
    actionsLayout.addComponent(btReportBug);
    actionsLayout.setComponentAlignment(btDetails, Alignment.TOP_LEFT);
    actionsLayout.setComponentAlignment(btReportBug, Alignment.TOP_RIGHT);

    lblStacktrace = new Label(Helper.convertExceptionToMessage(ex), ContentMode.PREFORMATTED);
    detailsPanel = new Panel(lblStacktrace);
    detailsPanel.setWidth("100%");
    detailsPanel.setHeight("300px");
    detailsPanel.setVisible(false);
    lblStacktrace.setSizeUndefined();
    lblStacktrace.setVisible(true);
    layout.addComponent(detailsPanel);

    btClose = new Button("OK", this);
    layout.addComponent(btClose);

    layout.setComponentAlignment(btClose, Alignment.BOTTOM_CENTER);
    layout.setExpandRatio(detailsPanel, 0.0f);
    layout.setExpandRatio(actionsLayout, 1.0f);
}

From source file:annis.gui.MainToolbar.java

License:Apache License

public MainToolbar() {

    String bugmail = (String) VaadinSession.getCurrent().getAttribute(BUG_MAIL_KEY);
    if (bugmail != null && !bugmail.isEmpty() && !bugmail.startsWith("${")
            && new EmailValidator("").isValid(bugmail)) {
        this.bugEMailAddress = bugmail;
    } else {// w w w. j av a2  s  .  c o m
        this.bugEMailAddress = null;
    }

    UI ui = UI.getCurrent();
    if (ui instanceof CommonUI) {
        ((CommonUI) ui).getSettings().addedLoadedListener(MainToolbar.this);
    }

    setWidth("100%");
    setHeight("-1px");

    addStyleName("toolbar");
    addStyleName("border-layout");

    btAboutAnnis = new Button("About ANNIS");
    btAboutAnnis.addStyleName(ValoTheme.BUTTON_SMALL);
    btAboutAnnis.setIcon(new ThemeResource("images/annis_16.png"));
    btAboutAnnis.addClickListener(new AboutClickListener());

    btSidebar = new Button();
    btSidebar.setDisableOnClick(true);
    btSidebar.addStyleName(ValoTheme.BUTTON_SMALL);
    btSidebar.setDescription("Show and hide search sidebar");
    btSidebar.setIconAlternateText(btSidebar.getDescription());

    btBugReport = new Button("Report Problem");
    btBugReport.addStyleName(ValoTheme.BUTTON_SMALL);
    btBugReport.setDisableOnClick(true);
    btBugReport.setIcon(FontAwesome.ENVELOPE_O);
    btBugReport.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            reportBug();
        }
    });
    btBugReport.setVisible(this.bugEMailAddress != null);

    btNavigate = new Button();
    btNavigate.setVisible(false);
    btNavigate.setDisableOnClick(true);
    btNavigate.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            btNavigate.setEnabled(true);
            if (navigationTarget != null) {
                UI.getCurrent().getNavigator().navigateTo(navigationTarget.state);
            }
        }
    });
    lblUserName = new Label("not logged in");
    lblUserName.setWidth("-1px");
    lblUserName.setHeight("-1px");
    lblUserName.addStyleName("right-aligned-text");

    btLogin = new Button("Login", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            showLoginWindow(false);
        }
    });

    btLogout = new Button("Logout", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            // logout
            Helper.setUser(null);
            for (LoginListener l : loginListeners) {
                l.onLogout();
            }
            Notification.show("Logged out", Notification.Type.TRAY_NOTIFICATION);
            updateUserInformation();
        }
    });

    btLogin.setSizeUndefined();
    btLogin.setStyleName(ValoTheme.BUTTON_SMALL);
    btLogin.setIcon(FontAwesome.USER);

    btLogout.setSizeUndefined();
    btLogout.setStyleName(ValoTheme.BUTTON_SMALL);
    btLogout.setIcon(FontAwesome.USER);

    btOpenSource = new Button("Help us to make ANNIS better!");
    btOpenSource.setStyleName(BaseTheme.BUTTON_LINK);
    btOpenSource.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            Window w = new HelpUsWindow();
            w.setCaption("Help us to make ANNIS better!");
            w.setModal(true);
            w.setResizable(true);
            w.setWidth("600px");
            w.setHeight("500px");
            UI.getCurrent().addWindow(w);
            w.center();
        }
    });

    addComponent(btSidebar);
    setComponentAlignment(btSidebar, Alignment.MIDDLE_LEFT);

    addComponent(btAboutAnnis);
    addComponent(btBugReport);
    addComponent(btNavigate);

    addComponent(btOpenSource);

    setSpacing(true);
    setComponentAlignment(btAboutAnnis, Alignment.MIDDLE_LEFT);
    setComponentAlignment(btBugReport, Alignment.MIDDLE_LEFT);
    setComponentAlignment(btNavigate, Alignment.MIDDLE_LEFT);

    setComponentAlignment(btOpenSource, Alignment.MIDDLE_CENTER);
    setExpandRatio(btOpenSource, 1.0f);

    addLoginButton();

    btSidebar.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            btSidebar.setEnabled(true);

            // decide new state
            switch (sidebarState) {
            case VISIBLE:
                if (event.isCtrlKey()) {
                    sidebarState = SidebarState.AUTO_VISIBLE;
                } else {
                    sidebarState = SidebarState.HIDDEN;
                }
                break;
            case HIDDEN:
                if (event.isCtrlKey()) {
                    sidebarState = SidebarState.AUTO_HIDDEN;
                } else {
                    sidebarState = SidebarState.VISIBLE;
                }
                break;

            case AUTO_VISIBLE:
                if (event.isCtrlKey()) {
                    sidebarState = SidebarState.VISIBLE;
                } else {
                    sidebarState = SidebarState.AUTO_HIDDEN;
                }
                break;
            case AUTO_HIDDEN:
                if (event.isCtrlKey()) {
                    sidebarState = SidebarState.HIDDEN;
                } else {
                    sidebarState = SidebarState.AUTO_VISIBLE;
                }
                break;
            }

            updateSidebarState();
        }
    });

    screenshotExtension = new ScreenshotMaker(this);

    JavaScript.getCurrent().addFunction("annis.gui.logincallback", new LoginCloseCallback());

    updateSidebarState();
    MainToolbar.this.updateUserInformation();
}

From source file:com.esofthead.mycollab.module.crm.view.account.AccountListViewImpl.java

License:Open Source License

@Override
protected DefaultMassItemActionHandlersContainer createActionControls() {
    DefaultMassItemActionHandlersContainer container = new DefaultMassItemActionHandlersContainer();

    if (AppContext.canAccess(RolePermissionCollections.CRM_ACCOUNT)) {
        container.addActionItem(MassItemActionHandler.DELETE_ACTION, FontAwesome.TRASH_O, "delete",
                AppContext.getMessage(GenericI18Enum.BUTTON_DELETE));
    }// w w  w  . j a  v  a 2  s .  c o m

    container.addActionItem(MassItemActionHandler.MAIL_ACTION, FontAwesome.ENVELOPE_O, "mail",
            AppContext.getMessage(GenericI18Enum.BUTTON_MAIL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_PDF_ACTION, FontAwesome.FILE_PDF_O, "export",
            "export.pdf", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_EXCEL_ACTION, FontAwesome.FILE_EXCEL_O,
            "export", "export.xlsx", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_EXCEL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_CSV_ACTION, FontAwesome.FILE_TEXT_O, "export",
            "export.csv", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_CSV));

    if (AppContext.canWrite(RolePermissionCollections.CRM_ACCOUNT)) {
        container.addActionItem(MassItemActionHandler.MASS_UPDATE_ACTION, FontAwesome.DATABASE, "update",
                AppContext.getMessage(GenericI18Enum.TOOLTIP_MASS_UPDATE));
    }

    return container;
}

From source file:com.esofthead.mycollab.module.crm.view.activity.ActivityListViewImpl.java

License:Open Source License

@Override
protected DefaultMassItemActionHandlersContainer createActionControls() {
    DefaultMassItemActionHandlersContainer container = new DefaultMassItemActionHandlersContainer();
    if (AppContext.canAccess(RolePermissionCollections.CRM_CALL)
            || AppContext.canAccess(RolePermissionCollections.CRM_MEETING)
            || AppContext.canAccess(RolePermissionCollections.CRM_TASK)) {

        container.addActionItem(MassItemActionHandler.DELETE_ACTION, FontAwesome.TRASH_O, "delete",
                AppContext.getMessage(GenericI18Enum.BUTTON_DELETE));
    }/*from w ww. java  2  s.  c  o m*/

    container.addActionItem(MassItemActionHandler.MAIL_ACTION, FontAwesome.ENVELOPE_O, "mail",
            AppContext.getMessage(GenericI18Enum.BUTTON_MAIL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_PDF_ACTION, FontAwesome.FILE_PDF_O, "export",
            "export.pdf", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_EXCEL_ACTION, FontAwesome.FILE_EXCEL_O,
            "export", "export.xlsx", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_EXCEL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_CSV_ACTION, FontAwesome.FILE_TEXT_O, "export",
            "export.csv", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_CSV));

    return container;
}

From source file:com.esofthead.mycollab.module.crm.view.campaign.CampaignListViewImpl.java

License:Open Source License

@Override
protected DefaultMassItemActionHandlersContainer createActionControls() {
    DefaultMassItemActionHandlersContainer container = new DefaultMassItemActionHandlersContainer();

    if (AppContext.canAccess(RolePermissionCollections.CRM_CAMPAIGN)) {
        container.addActionItem(MassItemActionHandler.DELETE_ACTION, FontAwesome.TRASH_O, "delete",
                AppContext.getMessage(GenericI18Enum.BUTTON_DELETE));
    }//from ww  w  .  ja  va 2  s  .  co m

    container.addActionItem(MassItemActionHandler.MAIL_ACTION, FontAwesome.ENVELOPE_O, "mail",
            AppContext.getMessage(GenericI18Enum.BUTTON_MAIL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_PDF_ACTION, FontAwesome.FILE_PDF_O, "export",
            "export.pdf", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_EXCEL_ACTION, FontAwesome.FILE_EXCEL_O,
            "export", "export.xlsx", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_EXCEL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_CSV_ACTION, FontAwesome.FILE_TEXT_O, "export",
            "export.csv", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_CSV));

    if (AppContext.canWrite(RolePermissionCollections.CRM_CAMPAIGN)) {
        container.addActionItem(MassItemActionHandler.MASS_UPDATE_ACTION, FontAwesome.DATABASE, "update",
                AppContext.getMessage(GenericI18Enum.TOOLTIP_MASS_UPDATE));
    }

    return container;
}

From source file:com.esofthead.mycollab.module.crm.view.cases.CaseListViewImpl.java

License:Open Source License

@Override
protected DefaultMassItemActionHandlersContainer createActionControls() {
    DefaultMassItemActionHandlersContainer container = new DefaultMassItemActionHandlersContainer();

    if (AppContext.canAccess(RolePermissionCollections.CRM_CASE)) {
        container.addActionItem(MassItemActionHandler.DELETE_ACTION, FontAwesome.TRASH_O, "delete",
                AppContext.getMessage(GenericI18Enum.BUTTON_DELETE));
    }/*from  ww  w .j a  v a 2 s. c  o m*/

    container.addActionItem(MassItemActionHandler.MAIL_ACTION, FontAwesome.ENVELOPE_O, "mail",
            AppContext.getMessage(GenericI18Enum.BUTTON_MAIL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_PDF_ACTION, FontAwesome.FILE_PDF_O, "export",
            "export.pdf", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_EXCEL_ACTION, FontAwesome.FILE_EXCEL_O,
            "export", "export.xlsx", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_EXCEL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_CSV_ACTION, FontAwesome.FILE_TEXT_O, "export",
            "export.csv", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_CSV));

    if (AppContext.canWrite(RolePermissionCollections.CRM_CASE)) {
        container.addActionItem(MassItemActionHandler.MASS_UPDATE_ACTION, FontAwesome.DATABASE, "update",
                AppContext.getMessage(GenericI18Enum.TOOLTIP_MASS_UPDATE));
    }

    return container;
}

From source file:com.esofthead.mycollab.module.crm.view.contact.ContactListViewImpl.java

License:Open Source License

@Override
protected DefaultMassItemActionHandlersContainer createActionControls() {
    DefaultMassItemActionHandlersContainer container = new DefaultMassItemActionHandlersContainer();

    if (AppContext.canAccess(RolePermissionCollections.CRM_CONTACT)) {
        container.addActionItem(MassItemActionHandler.DELETE_ACTION, FontAwesome.TRASH_O, "delete",
                AppContext.getMessage(GenericI18Enum.BUTTON_DELETE));
    }/*from w ww  .ja  va  2  s  .c  om*/

    container.addActionItem(MassItemActionHandler.MAIL_ACTION, FontAwesome.ENVELOPE_O, "mail",
            AppContext.getMessage(GenericI18Enum.BUTTON_MAIL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_PDF_ACTION, FontAwesome.FILE_PDF_O, "export",
            "export.pdf", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_EXCEL_ACTION, FontAwesome.FILE_EXCEL_O,
            "export", "export.xlsx", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_EXCEL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_CSV_ACTION, FontAwesome.FILE_TEXT_O, "export",
            "export.csv", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_CSV));

    if (AppContext.canWrite(RolePermissionCollections.CRM_CONTACT)) {
        container.addActionItem(MassItemActionHandler.MASS_UPDATE_ACTION, FontAwesome.DATABASE, "update",
                AppContext.getMessage(GenericI18Enum.TOOLTIP_MASS_UPDATE));
    }

    return container;
}

From source file:com.esofthead.mycollab.module.crm.view.lead.LeadListViewImpl.java

License:Open Source License

@Override
protected DefaultMassItemActionHandlersContainer createActionControls() {
    DefaultMassItemActionHandlersContainer container = new DefaultMassItemActionHandlersContainer();

    if (AppContext.canAccess(RolePermissionCollections.CRM_LEAD)) {
        container.addActionItem(MassItemActionHandler.DELETE_ACTION, FontAwesome.TRASH_O, "delete",
                AppContext.getMessage(GenericI18Enum.BUTTON_DELETE));
    }/*from   w  w w  .  j  ava 2 s .  c  om*/

    container.addActionItem(MassItemActionHandler.MAIL_ACTION, FontAwesome.ENVELOPE_O, "mail",
            AppContext.getMessage(GenericI18Enum.BUTTON_MAIL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_PDF_ACTION, FontAwesome.FILE_PDF_O, "export",
            "export.pdf", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_EXCEL_ACTION, FontAwesome.FILE_EXCEL_O,
            "export", "export.xlsx", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_EXCEL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_CSV_ACTION, FontAwesome.FILE_TEXT_O, "export",
            "export.csv", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_CSV));

    if (AppContext.canWrite(RolePermissionCollections.CRM_LEAD)) {
        container.addActionItem(MassItemActionHandler.MASS_UPDATE_ACTION, FontAwesome.DATABASE, "update",
                AppContext.getMessage(GenericI18Enum.TOOLTIP_MASS_UPDATE));
    }

    return container;
}

From source file:com.esofthead.mycollab.module.crm.view.opportunity.OpportunityListViewImpl.java

License:Open Source License

@Override
protected DefaultMassItemActionHandlersContainer createActionControls() {
    DefaultMassItemActionHandlersContainer container = new DefaultMassItemActionHandlersContainer();

    if (AppContext.canAccess(RolePermissionCollections.CRM_OPPORTUNITY)) {
        container.addActionItem(MassItemActionHandler.DELETE_ACTION, FontAwesome.TRASH_O, "delete",
                AppContext.getMessage(GenericI18Enum.BUTTON_DELETE));
    }/*from   w w  w . j  a v a  2s .com*/

    container.addActionItem(MassItemActionHandler.MAIL_ACTION, FontAwesome.ENVELOPE_O, "mail",
            AppContext.getMessage(GenericI18Enum.BUTTON_MAIL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_PDF_ACTION, FontAwesome.FILE_PDF_O, "export",
            "export.pdf", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_EXCEL_ACTION, FontAwesome.FILE_EXCEL_O,
            "export", "export.xlsx", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_EXCEL));

    container.addDownloadActionItem(MassItemActionHandler.EXPORT_CSV_ACTION, FontAwesome.FILE_TEXT_O, "export",
            "export.csv", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_CSV));

    if (AppContext.canWrite(RolePermissionCollections.CRM_OPPORTUNITY)) {
        container.addActionItem(MassItemActionHandler.MASS_UPDATE_ACTION, FontAwesome.DATABASE, "update",
                AppContext.getMessage(GenericI18Enum.TOOLTIP_MASS_UPDATE));
    }

    return container;
}

From source file:com.esofthead.mycollab.module.project.view.bug.ComponentListViewImpl.java

License:Open Source License

private ComponentContainer constructTableActionControls() {
    final CssLayout layoutWrapper = new CssLayout();
    layoutWrapper.setWidth("100%");

    final HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);/*from  ww  w. ja  v  a2 s.  co m*/
    layoutWrapper.addStyleName(UIConstants.TABLE_ACTION_CONTROLS);
    layoutWrapper.addComponent(layout);

    this.selectOptionButton = new SelectionOptionButton(this.tableItem);
    layout.addComponent(this.selectOptionButton);

    this.tableActionControls = new DefaultMassItemActionHandlersContainer();
    if (CurrentProjectVariables.canAccess(ProjectRolePermissionCollections.COMPONENTS)) {
        tableActionControls.addActionItem(MassItemActionHandler.DELETE_ACTION, FontAwesome.TRASH_O, "delete",
                AppContext.getMessage(GenericI18Enum.BUTTON_DELETE));
    }

    tableActionControls.addActionItem(MassItemActionHandler.MAIL_ACTION, FontAwesome.ENVELOPE_O, "mail",
            AppContext.getMessage(GenericI18Enum.BUTTON_MAIL));

    tableActionControls.addDownloadActionItem(MassItemActionHandler.EXPORT_PDF_ACTION, FontAwesome.FILE_PDF_O,
            "export", "export.pdf", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_PDF));

    tableActionControls.addDownloadActionItem(MassItemActionHandler.EXPORT_EXCEL_ACTION,
            FontAwesome.FILE_EXCEL_O, "export", "export.xlsx",
            AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_EXCEL));

    tableActionControls.addDownloadActionItem(MassItemActionHandler.EXPORT_CSV_ACTION, FontAwesome.FILE_TEXT_O,
            "export", "export.csv", AppContext.getMessage(GenericI18Enum.BUTTON_EXPORT_CSV));

    layout.addComponent(this.tableActionControls);
    layout.addComponent(this.selectedItemsNumberLabel);
    layout.setComponentAlignment(this.selectedItemsNumberLabel, Alignment.MIDDLE_CENTER);
    return layoutWrapper;
}