Java Code Examples for com.vaadin.ui.Label#setValue()

The following examples show how to use com.vaadin.ui.Label#setValue() . 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: GroupsLegendLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Populates the legend based on a list of anonymous groups. They can't have
 * unassigned targets.
 * 
 * @param listOfTargetCountPerGroup
 *            list of target counts
 */
public void populateGroupsLegendByTargetCounts(final List<Long> listOfTargetCountPerGroup) {
    loadingLabel.setVisible(false);

    for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(listOfTargetCountPerGroup.size()); i++) {
        final Component component = groupsLegend.getComponent(i);
        final Label label = (Label) component;
        if (listOfTargetCountPerGroup.size() > i) {
            final Long targetCount = listOfTargetCountPerGroup.get(i);
            label.setValue(getTargetsInGroupMessage(targetCount,
                    i18n.getMessage("textfield.rollout.group.default.name", i + 1)));
            label.setVisible(true);
        } else {
            label.setValue("");
            label.setVisible(false);
        }
    }

    showOrHideToBeContinueLabel(listOfTargetCountPerGroup);

    unassignedTargetsLabel.setValue("");
    unassignedTargetsLabel.setVisible(false);
}
 
Example 2
Source File: GroupsLegendLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Populates the legend based on a list of groups.
 *
 * @param groups
 *            List of groups with their name
 */
public void populateGroupsLegendByGroups(final List<RolloutGroup> groups) {
    loadingLabel.setVisible(false);

    for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(groups.size()); i++) {
        final Component component = groupsLegend.getComponent(i);
        final Label label = (Label) component;
        if (groups.size() > i) {
            final int targetCount = groups.get(i).getTotalTargets();
            final String groupName = groups.get(i).getName();

            label.setValue(getTargetsInGroupMessage((long) targetCount, groupName));
            label.setVisible(true);
        } else {
            label.setValue("");
            label.setVisible(false);
        }
    }

    showOrHideToBeContinueLabel(groups);
}
 
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: 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 5
Source File: XacmlAdminConsole.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("100%");
	mainLayout.setHeight("100%");
	mainLayout.setMargin(true);
	
	// top-level component properties
	setWidth("100.0%");
	setHeight("100.0%");
	
	// horizontalLayout_1
	horizontalLayout_1 = buildHorizontalLayout_1();
	mainLayout.addComponent(horizontalLayout_1);
	
	// tabSheet
	tabSheet = new TabSheet();
	tabSheet.setImmediate(false);
	tabSheet.setWidth("100.0%");
	tabSheet.setHeight("100.0%");
	mainLayout.addComponent(tabSheet);
	mainLayout.setExpandRatio(tabSheet, 1.0f);
	
	// labelCopyright
	labelCopyright = new Label();
	labelCopyright.setImmediate(false);
	labelCopyright.setWidth("-1px");
	labelCopyright.setHeight("40px");
	labelCopyright
			.setValue("<center>&copy; 2013-2014 AT&T Intellectual Property. All rights reserved.</center>");
	mainLayout.addComponent(labelCopyright);
	mainLayout.setComponentAlignment(labelCopyright, new Alignment(48));
	
	return mainLayout;
}
 
Example 6
Source File: GroupsLegendLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Label createLoadingLabel() {
    final Label label = new LabelBuilder().visible(false).name("").buildLabel();
    label.addStyleName("rollout-target-count-loading");
    label.setImmediate(true);
    label.setSizeUndefined();
    label.setValue(i18n.getMessage("label.rollout.calculating"));
    return label;
}
 
Example 7
Source File: XacmlErrorHandler.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("100%");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("100.0%");
	setHeight("-1px");
	
	// labelError
	labelError = new Label();
	labelError.setImmediate(false);
	labelError.setWidth("100.0%");
	labelError.setHeight("80px");
	labelError.setValue("This holds error messages.");
	mainLayout.addComponent(labelError);
	
	// buttonGo
	buttonGo = new Button();
	buttonGo.setCaption("Ok");
	buttonGo.setImmediate(true);
	buttonGo.setWidth("-1px");
	buttonGo.setHeight("-1px");
	mainLayout.addComponent(buttonGo);
	mainLayout.setComponentAlignment(buttonGo, new Alignment(48));
	
	return mainLayout;
}
 
Example 8
Source File: SoftwareModuleDetailsTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
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
                    .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;
}
 
Example 9
Source File: DefaultGridHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Builds the title HorizontalLayout containing two labels.
 *
 * @return title as HorizontalLayout
 */
