Java Code Examples for com.vaadin.ui.Label#setCaption()
The following examples show how to use
com.vaadin.ui.Label#setCaption() .
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: AbstractHawkbitLoginUI.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
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 2
Source File: ActionTypeOptionGroupAssignmentLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
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); 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); }
Example 3
Source File: AbstractActionTypeOptionGroupLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
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 4
Source File: AbstractActionTypeOptionGroupLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
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 5
Source File: AbstractActionTypeOptionGroupLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
protected void addDownloadOnlyItemWithLabel() { final FlexibleOptionGroupItemComponent downloadOnlyItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.DOWNLOAD_ONLY); downloadOnlyItem.setId(UIComponentIdProvider.ACTION_DETAILS_DOWNLOAD_ONLY_ID); downloadOnlyItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); addComponent(downloadOnlyItem); final Label downloadOnlyLabel = new Label(); downloadOnlyLabel.setSizeFull(); downloadOnlyLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_DOWNLOAD_ONLY)); downloadOnlyLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_DOWNLOAD_ONLY_ITEM)); downloadOnlyLabel.setStyleName("padding-right-style"); downloadOnlyLabel.setIcon(FontAwesome.DOWNLOAD); addComponent(downloadOnlyLabel); }
Example 6
Source File: LabelBuilder.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
/** * Build label. * * @return Label */ public Label buildLabel() { final Label label = createLabel(); label.setImmediate(false); label.setWidth("-1px"); label.setHeight("-1px"); if (StringUtils.hasText(caption)) { label.setCaption(caption); } return label; }
Example 7
Source File: TimesheetChangeViewImplEx.java From vaadinator with Apache License 2.0 | 5 votes |
@Override public void setProjectSum(String projectName, float sumValue) { // add to section basisdaten if (!projectSumLabels.containsKey(projectName)) { Label newLabel = new Label(twoDigitsFormat.format(0.0)); newLabel.setCaption("Sum 4 " + projectName); sectionBasisdaten.addComponent(newLabel); projectSumLabels.put(projectName, newLabel); } projectSumLabels.get(projectName).setValue(twoDigitsFormat.format(sumValue)); }
Example 8
Source File: AutoStartOptionGroupLayout.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
private void createOptionGroup() { autoStartOptionGroup = new FlexibleOptionGroup(); autoStartOptionGroup.addItem(AutoStartOption.MANUAL); autoStartOptionGroup.addItem(AutoStartOption.AUTO_START); autoStartOptionGroup.addItem(AutoStartOption.SCHEDULED); selectDefaultOption(); 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); }
Example 9
Source File: WinCloudStackLoadBalancerEdit.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { setHeight(TAB_HEIGHT); setMargin(false, true, false, true); setSpacing(false); // フォーム Form form = new Form(); form.setSizeFull(); addComponent(form); // ロードバランサ名 loadBalancerNameField = new TextField(ViewProperties.getCaption("field.loadBalancerName")); form.getLayout().addComponent(loadBalancerNameField); // コメント commentField = new TextField(ViewProperties.getCaption("field.comment")); commentField.setWidth("95%"); form.getLayout().addComponent(commentField); // プラットフォーム cloudLabel = new Label(); cloudLabel.setCaption(ViewProperties.getCaption("field.cloud")); cloudLabel.addStyleName("icon-label"); form.getLayout().addComponent(cloudLabel); // ロードバランサ種別 typeLabel = new Label(); typeLabel.setCaption(ViewProperties.getCaption("field.loadBalancerType")); typeLabel.addStyleName("icon-label"); form.getLayout().addComponent(typeLabel); // 割り当てサービス serviceSelect = new ComboBox(); serviceSelect.setCaption(ViewProperties.getCaption("field.loadBalancerService")); serviceSelect.setNullSelectionAllowed(false); serviceSelect.addContainerProperty(SERVICE_CAPTION_ID, String.class, null); serviceSelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); serviceSelect.setItemCaptionPropertyId(SERVICE_CAPTION_ID); form.getLayout().addComponent(serviceSelect); // アルゴリズム algorithmSelect = new ComboBox(); algorithmSelect.setCaption(ViewProperties.getCaption("field.algorithm")); algorithmSelect.setNullSelectionAllowed(false); form.getLayout().addComponent(algorithmSelect); // パブリックポート publicPortField = new TextField(ViewProperties.getCaption("field.publicport")); publicPortField.setWidth("95%"); form.getLayout().addComponent(publicPortField); // プライベートポート privatePortField = new TextField(ViewProperties.getCaption("field.privateport")); privatePortField.setWidth("95%"); form.getLayout().addComponent(privatePortField); initValidation(); }
Example 10
Source File: RuleEditorWindow.java From XACML with MIT License | 4 votes |
@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 11
Source File: PolicyEditorWindow.java From XACML with MIT License | 4 votes |
@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 12
Source File: PolicySetEditorWindow.java From XACML with MIT License | 4 votes |
@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; }