Example usage for com.vaadin.server FontAwesome EXCLAMATION_CIRCLE

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

Introduction

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

Prototype

FontAwesome EXCLAMATION_CIRCLE

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

Click Source Link

Usage

From source file:org.eclipse.hawkbit.ui.filtermanagement.CreateOrUpdateFilterTable.java

License:Open Source License

private Component getStatusIcon(final Object itemId) {
    final Item row1 = getItem(itemId);
    final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1
            .getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue();
    final Label label = new LabelBuilder().name("").buildLabel();
    label.setContentMode(ContentMode.HTML);
    if (targetStatus == TargetUpdateStatus.PENDING) {
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW);
        label.setValue(FontAwesome.ADJUST.getHtml());
    } else if (targetStatus == TargetUpdateStatus.REGISTERED) {
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE);
        label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml());
    } else if (targetStatus == TargetUpdateStatus.ERROR) {
        label.setDescription(i18n.getMessage(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR)));
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_RED);
        label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
    } else if (targetStatus == TargetUpdateStatus.IN_SYNC) {
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN);
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC));
        label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
    } else if (targetStatus == TargetUpdateStatus.UNKNOWN) {
        label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE);
        label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN));
        label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml());
    }/*from   w  ww.  j av  a  2 s .  c om*/
    return label;
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

private Component buildDisclaimer() {
    final HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);/*from  ww w . ja v a 2  s.  c  om*/
    fields.addStyleName("disclaimer");

    final Label disclaimer = new Label(uiProperties.getDemo().getDisclaimer(), ContentMode.HTML);
    disclaimer.setCaption(i18n.getMessage("label.login.disclaimer"));
    disclaimer.setIcon(FontAwesome.EXCLAMATION_CIRCLE);
    disclaimer.setId("login-disclaimer");
    disclaimer.setWidth("525px");

    fields.addComponent(disclaimer);

    return fields;
}

From source file:org.eclipse.hawkbit.ui.management.actionhistory.ActionHistoryTable.java

License:Open Source License

/**
 * Get status icon.//from w  w w.jav a 2  s  .co  m
 *
 * @param status
 *            as Status
 * @return Label as UI
 */
private Label getStatusIcon(final Action.Status status) {
    final Label label = new LabelBuilder().name("").buildLabel();
    final String statusIconPending = "statusIconPending";
    label.setContentMode(ContentMode.HTML);
    if (Action.Status.FINISHED == status) {
        label.setDescription(i18n.get("label.finished"));
        label.setStyleName(STATUS_ICON_GREEN);
        label.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
    } else if (Action.Status.ERROR == status) {
        label.setDescription(i18n.get("label.error"));
        label.setStyleName("statusIconRed");
        label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
    } else if (Action.Status.WARNING == status) {
        label.setStyleName("statusIconOrange");
        label.setDescription(i18n.get("label.warning"));
        label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
    } else if (Action.Status.RUNNING == status) {
        // dynamic spinner
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.running"));
        label.setValue(FontAwesome.ADJUST.getHtml());
    } else if (Action.Status.CANCELING == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.cancelling"));
        label.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
    } else if (Action.Status.CANCELED == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.cancelled"));
        label.setStyleName(STATUS_ICON_GREEN);
        label.setValue(FontAwesome.TIMES_CIRCLE.getHtml());
    } else if (Action.Status.RETRIEVED == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.retrieved"));
        label.setValue(FontAwesome.CIRCLE_O.getHtml());
    } else if (Action.Status.DOWNLOAD == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.download"));
        label.setValue(FontAwesome.CLOUD_DOWNLOAD.getHtml());
    } else if (Action.Status.SCHEDULED == status) {
        label.setStyleName(statusIconPending);
        label.setDescription(i18n.get("label.scheduled"));
        label.setValue(FontAwesome.HOURGLASS_1.getHtml());
    } else {
        label.setDescription("");
        label.setValue("");
    }
    return label;

}

From source file:org.eclipse.hawkbit.ui.management.targettable.TargetTable.java

License:Open Source License

private Label getTargetPollTime(final Object itemId) {
    final Label statusLabel = new Label();
    statusLabel.addStyleName(ValoTheme.LABEL_SMALL);
    statusLabel.setHeightUndefined();//from   w  w w. j av  a  2s.c om
    statusLabel.setContentMode(ContentMode.HTML);
    final String pollStatusToolTip = (String) getContainerDataSource().getItem(itemId)
            .getItemProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP).getValue();
    if (StringUtils.hasText(pollStatusToolTip)) {
        statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml());
        statusLabel.setDescription(pollStatusToolTip);
    } else {
        statusLabel.setValue(FontAwesome.CLOCK_O.getHtml());
        statusLabel.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_IN_TIME));
    }

    return statusLabel;
}

