com.vaadin.server.FontAwesome Java Examples

The following examples show how to use com.vaadin.server.FontAwesome. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractFilterButtons.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private Object addDeleteCell(final Object itemId) {
    if (itemId instanceof TagIdName && noTagLabel.equals(((TagIdName) itemId).getName())) {
        return null;
    }

    final Button deleteButton = SPUIComponentProvider.getButton("", "", "", "", true, FontAwesome.TRASH_O,
            SPUIButtonStyleNoBorder.class);
    if (itemId instanceof TagIdName) {
        deleteButton.setId(UIComponentIdProvider.DELETE_TAG_ID + ((TagIdName) itemId).getName());
    } else {
        deleteButton.setId(UIComponentIdProvider.DELETE_TAG_ID + itemId.toString());
    }
    deleteButton.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE));
    deleteButton.addClickListener(this::addDeleteButtonClickListener);
    return deleteButton;
}
 
Example #2
Source File: ZookeeperAppManageUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if(item != null){
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperAppRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example #3
Source File: TargetTableHeader.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void addFilterTextField(final DistributionSetIdName distributionSetIdName) {
    final Button filterLabelClose = SPUIComponentProvider.getButton("drop.filter.close", "", "", "", true,
            FontAwesome.TIMES_CIRCLE, SPUIButtonStyleNoBorder.class);
    filterLabelClose.addClickListener(clickEvent -> closeFilterByDistribution());
    final Label filteredDistLabel = new Label();
    filteredDistLabel.setStyleName(ValoTheme.LABEL_COLORED + " " + ValoTheme.LABEL_SMALL);
    String name = HawkbitCommonUtil.getDistributionNameAndVersion(distributionSetIdName.getName(),
            distributionSetIdName.getVersion());
    if (name.length() > SPUITargetDefinitions.DISTRIBUTION_NAME_MAX_LENGTH_ALLOWED) {
        name = new StringBuilder(name.substring(0, SPUITargetDefinitions.DISTRIBUTION_NAME_LENGTH_ON_FILTER))
                .append("...").toString();
    }
    filteredDistLabel.setValue(name);
    filteredDistLabel.setSizeUndefined();
    getFilterDroppedInfo().removeAllComponents();
    getFilterDroppedInfo().setSizeFull();
    getFilterDroppedInfo().addComponent(filteredDistLabel);
    getFilterDroppedInfo().addComponent(filterLabelClose);
    getFilterDroppedInfo().setExpandRatio(filteredDistLabel, 1.0F);
    eventBus.publish(this, TargetFilterEvent.FILTER_BY_DISTRIBUTION);
}
 
Example #4
Source File: ZookeeperConsumerManageUI.java    From dubbo-switch with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if (item != null) {
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperConsumerRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example #5
Source File: ActionHistoryGrid.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Show confirmation window and if ok then only, force quit action.
 *
 * @param actionId
 *            as Id if the action needs to be forced.
 */
private void confirmAndForceQuitAction(final Long actionId) {
    /* Display the confirmation */
    final ConfirmationDialog confirmDialog = new ConfirmationDialog(
            i18n.getMessage("caption.forcequit.action.confirmbox"),
            i18n.getMessage("message.forcequit.action.confirm"), i18n.getMessage(UIMessageIdProvider.BUTTON_OK),
            i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), ok -> {
                if (!ok) {
                    return;
                }
                final boolean cancelResult = forceQuitActiveAction(actionId);
                if (cancelResult) {
                    populateAndUpdateTargetDetails(selectedTarget);
                    notification.displaySuccess(i18n.getMessage("message.forcequit.action.success"));
                } else {
                    notification.displayValidationError(i18n.getMessage("message.forcequit.action.failed"));
                }
            }, FontAwesome.WARNING, UIComponentIdProvider.CONFIRMATION_POPUP_ID, null);
    UI.getCurrent().addWindow(confirmDialog.getWindow());

    confirmDialog.getWindow().bringToFront();
}
 
Example #6
Source File: TargetTable.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private Label getTargetPollTime(final Object itemId) {
    final Label statusLabel = new Label();
    statusLabel.addStyleName(ValoTheme.LABEL_SMALL);
    statusLabel.setHeightUndefined();
    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;
}
 
Example #7
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout createApprovalLayout() {
    approveButtonsGroup = new OptionGroup();
    approveButtonsGroup.setId(UIComponentIdProvider.ROLLOUT_APPROVAL_OPTIONGROUP_ID);
    approveButtonsGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    approveButtonsGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    approveButtonsGroup.addStyleName("custom-option-group");
    approveButtonsGroup.addItems(Rollout.ApprovalDecision.APPROVED, Rollout.ApprovalDecision.DENIED);

    approveButtonsGroup.setItemCaption(Rollout.ApprovalDecision.APPROVED, i18n.getMessage(APPROVAL_BUTTON_LABEL));
    approveButtonsGroup.setItemIcon(Rollout.ApprovalDecision.APPROVED, FontAwesome.CHECK);
    approveButtonsGroup.setItemCaption(Rollout.ApprovalDecision.DENIED, i18n.getMessage(DENY_BUTTON_LABEL));
    approveButtonsGroup.setItemIcon(Rollout.ApprovalDecision.DENIED, FontAwesome.TIMES);

    approvalRemarkField = createTextField("label.approval.remark",
            UIComponentIdProvider.ROLLOUT_APPROVAL_REMARK_FIELD_ID, Rollout.APPROVAL_REMARK_MAX_SIZE);
    approvalRemarkField.setWidth(100.0F, Unit.PERCENTAGE);

    final HorizontalLayout layout = new HorizontalLayout(approveButtonsGroup, approvalRemarkField);
    layout.setWidth(100.0F, Unit.PERCENTAGE);
    layout.setExpandRatio(approvalRemarkField, 1.0F);
    return layout;
}
 
Example #8
Source File: ZookeeperProviderManageUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if (item != null) {
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperProviderRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example #9
Source File: ActionHistoryGrid.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private StatusFontIcon createTypeLabelMetadata(final Action action) {
    if (ActionType.FORCED == action.getActionType() || ActionType.TIMEFORCED == action.getActionType()) {
        return new StatusFontIcon(FontAwesome.BOLT, STATUS_ICON_FORCED,
                i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_FORCED),
                UIComponentIdProvider.ACTION_HISTORY_TABLE_TYPE_LABEL_ID);
    }
    if (ActionType.SOFT == action.getActionType()) {
        return new StatusFontIcon(FontAwesome.STEP_FORWARD, STATUS_ICON_SOFT,
                i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_SOFT),
                UIComponentIdProvider.ACTION_HISTORY_TABLE_TYPE_LABEL_ID);
    }
    if (ActionType.DOWNLOAD_ONLY == action.getActionType()) {
        return new StatusFontIcon(FontAwesome.DOWNLOAD, STATUS_ICON_DOWNLOAD_ONLY,
                i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_DOWNLOAD_ONLY),
                UIComponentIdProvider.ACTION_HISTORY_TABLE_TYPE_LABEL_ID);
    }
    return null;
}
 
