Example usage for com.vaadin.ui Label setStyleName

List of usage examples for com.vaadin.ui Label setStyleName

Introduction

In this page you can find the example usage for com.vaadin.ui Label setStyleName.

Prototype

@Override
    public void setStyleName(String style) 

Source Link

Usage

From source file:org.eclipse.hawkbit.ui.management.footer.ActionTypeOptionGroupLayout.java

License:Open Source License

private void createOptionGroup() {
    actionTypeOptionGroup = new FlexibleOptionGroup();
    actionTypeOptionGroup.addItem(ActionTypeOption.SOFT);
    actionTypeOptionGroup.addItem(ActionTypeOption.FORCED);
    actionTypeOptionGroup.addItem(ActionTypeOption.AUTO_FORCED);
    selectDefaultOption();//w w w .  j a v  a 2  s . com

    final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.FORCED);
    forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    // set Id for Forced radio button.
    forceItem.setId("save.action.radio.forced");
    addComponent(forceItem);
    final Label forceLabel = new Label();
    forceLabel.setStyleName("statusIconPending");
    forceLabel.setIcon(FontAwesome.BOLT);
    forceLabel.setCaption("Forced");
    forceLabel.setDescription(i18n.getMessage("tooltip.forced.item"));
    forceLabel.setStyleName("padding-right-style");
    addComponent(forceLabel);

    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("Soft");
    softLabel.setDescription(i18n.getMessage("tooltip.soft.item"));
    softLabel.setStyleName("padding-right-style");
    addComponent(softLabel);

    final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.AUTO_FORCED);
    autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    // setted Id for Time Forced radio button.
    autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED);
    addComponent(autoForceItem);
    final Label autoForceLabel = new Label();
    autoForceLabel.setStyleName("statusIconPending");
    autoForceLabel.setIcon(FontAwesome.HISTORY);
    autoForceLabel.setCaption("Time Forced");
    autoForceLabel.setDescription(i18n.getMessage("tooltip.timeforced.item"));
    autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(autoForceLabel);

    forcedTimeDateField = new DateField();
    forcedTimeDateField.setInvalidAllowed(false);
    forcedTimeDateField.setInvalidCommitted(false);
    forcedTimeDateField.setEnabled(false);
    forcedTimeDateField.setStyleName("dist-window-forcedtime");

    final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
    forcedTimeDateField.setValue(
            Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
    forcedTimeDateField.setImmediate(true);
    forcedTimeDateField.setTimeZone(tz);
    forcedTimeDateField.setLocale(HawkbitCommonUtil.getLocale());
    forcedTimeDateField.setResolution(Resolution.MINUTE);
    forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
    addComponent(forcedTimeDateField);
}

From source file:org.eclipse.hawkbit.ui.management.miscs.AbstractActionTypeOptionGroupLayout.java

License:Open Source License

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);//from w ww.  j  a v a  2  s .  c om
    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);
}

From source file:org.eclipse.hawkbit.ui.management.miscs.AbstractActionTypeOptionGroupLayout.java

License:Open Source License

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);//w  w  w .  j  a  v  a2  s  .c  o m
    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");
    addComponent(softLabel);
}

From source file:org.eclipse.hawkbit.ui.management.miscs.ActionTypeOptionGroupAssignmentLayout.java

License:Open Source License

private void addAutoForceItemWithLabelAndDateField() {
    final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.AUTO_FORCED);
    autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED);
    addComponent(autoForceItem);//from  w w w  .j a  v a 2  s  .  c om
    final Label autoForceLabel = new Label();
    autoForceLabel.setStyleName("statusIconPending");
    autoForceLabel.setIcon(FontAwesome.HISTORY);
    autoForceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_TIME_FORCED));
    autoForceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TIMEFORCED_ITEM));
    autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(autoForceLabel);

    forcedTimeDateField = new DateField();
    forcedTimeDateField.setInvalidAllowed(false);
    forcedTimeDateField.setInvalidCommitted(false);
    forcedTimeDateField.setEnabled(false);
    forcedTimeDateField.setStyleName("dist-window-forcedtime");

    final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
    forcedTimeDateField.setValue(
            Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
    forcedTimeDateField.setImmediate(true);
    forcedTimeDateField.setTimeZone(tz);
    forcedTimeDateField.setLocale(HawkbitCommonUtil.getCurrentLocale());
    forcedTimeDateField.setResolution(Resolution.MINUTE);
    forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
    addComponent(forcedTimeDateField);
}