protected HorizontalLayout buildTitleHorizontalLayout() {

    prefixText = new Label();
    prefixText.setValue(titleText);
    prefixText.addStyleName(ValoTheme.LABEL_SMALL);
    prefixText.addStyleName(ValoTheme.LABEL_BOLD);
    prefixText.setSizeUndefined();

    title = new Label();
    title.setSizeFull();
    title.setImmediate(true);
    title.setWidth("100%");
    title.addStyleName(ValoTheme.LABEL_SMALL);
    title.addStyleName("text-bold");
    title.addStyleName("text-cut");
    title.addStyleName("header-caption-right");

    prefixWithTitle = new HorizontalLayout();
    prefixWithTitle.setMargin(false);
    prefixWithTitle.setSpacing(true);
    prefixWithTitle.setSizeFull();
    prefixWithTitle.addStyleName("header-caption");

    prefixWithTitle.addComponent(prefixText);
    prefixWithTitle.setComponentAlignment(prefixText, Alignment.TOP_LEFT);
    prefixWithTitle.setExpandRatio(prefixText, 0.0F);

    prefixWithTitle.addComponent(title);
    prefixWithTitle.setComponentAlignment(title, Alignment.TOP_LEFT);
    prefixWithTitle.setExpandRatio(title, 1.0F);

    return prefixWithTitle;
}
 
Example 10
Source File: DashboardMenu.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Component buildVersionInfo() {
    final Label label = new Label();
    label.setSizeFull();
    label.setStyleName("version-layout");
    label.setValue(serverProperties.getBuild().getVersion());
    return label;
}
 
Example 11
Source File: DistributionSetDetails.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) {
    final VerticalLayout verticalLayout = new VerticalLayout();
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setSizeFull();
    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;
}
 
Example 12
Source File: TargetDetails.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private Label buildAttributesUpdateLabel() {
    final Label attributesUpdateLabel = new Label();
    attributesUpdateLabel.setStyleName(ValoTheme.LABEL_SMALL);
    attributesUpdateLabel.setValue(getI18n().getMessage("label.target.attributes.update.pending"));

    return attributesUpdateLabel;
}
 
Example 13
Source File: CreateOrUpdateFilterTable.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
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());
    }
    return label;
}
 
Example 14
Source File: GroupsLegendLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Populates the legend based on a groups validation and a list of groups
 * that is used for resolving their names. Positions of the groups in the
 * groups list and the validation need to be in correct order. Can have
 * unassigned targets that are displayed on top of the groups list which
 * results in one group less to be displayed
 * 
 * @param validation
 *            A rollout validation object that contains a list of target
 *            counts and the total targets
 * @param groups
 *            List of groups with their name
 */
public void populateGroupsLegendByValidation(final RolloutGroupsValidation validation,
        final List<RolloutGroupCreate> groups) {
    loadingLabel.setVisible(false);
    if (validation == null) {
        return;
    }
    final List<Long> targetsPerGroup = validation.getTargetsPerGroup();
    final long unassigned = validation.getTotalTargets() - validation.getTargetsInGroups();
    final int labelsToUpdate = (unassigned > 0) ? (getGroupsWithoutToBeContinuedLabel(groups.size()) - 1)
            : groupsLegend.getComponentCount();
    for (int i = 0; i < getGroupsWithoutToBeContinuedLabel(groups.size()); i++) {
        final Component component = groupsLegend.getComponent(i);
        final Label label = (Label) component;
        if (targetsPerGroup.size() > i && groups.size() > i && labelsToUpdate > i) {
            final Long targetCount = targetsPerGroup.get(i);
            final String groupName = groups.get(i).build().getName();

            label.setValue(getTargetsInGroupMessage(targetCount, groupName));
            label.setVisible(true);
        } else {
            label.setValue("");
            label.setVisible(false);
        }
    }

    showOrHideToBeContinueLabel(groups);

    if (unassigned > 0) {
        unassignedTargetsLabel.setValue(getTargetsInGroupMessage(unassigned, "Unassigned"));
        unassignedTargetsLabel.setVisible(true);
    } else {
        unassignedTargetsLabel.setValue("");
        unassignedTargetsLabel.setVisible(false);
    }
}
 
Example 15
Source File: AutoCompleteTextFieldComponent.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private static void setInitialStatusIconStyle(final Label statusIcon) {
    statusIcon.setValue(FontAwesome.CHECK_CIRCLE.getHtml());
    statusIcon.setStyleName("hide-status-label");
}
 
Example 16
Source File: XacmlAdminConsole.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("100.0%");
	horizontalLayout_1.setHeight("40px");
	horizontalLayout_1.setMargin(false);
	
	// embedded_1
	embedded_1 = new Embedded();
	embedded_1.setImmediate(false);
	embedded_1.setWidth("30px");
	embedded_1.setHeight("30px");
	embedded_1.setSource(new ThemeResource("img/att.png"));
	embedded_1.setType(1);
	embedded_1.setMimeType("image/png");
	horizontalLayout_1.addComponent(embedded_1);
	horizontalLayout_1.setComponentAlignment(embedded_1, new Alignment(33));
	
	// caption
	caption = new Label();
	caption.setImmediate(false);
	caption.setWidth("-1px");
	caption.setHeight("-1px");
	caption.setValue("AT&T Policy Engine Admin Console");
	horizontalLayout_1.addComponent(caption);
	horizontalLayout_1.setExpandRatio(caption, 1.0f);
	horizontalLayout_1.setComponentAlignment(caption, new Alignment(33));
	
	// labelWelcome
	labelWelcome = new Label();
	labelWelcome.setImmediate(false);
	labelWelcome.setWidth("-1px");
	labelWelcome.setHeight("40px");
	labelWelcome.setValue("Label");
	horizontalLayout_1.addComponent(labelWelcome);
	horizontalLayout_1.setComponentAlignment(labelWelcome,
			new Alignment(34));
	
	return horizontalLayout_1;
}
 