Example #10
Source File: ZookeeperAppManageUI.java    From dubbox with Apache License 2.0 6 votes vote down vote up
/**
 * 创建删除按钮
 * @return
 */
private Button createDeleteButton() {
    Button deleteButton = new Button("删除",FontAwesome.CLOSE);
    deleteButton.addStyleName(ValoTheme.BUTTON_DANGER);
    deleteButton.addClickListener((Button.ClickListener) clickEvent -> {
        //validate
        Collection<Object> items = grid.getSelectedRows();
        if(items.size() == 0){
            Notification.show("请选中要删除的行!", Notification.Type.ERROR_MESSAGE);
            return;
        }
        //batch delete
        for (Object object : items) {
            Item item = grid.getContainerDataSource().getItem(object);
            if(item != null){
                Long id = (Long) item.getItemProperty("序号").getValue();
                zookeeperAppRepository.delete(id);
            }
        }
        search();
    });
    return deleteButton;
}
 
Example #11
Source File: UploadProgressInfoWindow.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public JsonValue encode(final String value) {
    if (value == null) {
        return super.encode(getNullRepresentation());
    }

    final String result;
    switch (value) {
    case STATUS_FINISHED:
        result = "<div class=\"statusIconGreen\">" + FontAwesome.CHECK_CIRCLE.getHtml() + "</div>";
        break;
    case STATUS_FAILED:
        result = "<div class=\"statusIconRed\">" + FontAwesome.EXCLAMATION_CIRCLE.getHtml() + "</div>";
        break;
    case STATUS_INPROGRESS:
        result = "<div class=\"statusIconActive\"></div>";
        break;
    default:
        throw new IllegalArgumentException("Argument " + value + " wasn't expected.");
    }

    return super.encode(result);
}
 