From source file:org.eclipse.hawkbit.ui.management.miscs.ActionTypeOptionGroupLayout.java

License:Open Source License

private void createOptionGroup() {
    actionTypeOptionGroup = new FlexibleOptionGroup();
    actionTypeOptionGroup.addItem(ActionTypeOption.SOFT);
    actionTypeOptionGroup.addItem(ActionTypeOption.FORCED);
    actionTypeOptionGroup.addItem(ActionTypeOption.AUTO_FORCED);
    selectDefaultOption();// w w  w .j  a  v  a  2s  .  c om

    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);

    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");
    addComponent(softLabel);

    final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup
            .getItemComponent(ActionTypeOption.AUTO_FORCED);
    autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED);
    addComponent(autoForceItem);
    final Label autoForceLabel = new Label();
    autoForceLabel.setStyleName("statusIconPending");
    autoForceLabel.setIcon(FontAwesome.HISTORY);
    autoForceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_TIME_FORCED));
    autoForceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TIMEFORCED_ITEM));
    autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE);
    addComponent(autoForceLabel);

    forcedTimeDateField = new DateField();
    forcedTimeDateField.setInvalidAllowed(false);
    forcedTimeDateField.setInvalidCommitted(false);
    forcedTimeDateField.setEnabled(false);
    forcedTimeDateField.setStyleName("dist-window-forcedtime");

    final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
    forcedTimeDateField.setValue(
            Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
    forcedTimeDateField.setImmediate(true);
    forcedTimeDateField.setTimeZone(tz);
    forcedTimeDateField.setLocale(HawkbitCommonUtil.getLocale());
    forcedTimeDateField.setResolution(Resolution.MINUTE);
    forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
    addComponent(forcedTimeDateField);
}

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

License:Open Source License

private Label buildAttributesUpdateLabel() {
    final Label attributesUpdateLabel = new Label();
    attributesUpdateLabel.setStyleName(ValoTheme.LABEL_SMALL);
    attributesUpdateLabel.setValue(getI18n().getMessage("label.target.attributes.update.pending"));

    return attributesUpdateLabel;
}

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

License:Open Source License

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();
    }// w w w  . j  a  va  2 s.c o m
    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);
}

From source file:org.eclipse.hawkbit.ui.menu.DashboardMenu.java

License:Open Source License

private Component buildVersionInfo() {
    final Label label = new Label();
    label.setSizeFull();/*w  w w. j av  a 2  s .com*/
    label.setStyleName("version-layout");
    label.setValue(serverProperties.getBuild().getVersion());
    return label;
}

From source file:org.eclipse.hawkbit.ui.rollout.rollout.AutoStartOptionGroupLayout.java

License:Open Source License