From source file:org.opencms.ui.dialogs.permissions.CmsPermissionView.java

License:Open Source License

/**
 * Constructor.<p>//from w ww .j ava  2  s  .com
 *
 * @param entry the access control entry
 * @param editable the editable flag
 * @param isFolder the is folder flag
 * @param inheritedFrom the inherited from path
 * @param changeHandler the change handler
 */
public CmsPermissionView(CmsAccessControlEntry entry, boolean editable, boolean isFolder, String inheritedFrom,
        PermissionChangeHandler changeHandler) {
    m_changeHandler = changeHandler;
    m_editable = editable;
    m_entry = entry;
    CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null);
    CmsObject cms = A_CmsUI.getCmsObject();
    // get name and type of the current entry
    I_CmsPrincipal principal;
    try {
        principal = CmsPrincipal.readPrincipalIncludingHistory(cms, entry.getPrincipal());
    } catch (CmsException e) {
        principal = null;
        LOG.debug(e.getLocalizedMessage(), e);
    }

    m_principalName = (principal != null) ? principal.getName() : entry.getPrincipal().toString();
    String ou = null;
    String displayName;

    int flags = 0;
    if ((principal != null) && (principal instanceof CmsHistoryPrincipal)) {
        // there is a history principal entry, handle it
        if (principal.isGroup()) {
            String niceName = OpenCms.getWorkplaceManager().translateGroupName(principal.getName(), false);
            displayName = CmsVaadinUtils.getMessageText(
                    org.opencms.security.Messages.GUI_ORGUNIT_DISPLAY_NAME_2,
                    ((CmsHistoryPrincipal) principal).getDescription(), niceName);
            ou = CmsOrganizationalUnit.getParentFqn(m_principalName);
            flags = CmsAccessControlEntry.ACCESS_FLAGS_GROUP;
        } else {
            displayName = ((CmsHistoryPrincipal) principal).getName();
            ou = CmsOrganizationalUnit.getParentFqn(m_principalName);
            flags = CmsAccessControlEntry.ACCESS_FLAGS_USER;
        }
    } else if ((principal != null) && principal.isGroup()) {
        String niceName = OpenCms.getWorkplaceManager().translateGroupName(principal.getName(), false);
        displayName = CmsVaadinUtils.getMessageText(org.opencms.security.Messages.GUI_ORGUNIT_DISPLAY_NAME_2,
                ((CmsGroup) principal).getDescription(A_CmsUI.get().getLocale()), niceName);
        ou = CmsOrganizationalUnit.getParentFqn(m_principalName);
        flags = CmsAccessControlEntry.ACCESS_FLAGS_GROUP;
    } else if ((principal != null) && principal.isUser()) {
        displayName = ((CmsUser) principal).getFullName();
        ou = CmsOrganizationalUnit.getParentFqn(m_principalName);
        flags = CmsAccessControlEntry.ACCESS_FLAGS_USER;
    } else if ((m_principalName != null)
            && m_principalName.equals(CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID.toString())) {
        m_principalName = CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME;
        displayName = CmsVaadinUtils.getMessageText(Messages.GUI_LABEL_ALLOTHERS_0);
        m_responsibleCheckbox.setVisible(false);
        flags = CmsAccessControlEntry.ACCESS_FLAGS_ALLOTHERS;
    } else if ((m_principalName != null)
            && m_principalName.equals(CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID.toString())) {
        m_principalName = CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_NAME;
        displayName = CmsVaadinUtils.getMessageText(Messages.GUI_LABEL_OVERWRITEALL_0);
        flags = CmsAccessControlEntry.ACCESS_FLAGS_OVERWRITE_ALL;
    } else {
        // check if it is the case of a role
        CmsRole role = CmsRole.valueOfId(entry.getPrincipal());
        if (role != null) {
            displayName = role.getName(A_CmsUI.get().getLocale());
            m_principalName = role.getRoleName();
            flags = CmsAccessControlEntry.ACCESS_FLAGS_ROLE;
        } else {
            displayName = entry.getPrincipal().toString();
        }
    }

    if ((flags > 0) && ((entry.getFlags() & flags) == 0)) {
        // the flag is set to the wrong principal type
        if (LOG.isErrorEnabled()) {
            LOG.error(Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.ERR_INVALID_ACE_1,
                    entry.toString()));
        }
        entry = new CmsAccessControlEntry(entry.getResource(), entry.getPrincipal(),
                entry.getAllowedPermissions(), entry.getDeniedPermissions(), (entry.getFlags() | flags));
    } else if (entry.getFlags() < CmsAccessControlEntry.ACCESS_FLAGS_USER) {
        // the flag is set to NO principal type
        if (LOG.isErrorEnabled()) {
            LOG.error(Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.ERR_INVALID_ACE_1,
                    entry.toString()));
        }
        entry = new CmsAccessControlEntry(entry.getResource(), entry.getPrincipal(),
                entry.getAllowedPermissions(), entry.getDeniedPermissions(),
                (entry.getFlags() | CmsAccessControlEntry.ACCESS_FLAGS_GROUP));
    }

    m_principalType = getEntryType(entry.getFlags(), false);

    if (m_principalName == null) {
        m_principalName = "";
    }

    FontIcon icon = null;
    boolean isOverwriteAll = false;
    switch (flags) {
    case CmsAccessControlEntry.ACCESS_FLAGS_USER:
        icon = FontAwesome.USER;
        break;
    case CmsAccessControlEntry.ACCESS_FLAGS_GROUP:
        icon = FontAwesome.GROUP;
        break;
    case CmsAccessControlEntry.ACCESS_FLAGS_ALLOTHERS:
        icon = FontAwesome.GLOBE;
        break;
    case CmsAccessControlEntry.ACCESS_FLAGS_ROLE:
        icon = FontAwesome.GRADUATION_CAP;
        break;
    case CmsAccessControlEntry.ACCESS_FLAGS_OVERWRITE_ALL:
        icon = FontAwesome.EXCLAMATION_CIRCLE;
        isOverwriteAll = true;
        break;
    default:
        icon = FontAwesome.QUESTION_CIRCLE;
    }

    m_label.setContentMode(ContentMode.HTML);
    String ouName = null;
    if (ou != null) {
        try {
            ouName = OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, ou)
                    .getDisplayName(UI.getCurrent().getLocale());
        } catch (CmsException e) {
            LOG.debug("Error reading OU name.", e);
        }
    }
    m_label.setValue(icon.getHtml() + " <b>" + displayName + "</b> "
            + entry.getPermissions().getPermissionString() + (ouName != null ? ("<br />" + ouName) : ""));
    m_label.setWidthUndefined();
    m_details.setIcon(FontAwesome.PLUS_SQUARE_O);
    m_details.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {

            toggleDetails();
        }
    });

    m_setButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {

            setPermissions();
        }
    });

    m_deleteButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {

            deletePermissionSet();
        }
    });

    if (inheritedFrom != null) {
        m_inheritedFrom.setValue(inheritedFrom);
    } else {
        m_inheritedFrom.setVisible(false);
    }

    if (isOverwriteAll) {
        setDetailButtonVisible(false);
        if (m_editable) {
            addComponent(m_deleteButton, 2);
            m_deleteButton.addStyleName("o-permissions_delete");
        }
    } else {
        // get all permissions of the current entry
        CmsPermissionSet permissions = entry.getPermissions();
        IndexedContainer container = getPermissionContainer(permissions);
        m_permissions.setContainerDataSource(container);
        m_permissions.setColumnReorderingAllowed(false);
        m_permissions.setColumnHeader(PROPERTY_LABEL, CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_0));
        m_permissions.setColumnHeader(PROPERTY_ALLOWED,
                CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_ALLOWED_0));
        m_permissions.setColumnHeader(PROPERTY_DISPLAY_ALLOWED,
                CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_ALLOWED_0));
        m_permissions.setColumnHeader(PROPERTY_DENIED,
                CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_DENIED_0));
        m_permissions.setColumnHeader(PROPERTY_DISPLAY_DENIED,
                CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_DENIED_0));

        m_permissions.setPageLength(5);
        m_permissions.setSortEnabled(false);
        if (m_editable) {
            toggleDetails();
            setDetailButtonVisible(false);
            m_permissions.setVisibleColumns(PROPERTY_LABEL, PROPERTY_ALLOWED, PROPERTY_DENIED);
            m_permissions.setTableFieldFactory(FIELD_FACTORY);
            m_permissions.setEditable(m_editable);
            m_responsibleCheckbox.setValue(isResponsible(entry.getFlags()));
            m_overwriteCheckbox.setValue(isOverWritingInherited(entry.getFlags()));
            m_inheritCheckbox.setVisible(isFolder);
            m_inheritCheckbox.setValue(Boolean.valueOf(m_entry.isInheriting()));

            m_buttonBar.setVisible(true);
        } else {
            m_permissions.setVisibleColumns(PROPERTY_LABEL, PROPERTY_DISPLAY_ALLOWED, PROPERTY_DISPLAY_DENIED);
        }
    }
}