Example usage for com.vaadin.ui Label setId

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

Introduction

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

Prototype

@Override
    public void setId(String id) 

Source Link

Usage

From source file:org.eclipse.hawkbit.ui.common.detailslayout.SoftwareModuleDetailsTable.java

License:Open Source License

private VerticalLayout createSoftModuleLayout(final SoftwareModuleType swModType,
        final DistributionSet distributionSet, final Set<SoftwareModule> alreadyAssignedSwModules) {
    final VerticalLayout verticalLayout = new VerticalLayout();
    for (final SoftwareModule sw : alreadyAssignedSwModules) {
        if (swModType.getKey().equals(sw.getType().getKey())) {
            final HorizontalLayout horizontalLayout = new HorizontalLayout();
            horizontalLayout.setSizeFull();
            final Label softwareModule = HawkbitCommonUtil.getFormatedLabel("");
            final Button reassignSoftModule = SPUIComponentProvider.getButton(sw.getName(), "", "", "", true,
                    FontAwesome.TIMES, SPUIButtonStyleNoBorder.class);
            reassignSoftModule/*w w w  .j a v a  2s.  c  o m*/
                    .addClickListener(event -> unassignSW(event, distributionSet, alreadyAssignedSwModules));
            final String softwareModNameVersion = HawkbitCommonUtil.getFormattedNameVersion(sw.getName(),
                    sw.getVersion());
            softwareModule.setValue(softwareModNameVersion);
            softwareModule.setDescription(softwareModNameVersion);
            softwareModule.setId(sw.getName() + "-label");
            horizontalLayout.addComponent(softwareModule);
            horizontalLayout.setExpandRatio(softwareModule, 1F);
            if (isUnassignSoftModAllowed && permissionChecker.hasUpdateRepositoryPermission()
                    && !isTargetAssigned
                    && (isSoftModAvaiableForSoftType(alreadyAssignedSwModules, swModType))) {
                horizontalLayout.addComponent(reassignSoftModule);
            }
            verticalLayout.addComponent(horizontalLayout);
        }

    }

    return verticalLayout;
}

From source file:org.eclipse.hawkbit.ui.common.grid.AbstractGridLayout.java

License:Open Source License

private HorizontalLayout createCountMessageComponent() {
    final HorizontalLayout rolloutGroupTargetsCountLayout = new HorizontalLayout();
    final Label countMessageLabel = getCountMessageLabel();
    countMessageLabel.setId(UIComponentIdProvider.ROLLOUT_GROUP_TARGET_LABEL);
    rolloutGroupTargetsCountLayout.addComponent(getCountMessageLabel());
    rolloutGroupTargetsCountLayout.setStyleName(SPUIStyleDefinitions.FOOTER_LAYOUT);
    rolloutGroupTargetsCountLayout.setWidth("100%");
    return rolloutGroupTargetsCountLayout;

}

From source file:org.eclipse.hawkbit.ui.distributions.dstable.DistributionSetDetails.java

License:Open Source License

private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) {
    final VerticalLayout verticalLayout = new VerticalLayout();
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setSizeFull();//from   ww w  .  j  ava2 s .co m
    final Label softwareModule = HawkbitCommonUtil.getFormatedLabel("");
    softwareModule.setValue(softwareModuleName);
    softwareModule.setDescription(softwareModuleName);
    softwareModule.setId(softwareModuleName + "-label");
    horizontalLayout.addComponent(softwareModule);
    horizontalLayout.setExpandRatio(softwareModule, 1F);
    verticalLayout.addComponent(horizontalLayout);
    return verticalLayout;
}

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

License:Open Source License

private static Label createStatusIcon() {
    final Label statusIcon = new Label();
    statusIcon.setImmediate(true);/*ww w.ja  va  2s . com*/
    statusIcon.setContentMode(ContentMode.HTML);
    statusIcon.setSizeFull();
    setInitialStatusIconStyle(statusIcon);
    statusIcon.setId(UIComponentIdProvider.VALIDATION_STATUS_ICON_ID);
    return statusIcon;
}

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);/*  w  w  w.ja v  a 2 s .co m*/
    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