Example #12
Source File: TenantConfigurationDashboardView.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout saveConfigurationButtonsLayout() {

        final HorizontalLayout hlayout = new HorizontalLayout();
        hlayout.setSpacing(true);
        saveConfigurationBtn = SPUIComponentProvider.getButton(UIComponentIdProvider.SYSTEM_CONFIGURATION_SAVE, "", "",
                "", true, FontAwesome.SAVE, SPUIButtonStyleNoBorder.class);
        saveConfigurationBtn.setEnabled(false);
        saveConfigurationBtn.setDescription(i18n.getMessage("configuration.savebutton.tooltip"));
        saveConfigurationBtn.addClickListener(event -> saveConfiguration());
        hlayout.addComponent(saveConfigurationBtn);

        undoConfigurationBtn = SPUIComponentProvider.getButton(UIComponentIdProvider.SYSTEM_CONFIGURATION_CANCEL, "",
                "", "", true, FontAwesome.UNDO, SPUIButtonStyleNoBorder.class);
        undoConfigurationBtn.setEnabled(false);
        undoConfigurationBtn.setDescription(i18n.getMessage("configuration.cancellbutton.tooltip"));
        undoConfigurationBtn.addClickListener(event -> undoConfiguration());
        hlayout.addComponent(undoConfigurationBtn);

        final Link linkToSystemConfigHelp = SPUIComponentProvider.getHelpLink(i18n,
                uiProperties.getLinks().getDocumentation().getSystemConfigurationView());
        hlayout.addComponent(linkToSystemConfigHelp);

        return hlayout;
    }
 
Example #13
Source File: AbstractActionTypeOptionGroupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected void addForcedItemWithLabel() {
    final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.FORCED);
    forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    forceItem.setId(UIComponentIdProvider.SAVE_ACTION_RADIO_FORCED);
    addComponent(forceItem);
    final Label forceLabel = new Label();
    forceLabel.setStyleName("statusIconPending");
    forceLabel.setIcon(FontAwesome.BOLT);
    forceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_FORCED));
    forceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_FORCED_ITEM));
    forceLabel.setStyleName("padding-right-style");
    addComponent(forceLabel);
}
 
Example #14
Source File: AbstractActionTypeOptionGroupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected void addSoftItemWithLabel() {
    final FlexibleOptionGroupItemComponent softItem = actionTypeOptionGroup.getItemComponent(ActionTypeOption.SOFT);
    softItem.setId(UIComponentIdProvider.ACTION_DETAILS_SOFT_ID);
    softItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(softItem);
    final Label softLabel = new Label();
    softLabel.setSizeFull();
    softLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_SOFT));
    softLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SOFT_ITEM));
    softLabel.setStyleName("padding-right-style");
    softLabel.setIcon(FontAwesome.STEP_FORWARD);
    addComponent(softLabel);
}
 
Example #15
Source File: TargetFilterHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private SPUIButton createSearchResetIcon() {
    final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(
            UIComponentIdProvider.TARGET_FILTER_TBL_SEARCH_RESET_ID, "",
            i18n.getMessage(UIMessageIdProvider.TOOLTIP_SEARCH), null, false, FontAwesome.SEARCH,
            SPUIButtonStyleNoBorder.class);
    button.addClickListener(event -> onSearchResetClick());
    return button;

}
 
Example #16
Source File: ConfigMenuBar.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void init() {
    setId(id);
    if (!createPermission && !updatePermission && !deletePermission) {
        return;
    }
    setStyleName(ValoTheme.MENUBAR_BORDERLESS);
    addStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_POSITION);
    config = addItem("", FontAwesome.COG, null);
    config.setStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_ITEMS);
    config.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_CONFIGURE));

    addMenuItems();
}
 
Example #17
Source File: UserViewImpl.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 5 votes vote down vote up
@Override
public void postConstruct() {	
	super.postConstruct();
	
	content = new VerticalLayout();
	content.setSpacing(true);
	content.setMargin(true);
	setCompositionRoot(content);
							
	caption = new Label("This is User view", ContentMode.HTML);
	caption.addStyleName(ValoTheme.LABEL_H2);
	content.addComponent(caption);
	
	info = new Label("Invoke admin service", ContentMode.HTML);
	info.addStyleName(ValoTheme.LABEL_H2);
	content.addComponent(info);
	
	btnTest = new Button("Click me", FontAwesome.STAR);
	content.addComponent(btnTest);
	btnTest.addClickListener(new ClickListener() {
		
		@Override
		public void buttonClick(ClickEvent event) {
			mvpPresenterHandlers.callDummyService();
			
		}
	});
	
	dummyInfo = new Label("", ContentMode.HTML);
	dummyInfo.addStyleName(ValoTheme.LABEL_H2);
	content.addComponent(dummyInfo);
	
	
			
}
 