Example 17
Source File: RuleEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// labelRuleID
	labelRuleID = new Label();
	labelRuleID.setCaption("Rule ID");
	labelRuleID.setImmediate(false);
	labelRuleID.setWidth("100.0%");
	labelRuleID.setHeight("-1px");
	labelRuleID.setValue("Label");
	mainLayout.addComponent(labelRuleID);
	mainLayout.setExpandRatio(labelRuleID, 1.0f);
	
	// optionGroupEffect
	optionGroupEffect = new OptionGroup();
	optionGroupEffect.setCaption("Choose the effect.");
	optionGroupEffect.setImmediate(false);
	optionGroupEffect.setWidth("-1px");
	optionGroupEffect.setHeight("-1px");
	optionGroupEffect.setInvalidAllowed(false);
	optionGroupEffect.setRequired(true);
	mainLayout.addComponent(optionGroupEffect);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Enter a description for the Rule.");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100.0%");
	textAreaDescription.setHeight("-1px");
	textAreaDescription.setNullSettingAllowed(true);
	textAreaDescription.setNullRepresentation("");
	mainLayout.addComponent(textAreaDescription);
	mainLayout.setExpandRatio(textAreaDescription, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example 18
Source File: PolicyEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// labelID
	labelID = new Label();
	labelID.setCaption("Policy Set ID");
	labelID.setImmediate(false);
	labelID.setWidth("100.0%");
	labelID.setHeight("-1px");
	labelID.setValue("Label");
	mainLayout.addComponent(labelID);
	
	// textFieldVersion
	textFieldVersion = new TextField();
	textFieldVersion.setCaption("Version");
	textFieldVersion.setImmediate(false);
	textFieldVersion
			.setDescription("The format is numbers only separated by decimal point.");
	textFieldVersion.setWidth("-1px");
	textFieldVersion.setHeight("-1px");
	textFieldVersion.setInvalidAllowed(false);
	textFieldVersion.setRequired(true);
	textFieldVersion.setInputPrompt("Eg. 1 or 1.0 or 1.0.0 etc.");
	mainLayout.addComponent(textFieldVersion);
	
	// listSelectAlgorithm
	listSelectAlgorithm = new ListSelect();
	listSelectAlgorithm.setCaption("Policy Combining Algorithm");
	listSelectAlgorithm.setImmediate(false);
	listSelectAlgorithm.setWidth("100.0%");
	listSelectAlgorithm.setHeight("-1px");
	listSelectAlgorithm.setInvalidAllowed(false);
	listSelectAlgorithm.setRequired(true);
	mainLayout.addComponent(listSelectAlgorithm);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100.0%");
	textAreaDescription.setHeight("-1px");
	mainLayout.addComponent(textAreaDescription);
	mainLayout.setExpandRatio(textAreaDescription, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example 19
Source File: PolicySetEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// labelID
	labelID = new Label();
	labelID.setCaption("Policy Set ID");
	labelID.setImmediate(false);
	labelID.setWidth("100.0%");
	labelID.setHeight("-1px");
	labelID.setValue("Label");
	mainLayout.addComponent(labelID);
	
	// textFieldVersion
	textFieldVersion = new TextField();
	textFieldVersion.setCaption("Version");
	textFieldVersion.setImmediate(false);
	textFieldVersion
			.setDescription("The format is numbers only separated by decimal point.");
	textFieldVersion.setWidth("-1px");
	textFieldVersion.setHeight("-1px");
	textFieldVersion.setInvalidAllowed(false);
	textFieldVersion.setRequired(true);
	textFieldVersion.setInputPrompt("Eg. 1 or 1.0 or 1.0.0 etc.");
	mainLayout.addComponent(textFieldVersion);
	
	// listSelectAlgorithm
	listSelectAlgorithm = new ListSelect();
	listSelectAlgorithm.setCaption("Policy Combining Algorithm");
	listSelectAlgorithm.setImmediate(false);
	listSelectAlgorithm.setWidth("100.0%");
	listSelectAlgorithm.setHeight("-1px");
	listSelectAlgorithm.setInvalidAllowed(false);
	listSelectAlgorithm.setRequired(true);
	mainLayout.addComponent(listSelectAlgorithm);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100.0%");
	textAreaDescription.setHeight("-1px");
	mainLayout.addComponent(textAreaDescription);
	mainLayout.setExpandRatio(textAreaDescription, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example 20
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private Label getMandatoryLabel(final String key) {
    final Label mandatoryLabel = getLabel(i18n.getMessage(key));
    mandatoryLabel.setContentMode(ContentMode.HTML);
    mandatoryLabel.setValue(mandatoryLabel.getValue().concat(" <span style='color:#ed473b'>*</span>"));
    return mandatoryLabel;
}