private Component getForcedColumn(final Object itemId) {
    final Action actionWithActiveStatus = (Action) hierarchicalContainer.getItem(itemId)
            .getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_FORCED).getValue();
    final Label actionLabel = new LabelBuilder().name("").buildCaptionLabel();
    actionLabel.setContentMode(ContentMode.HTML);
    actionLabel.setStyleName("action-history-table-col-forced-label");
    if (actionWithActiveStatus != null && actionWithActiveStatus.getActionType() == ActionType.FORCED) {
        actionLabel.setValue(FontAwesome.BOLT.getHtml());
        // setted Id for Forced.
        actionLabel.setId("action.history.table.forcedId");
    } else if (actionWithActiveStatus != null
            && actionWithActiveStatus.getActionType() == ActionType.TIMEFORCED) {
        return actionLabelWithTimeForceIcon(actionWithActiveStatus, actionLabel);
    }/*from  w w  w  .j av  a2 s. co m*/
    return actionLabel;
}

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

License:Open Source License

private Component getActiveColumn(final Object itemId) {
    final Action.Status status = (Action.Status) hierarchicalContainer.getItem(itemId)
            .getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_STATUS_HIDDEN).getValue();
    String activeValue;// www  .ja  v a2 s.c o  m
    if (status == Action.Status.SCHEDULED) {
        activeValue = Action.Status.SCHEDULED.toString().toLowerCase();
    } else {
        activeValue = (String) hierarchicalContainer.getItem(itemId)
                .getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ACTIVE_HIDDEN).getValue();
    }
    final String distName = (String) hierarchicalContainer.getItem(itemId)
            .getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST).getValue();
    final Label activeStatusIcon = createActiveStatusLabel(activeValue,
            (Action.Status) hierarchicalContainer.getItem(itemId)
                    .getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_STATUS_HIDDEN)
                    .getValue() == Action.Status.ERROR);
    activeStatusIcon.setId(new StringJoiner(".").add(distName).add(itemId.toString())
            .add(SPUIDefinitions.ACTION_HIS_TBL_ACTIVE).add(activeValue).toString());
    return activeStatusIcon;
}

From source file:org.eclipse.hawkbit.ui.management.dstable.DistributionDetails.java

License:Open Source License

private void updateDistributionDetailsLayout(final String type, final Boolean isMigrationRequired) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    if (type != null) {
        final Label typeLabel = SPUIComponentProvider
                .createNameValueLabel(getI18n().get("label.dist.details.type"), type);
        typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
        detailsTabLayout.addComponent(typeLabel);
    }//  ww w . j  a  va 2s. c o  m

    if (isMigrationRequired != null) {
        detailsTabLayout.addComponent(
                SPUIComponentProvider.createNameValueLabel(getI18n().get("checkbox.dist.migration.required"),
                        isMigrationRequired.equals(Boolean.TRUE) ? getI18n().get("label.yes")
                                : getI18n().get("label.no")));
    }
}

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

License:Open Source License

private static Label getStatusCountLabel() {
    final Label countLabel = new Label();
    countLabel.setImmediate(true);//from  w  w  w. ja  va2  s.  c o m
    countLabel.addStyleName("bulk-upload-label");
    countLabel.setVisible(false);
    countLabel.setCaptionAsHtml(true);
    countLabel.setId(UIComponentIdProvider.BULK_UPLOAD_COUNT);
    return countLabel;
}

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

License:Open Source License

private void updateDetailsLayout(final String controllerId, final URI address, final String securityToken,
        final String lastQueryDate) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    final Label controllerLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.target.id"), controllerId == null ? "" : controllerId);
    controllerLabel.setId(UIComponentIdProvider.TARGET_CONTROLLER_ID);
    detailsTabLayout.addComponent(controllerLabel);

    final Label lastPollDtLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("label.target.lastpolldate"), lastQueryDate == null ? "" : lastQueryDate);
    lastPollDtLabel.setId(UIComponentIdProvider.TARGET_LAST_QUERY_DT);
    detailsTabLayout.addComponent(lastPollDtLabel);

    final Label typeLabel = SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("label.ip"),
            address == null ? "" : address.toString());
    typeLabel.setId(UIComponentIdProvider.TARGET_IP_ADDRESS);
    detailsTabLayout.addComponent(typeLabel);

    final HorizontalLayout securityTokenLayout = getSecurityTokenLayout(securityToken);
    controllerLabel.setId(UIComponentIdProvider.TARGET_SECURITY_TOKEN);
    detailsTabLayout.addComponent(securityTokenLayout);
}