Example #18
Source File: AutoCompleteTextFieldComponent.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Shows the validation success icon in the textfield
 * 
 * @param text
 *            the text to store in the UI state object
 */
public void showValidationSuccesIcon(final String text) {
    validationIcon.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
    validationIcon.setStyleName(SPUIStyleDefinitions.SUCCESS_ICON);
    filterManagementUIState.setFilterQueryValue(text);
    filterManagementUIState.setIsFilterByInvalidFilterQuery(Boolean.FALSE);
}
 
Example #19
Source File: TargetFilterCountMessageLabel.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void displayTargetFilterMessage() {
    long totalTargets = 0;
    if (filterManagementUIState.isCreateFilterViewDisplayed() || filterManagementUIState.isEditViewDisplayed()) {
        if (filterManagementUIState.getFilterQueryValue() != null) {
            totalTargets = filterManagementUIState.getTargetsCountAll().get();
        }
        final StringBuilder targetMessage = new StringBuilder(i18n.getMessage("label.target.filtered.total"));
        if (filterManagementUIState.getTargetsTruncated() != null) {
            // set the icon
            setIcon(FontAwesome.INFO_CIRCLE);
            setDescription(i18n.getMessage("label.target.filter.truncated",
                    filterManagementUIState.getTargetsTruncated(), SPUIDefinitions.MAX_TABLE_ENTRIES));

        } else {
            setIcon(null);
            setDescription(null);
        }
        targetMessage.append(totalTargets);

        if (totalTargets > SPUIDefinitions.MAX_TABLE_ENTRIES) {
            targetMessage.append(HawkbitCommonUtil.SP_STRING_PIPE);
            targetMessage.append(i18n.getMessage("label.filter.shown"));
            targetMessage.append(SPUIDefinitions.MAX_TABLE_ENTRIES);
        }
        setCaption(targetMessage.toString());
    }
}
 
Example #20
Source File: TargetFilterTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Button getDeleteButton(final Long itemId) {
    final Item row = getItem(itemId);
    final String tfName = (String) row.getItemProperty(SPUILabelDefinitions.NAME).getValue();
    final Button deleteIcon = SPUIComponentProvider.getButton(getDeleteIconId(tfName), "",
            i18n.getMessage(UIMessageIdProvider.TOOLTIP_DELETE_CUSTOM_FILTER),
            ValoTheme.BUTTON_TINY + " " + "blueicon", true, FontAwesome.TRASH_O, SPUIButtonStyleNoBorder.class);
    deleteIcon.setData(itemId);
    deleteIcon.addClickListener(this::onDelete);
    return deleteIcon;
}
 
Example #21
Source File: TargetFilterHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Button createAddButton() {
    final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.TARGET_FILTER_ADD_ICON_ID, "",
            i18n.getMessage(UIMessageIdProvider.TOOLTIP_ADD), null, false, FontAwesome.PLUS,
            SPUIButtonStyleNoBorder.class);
    button.addClickListener(event -> addNewFilter());
    return button;

}
 
Example #22
Source File: AbstractHawkbitLoginUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Component buildDisclaimer() {
    final HorizontalLayout fields = new HorizontalLayout();
    fields.setSpacing(true);
    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;
}
 
Example #23
Source File: UploadProgressInfoWindow.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Button getCloseButton() {
    final Button closeBtn = SPUIComponentProvider.getButton(
            UIComponentIdProvider.UPLOAD_STATUS_POPUP_CLOSE_BUTTON_ID, "", "", "", true, FontAwesome.TIMES,
            SPUIButtonStyleNoBorder.class);
    closeBtn.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    closeBtn.addClickListener(event -> onClose());
    return closeBtn;
}
 