private void createOptionGroup() {
    autoStartOptionGroup = new FlexibleOptionGroup();
    autoStartOptionGroup.addItem(AutoStartOption.MANUAL);
    autoStartOptionGroup.addItem(AutoStartOption.AUTO_START);
    autoStartOptionGroup.addItem(AutoStartOption.SCHEDULED);
    selectDefaultOption();//from  ww  w  .ja  v a  2s .  c o m

    final FlexibleOptionGroupItemComponent manualItem = autoStartOptionGroup
            .getItemComponent(AutoStartOption.MANUAL);
    manualItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START);
    // set Id for Forced radio button.
    manualItem.setId(UIComponentIdProvider.ROLLOUT_START_MANUAL_ID);
    addComponent(manualItem);
    final Label manualLabel = new Label();
    manualLabel.setStyleName("statusIconPending");
    manualLabel.setIcon(FontAwesome.HAND_PAPER_O);
    manualLabel.setCaption(i18n.getMessage("caption.rollout.start.manual"));
    manualLabel.setDescription(i18n.getMessage("caption.rollout.start.manual.desc"));
    manualLabel.setStyleName("padding-right-style");
    addComponent(manualLabel);

    final FlexibleOptionGroupItemComponent autoStartItem = autoStartOptionGroup
            .getItemComponent(AutoStartOption.AUTO_START);
    autoStartItem.setId(UIComponentIdProvider.ROLLOUT_START_AUTO_ID);
    autoStartItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START);
    addComponent(autoStartItem);
    final Label autoStartLabel = new Label();
    autoStartLabel.setSizeFull();
    autoStartLabel.setIcon(FontAwesome.PLAY);
    autoStartLabel.setCaption(i18n.getMessage("caption.rollout.start.auto"));
    autoStartLabel.setDescription(i18n.getMessage("caption.rollout.start.auto.desc"));
    autoStartLabel.setStyleName("padding-right-style");
    addComponent(autoStartLabel);

    final FlexibleOptionGroupItemComponent scheduledItem = autoStartOptionGroup
            .getItemComponent(AutoStartOption.SCHEDULED);
    scheduledItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START);
    // setted Id for Time Forced radio button.
    scheduledItem.setId(UIComponentIdProvider.ROLLOUT_START_SCHEDULED_ID);
    addComponent(scheduledItem);
    final Label scheduledLabel = new Label();
    scheduledLabel.setStyleName("statusIconPending");
    scheduledLabel.setIcon(FontAwesome.CLOCK_O);
    scheduledLabel.setCaption(i18n.getMessage("caption.rollout.start.scheduled"));
    scheduledLabel.setDescription(i18n.getMessage("caption.rollout.start.scheduled.desc"));
    scheduledLabel.setStyleName(STYLE_DIST_WINDOW_AUTO_START);
    addComponent(scheduledLabel);

    startAtDateField = new DateField();
    startAtDateField.setInvalidAllowed(false);
    startAtDateField.setInvalidCommitted(false);
    startAtDateField.setEnabled(false);
    startAtDateField.setStyleName("dist-window-forcedtime");

    final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone();
    startAtDateField.setValue(Date
            .from(LocalDateTime.now().plusMinutes(30).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant()));
    startAtDateField.setImmediate(true);
    startAtDateField.setTimeZone(tz);
    startAtDateField.setLocale(HawkbitCommonUtil.getCurrentLocale());
    startAtDateField.setResolution(Resolution.MINUTE);
    startAtDateField.addStyleName(ValoTheme.DATEFIELD_SMALL);
    addComponent(startAtDateField);
}

From source file:org.eclipse.skalli.view.component.Tray.java

License:Open Source License

private ComponentContainer createContent(String caption, String description, ThemeResource icon,
        boolean isRequired) {
    CssLayout layout = new CssLayout();
    layout.setStyleName(STYLE_TRAY);/*from   www  . ja  va 2 s.co  m*/
    layout.setMargin(true);

    HorizontalLayout header = new HorizontalLayout();
    header.setSpacing(true);
    header.setStyleName(STYLE_TRAY_HEADER);
    header.setWidth("100%");

    this.icon = icon;
    trayIcon = new Embedded(null, icon);
    trayIcon.setStyleName(STYLE_TRAY_HEADER_ICON);
    header.addComponent(trayIcon);
    header.setComponentAlignment(trayIcon, Alignment.MIDDLE_LEFT);
    header.setExpandRatio(trayIcon, 0);

    Label captionLabel = new Label(StringEscapeUtils.escapeHtml(caption), Label.CONTENT_XHTML);
    captionLabel.setStyleName(STYLE_TRAY_HEADER_LABEL);
    header.addComponent(captionLabel);
    header.setExpandRatio(captionLabel, 1);
    header.setComponentAlignment(captionLabel, Alignment.MIDDLE_LEFT);

    this.isRequired = isRequired;
    if (!isRequired) {
        activator = new NativeButton("", new ToggleEnabledListener());
        header.addComponent(activator);
        header.setExpandRatio(activator, 0);
        header.setComponentAlignment(activator, Alignment.MIDDLE_RIGHT);
    }

    opener = new NativeButton("", new ToggleVisibleListener());
    header.addComponent(opener);
    header.setExpandRatio(opener, 0);
    header.setComponentAlignment(opener, Alignment.MIDDLE_RIGHT);

    layout.addComponent(header);

    CssLayout content = new CssLayout();
    Label descriptionLabel = new Label(HtmlUtils.clean(description), Label.CONTENT_XHTML);
    descriptionLabel.setStyleName(STYLE_TRAY_DESCRIPTION);
    content.addComponent(descriptionLabel);

    layout.addComponent(content);
    setCompositionRoot(layout);
    return content;
}