Example #24
Source File: AbstractHawkbitLoginUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildTenantField() {
    if (multiTenancyIndicator.isMultiTenancySupported()) {
        tenant = new TextField(i18n.getMessage("label.login.tenant"));
        tenant.setIcon(FontAwesome.DATABASE);
        tenant.addStyleName(
                ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
        tenant.addStyleName("uppercase");
        tenant.setId("login-tenant");
    }
}
 
Example #25
Source File: CountMessageLabel.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private StringBuilder getTotalTargetMessage() {
    if (managementUIState.getTargetsTruncated() != null) {
        setIcon(FontAwesome.INFO_CIRCLE);
        setDescription(i18n.getMessage("label.target.filter.truncated", managementUIState.getTargetsTruncated(),
                SPUIDefinitions.MAX_TABLE_ENTRIES));
    } else {
        setIcon(null);
        setDescription(null);
    }

    final StringBuilder message = new StringBuilder(i18n.getMessage("label.target.filter.count"));
    message.append(managementUIState.getTargetsCountAll());

    return message;
}
 
Example #26
Source File: DefineGroupsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Button createAddButton() {
    final Button button = SPUIComponentProvider.getButton(UIComponentIdProvider.ROLLOUT_GROUP_ADD_ID,
            i18n.getMessage("button.rollout.add.group"), "", "", true, FontAwesome.PLUS,
            SPUIButtonStyleNoBorderWithIcon.class);
    button.setSizeUndefined();
    button.addStyleName("default-color");
    button.setEnabled(true);
    button.setVisible(true);
    button.addClickListener(event -> addGroupRowAndValidate());
    return button;

}
 
Example #27
Source File: AbstractHawkbitLoginUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildPasswordField() {
    password = new PasswordField(i18n.getMessage("label.login.password"));
    password.setIcon(FontAwesome.LOCK);
    password.addStyleName(
            ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
    password.setId("login-password");
    if (isDemo && !uiProperties.getDemo().getPassword().isEmpty()) {
        password.setValue(uiProperties.getDemo().getPassword());
    }
}
 
Example #28
Source File: AbstractHawkbitLoginUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildUserField() {
    username = new TextField(i18n.getMessage("label.login.username"));
    username.setIcon(FontAwesome.USER);
    username.addStyleName(
            ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
    username.setId("login-username");
    if (isDemo && !uiProperties.getDemo().getUser().isEmpty()) {
        username.setValue(uiProperties.getDemo().getUser());
    }
}
 
Example #29
Source File: AbstractTableHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private SPUIButton createMaxMinIcon() {
    final SPUIButton button = (SPUIButton) SPUIComponentProvider.getButton(getMaxMinIconId(), "",
            i18n.getMessage(UIMessageIdProvider.TOOLTIP_MAXIMIZE), null, false, FontAwesome.EXPAND,
            SPUIButtonStyleNoBorder.class);
    button.addClickListener(event -> maxMinButtonClicked());
    return button;
}
 
Example #30
Source File: AbstractHawkbitLoginUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected Component buildLinks() {

        final HorizontalLayout links = new HorizontalLayout();
        links.setSpacing(true);
        links.addStyleName("links");
        final String linkStyle = "v-link";

        if (!uiProperties.getLinks().getDocumentation().getRoot().isEmpty()) {
            final Link docuLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_DOCUMENTATION,
                    i18n.getMessage("link.documentation.name"), uiProperties.getLinks().getDocumentation().getRoot(),
                    FontAwesome.QUESTION_CIRCLE, "_blank", linkStyle);
            links.addComponent(docuLink);
            docuLink.addStyleName(ValoTheme.LINK_SMALL);
        }

        if (!uiProperties.getLinks().getRequestAccount().isEmpty()) {
            final Link requestAccountLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_REQUESTACCOUNT,
                    i18n.getMessage("link.requestaccount.name"), uiProperties.getLinks().getRequestAccount(),
                    FontAwesome.SHOPPING_CART, "", linkStyle);
            links.addComponent(requestAccountLink);
            requestAccountLink.addStyleName(ValoTheme.LINK_SMALL);
        }

        if (!uiProperties.getLinks().getUserManagement().isEmpty()) {
            final Link userManagementLink = SPUIComponentProvider.getLink(UIComponentIdProvider.LINK_USERMANAGEMENT,
                    i18n.getMessage("link.usermanagement.name"), uiProperties.getLinks().getUserManagement(),
                    FontAwesome.USERS, "_blank", linkStyle);
            links.addComponent(userManagementLink);
            userManagementLink.addStyleName(ValoTheme.LINK_SMALL);
        }

        return links;
    }