Java Code Examples for com.vaadin.ui.Label#setSizeUndefined()
The following examples show how to use
com.vaadin.ui.Label#setSizeUndefined() .
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: FormUtils.java From jdal with Apache License 2.0 | 6 votes |
/** * Create a titled separator * @param title title * @return a {@link HorizontalLayout} with title and rule. */ public static Component createTitledSeparator(String title) { Label titleLabel = new Label(title); titleLabel.setStyleName(Reindeer.LABEL_H2); Label rule = new Label("<hr />", ContentMode.HTML); titleLabel.setSizeUndefined(); HorizontalLayout hl = new HorizontalLayout(); hl.addComponent(titleLabel); Box.addHorizontalStruct(hl, 20); hl.addComponent(rule); hl.setComponentAlignment(rule, Alignment.BOTTOM_CENTER); hl.setExpandRatio(rule, 1); hl.setWidth(100, Unit.PERCENTAGE); return hl; }
Example 2
Source File: QuestionnaireView.java From gazpachoquest with GNU General Public License v3.0 | 6 votes |
private HorizontalLayout createHeader() { final HorizontalLayout layout = new HorizontalLayout(); layout.setWidth("100%"); layout.setMargin(true); layout.setSpacing(true); final Label title = new Label("Activiti + Vaadin - A Match Made in Heaven"); title.addStyleName(Reindeer.LABEL_H1); layout.addComponent(title); layout.setExpandRatio(title, 1.0f); Label currentUser = new Label(); currentUser.setSizeUndefined(); layout.addComponent(currentUser); layout.setComponentAlignment(currentUser, Alignment.MIDDLE_RIGHT); Button logout = new Button("Logout"); logout.addStyleName(Reindeer.BUTTON_SMALL); // logout.addListener(createLogoutButtonListener()); layout.addComponent(logout); layout.setComponentAlignment(logout, Alignment.MIDDLE_RIGHT); return layout; }
Example 3
Source File: TargetTableHeader.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
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: WindowBreadCrumbs.java From cuba with Apache License 2.0 | 5 votes |
public void update() { boolean isTestMode = ui.isTestMode(); linksLayout.removeAllComponents(); for (Iterator<Window> it = windows.iterator(); it.hasNext();) { Window window = it.next(); Button button = new NavigationButton(window); button.setCaption(StringUtils.trimToEmpty(window.getCaption())); button.addClickListener(this::navigationButtonClicked); button.setSizeUndefined(); button.setStyleName(ValoTheme.BUTTON_LINK); button.setTabIndex(-1); if (isTestMode) { button.setCubaId("breadCrubms_Button_" + window.getId()); } if (ui.isPerformanceTestMode()) { button.setId(ui.getTestIdManager().getTestId("breadCrubms_Button_" + window.getId())); } if (it.hasNext()) { linksLayout.addComponent(button); Label separatorLab = new Label(" > "); separatorLab.setStyleName("c-breadcrumbs-separator"); separatorLab.setSizeUndefined(); separatorLab.setContentMode(ContentMode.HTML); linksLayout.addComponent(separatorLab); } else { Label captionLabel = new Label(window.getCaption()); captionLabel.setStyleName("c-breadcrumbs-win-caption"); captionLabel.setSizeUndefined(); linksLayout.addComponent(captionLabel); } } }
Example 5
Source File: GroupsLegendLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private static Label createTotalTargetsLabel() { final Label label = new LabelBuilder().visible(false).name("").buildLabel(); label.addStyleName("rollout-target-count-title"); label.setImmediate(true); label.setSizeUndefined(); return label; }
Example 6
Source File: GroupsLegendLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
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: SignUpViewImpl.java From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 | 5 votes |
@Override public void postConstruct() { super.postConstruct(); setSizeFull(); layout = new VerticalLayout(); layout.setSizeFull(); layout.setSpacing(true); setCompositionRoot(layout); infoLabel = new Label("Vaadin4Spring Security Demo - SignUp"); infoLabel.addStyleName(ValoTheme.LABEL_H2); infoLabel.setSizeUndefined(); layout.addComponent(infoLabel); layout.setComponentAlignment(infoLabel, Alignment.MIDDLE_CENTER); container = new VerticalLayout(); container.setSizeUndefined(); container.setSpacing(true); layout.addComponent(container); layout.setComponentAlignment(container, Alignment.MIDDLE_CENTER); layout.setExpandRatio(container, 1); form = new FormLayout(); form.setWidth("400px"); form.setSpacing(true); container.addComponent(form); buildForm(); btnSignUp = new Button("Signup", FontAwesome.FLOPPY_O); btnSignUp.addStyleName(ValoTheme.BUTTON_FRIENDLY); btnSignUp.addClickListener(this); container.addComponent(btnSignUp); container.setComponentAlignment(btnSignUp, Alignment.MIDDLE_CENTER); }
Example 8
Source File: AddUpdateRolloutWindowLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private static Label createCountLabel() { final Label groupSize = new LabelBuilder().visible(false).name("").buildLabel(); groupSize.addStyleName(ValoTheme.LABEL_TINY + " " + "rollout-target-count-message"); groupSize.setImmediate(true); groupSize.setSizeUndefined(); return groupSize; }
Example 9
Source File: DefaultGridHeader.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
/** * 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: AbstractTableDetailsLayout.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
protected void createComponents() { captionPrefix = new Label(getDefaultCaption()); captionPrefix.setImmediate(true); captionPrefix.addStyleName(ValoTheme.LABEL_SMALL); captionPrefix.addStyleName(ValoTheme.LABEL_BOLD); captionPrefix.setSizeUndefined(); captionNameVersion = new Label(); captionNameVersion.setImmediate(true); captionNameVersion.setId(getDetailsHeaderCaptionId()); captionNameVersion.setWidth("100%"); captionNameVersion.addStyleName(ValoTheme.LABEL_SMALL); captionNameVersion.addStyleName("text-bold"); captionNameVersion.addStyleName("text-cut"); captionNameVersion.addStyleName("header-caption-right"); editButton = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_UPDATE), null, false, FontAwesome.PENCIL_SQUARE_O, SPUIButtonStyleNoBorder.class); editButton.setId(getEditButtonId()); editButton.addClickListener(this::onEdit); editButton.setEnabled(false); manageMetadataBtn = SPUIComponentProvider.getButton("", "", i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON), null, false, FontAwesome.LIST_ALT, SPUIButtonStyleNoBorder.class); manageMetadataBtn.setId(getMetadataButtonId()); manageMetadataBtn.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_METADATA_ICON)); manageMetadataBtn.addClickListener(this::showMetadata); manageMetadataBtn.setEnabled(false); detailsTab = SPUIComponentProvider.getDetailsTabSheet(); detailsTab.setImmediate(true); detailsTab.setWidth(98, Unit.PERCENTAGE); detailsTab.setHeight(90, Unit.PERCENTAGE); detailsTab.addStyleName(SPUIStyleDefinitions.DETAILS_LAYOUT_STYLE); detailsTab.setId(getTabSheetId()); }
Example 11
Source File: SPUIComponentProvider.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
/** * Method to CreateName value labels. * * @param label * as string * @param values * as string * @return HorizontalLayout */ public static HorizontalLayout createNameValueLayout(final String label, final String... values) { final String valueStr = StringUtils.arrayToDelimitedString(values, " "); final Label nameValueLabel = new Label( label ); nameValueLabel.setContentMode(ContentMode.TEXT); nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); nameValueLabel.addStyleName("text-bold"); nameValueLabel.setSizeUndefined(); final Label valueStrLabel = new Label(valueStr); valueStrLabel.setWidth("100%"); valueStrLabel.addStyleName("text-cut"); valueStrLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); valueStrLabel.addStyleName(LABEL_STYLE); final HorizontalLayout nameValueLayout = new HorizontalLayout(); nameValueLayout.setMargin(false); nameValueLayout.setSpacing(true); nameValueLayout.setSizeFull(); nameValueLayout.addComponent(nameValueLabel); nameValueLayout.setComponentAlignment(nameValueLabel, Alignment.TOP_LEFT); nameValueLayout.setExpandRatio(nameValueLabel, 0.0F); nameValueLayout.addComponent(valueStrLabel); nameValueLayout.setComponentAlignment(valueStrLabel, Alignment.TOP_LEFT); nameValueLayout.setExpandRatio(valueStrLabel, 1.0F); return nameValueLayout; }
Example 12
Source File: VaadinPaginator.java From jdal with Apache License 2.0 | 4 votes |
/** * {@inheritDoc} */ @Override protected Component buildPanel() { // buttons if (next == null) { setNext(createButton(nextIconUrl)); } if (this.last == null) { setLast(createButton(lastIconUrl)); } if (this.previous == null) { setPrevious(createButton(previousIconUrl)); } if (this.first == null) { setFirst(createButton(firstIconUrl)); } // goto page select Label goToLabel = new Label(messageSource.getMessage("vaadinPaginator.goto")); goToLabel.setSizeUndefined(); goToLabel.setStyleName(PAGINATOR); goTo.addValueChangeListener(new GoToValueChangeListener()); goTo.setImmediate(true); // records by page select Label showRecords = new Label(messageSource.getMessage("vaadinPaginator.pageSize")); showRecords.setSizeUndefined(); // page size combo for (String size : pageSizes) { pgs.addItem(size); } pgs.setNullSelectionAllowed(false); pgs.setValue(String.valueOf(getModel().getPageSize())); pgs.setWidth("6em"); pgs.setImmediate(true); pgs.addValueChangeListener(new PgsValueChangeListener()); BoxFormBuilder fb = new BoxFormBuilder(); fb.setMargin(false); fb.setFixedHeight(); fb.row(); fb.add(resultCount); fb.addHorizontalGlue(); fb.add(first); fb.add(previous); fb.add(status); fb.add(next); fb.add(last); fb.add(goToLabel); fb.add(goTo, 60); fb.addHorizontalGlue(); fb.add(showRecords); fb.add(pgs, 60); return fb.getForm(); }
Example 13
Source File: LoginView.java From gazpachoquest with GNU General Public License v3.0 | 4 votes |
protected CssLayout createCompositionRoot() { CssLayout root = new CssLayout(); root.setSizeFull(); root.addStyleName(Reindeer.LAYOUT_BLUE); VerticalLayout loginLayout = new VerticalLayout(); loginLayout.setSizeFull(); loginLayout.addStyleName("login-layout"); root.addComponent(loginLayout); final CssLayout loginPanel = new CssLayout(); loginPanel.addStyleName("login-panel"); loginLayout.addComponent(loginPanel); HorizontalLayout labels = new HorizontalLayout(); labels.setWidth("100%"); labels.setMargin(true); labels.addStyleName("labels"); loginPanel.addComponent(labels); Label welcome = new Label("Welcome"); welcome.setSizeUndefined(); welcome.addStyleName(Reindeer.LABEL_H2); labels.addComponent(welcome); labels.setComponentAlignment(welcome, Alignment.MIDDLE_LEFT); Label title = new Label("Gazpacho Quest"); title.setSizeUndefined(); title.addStyleName(Reindeer.LABEL_H1); labels.addComponent(title); labels.setComponentAlignment(title, Alignment.MIDDLE_RIGHT); HorizontalLayout fields = new HorizontalLayout(); fields.setWidth("100%"); fields.setSpacing(true); fields.setMargin(true); fields.addStyleName("fields"); invitation = new TextField("Invitation"); invitation.setSizeUndefined(); invitation.focus(); // invitation.setValue("YAS5ICHRBE"); fields.addComponent(invitation); login = new Button("Start"); login.addClickListener(createLoginButtonListener()); fields.addComponent(login); fields.setComponentAlignment(login, Alignment.BOTTOM_LEFT); loginPanel.addComponent(fields); return root; }
Example 14
Source File: SignInViewImpl.java From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 | 4 votes |
@Override public void postConstruct() { super.postConstruct(); setSizeFull(); layout = new VerticalLayout(); layout.setSizeFull(); layout.setSpacing(true); setCompositionRoot(layout); caption = new Label("Sign in to Vaadin4Spring Security Demo"); caption.addStyleName(ValoTheme.LABEL_H2); caption.setSizeUndefined(); layout.addComponent(caption); layout.setComponentAlignment(caption, Alignment.MIDDLE_CENTER); loginPanel = new VerticalLayout(); loginPanel.setSizeUndefined(); loginPanel.setSpacing(true); loginPanel.setMargin(true); layout.addComponent(loginPanel); layout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER); layout.setExpandRatio(loginPanel, 1); errorMessage = new Label(); errorMessage.setWidth("300px"); errorMessage.addStyleName(ValoTheme.LABEL_FAILURE); errorMessage.setVisible(false); loginPanel.addComponent(errorMessage); username = new TextField("Username"); username.setImmediate(true); username.setWidth("300px"); username.setNullRepresentation(""); username.setInputPrompt("Enter your username"); loginPanel.addComponent(username); password = new PasswordField("Password"); password.setImmediate(true); password.setWidth("300px"); password.setNullRepresentation(""); loginPanel.addComponent(password); rememberMe = new CheckBox("Remember me"); rememberMe.setValue(false); rememberMe.addStyleName(ValoTheme.CHECKBOX_LARGE); loginPanel.addComponent(rememberMe); btnLogin = new Button("Signin", FontAwesome.UNLOCK); btnLogin.addStyleName(ValoTheme.BUTTON_PRIMARY); btnLogin.addClickListener(this); btnLogin.setWidth("100%"); loginPanel.addComponent(btnLogin); final Label infoLabel = new Label(FontAwesome.INFO_CIRCLE.getHtml() + " You can sign in as: <br/>\"user\" with password \"user\" <br/>\"admin\" with password \"admin\".", ContentMode.HTML); infoLabel.setWidth("300px"); loginPanel.addComponent(infoLabel); }
Example 15
Source File: ArtifactDetailsLayout.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
private void createComponents() { prefixTitleOfArtifactDetails = new Label(); prefixTitleOfArtifactDetails.addStyleName(ValoTheme.LABEL_SMALL); prefixTitleOfArtifactDetails.addStyleName(ValoTheme.LABEL_BOLD); prefixTitleOfArtifactDetails.setSizeUndefined(); titleOfArtifactDetails = new Label(); titleOfArtifactDetails.setId(UIComponentIdProvider.ARTIFACT_DETAILS_HEADER_LABEL_ID); titleOfArtifactDetails.setSizeFull(); titleOfArtifactDetails.setImmediate(true); titleOfArtifactDetails.setWidth("100%"); titleOfArtifactDetails.addStyleName(ValoTheme.LABEL_SMALL); titleOfArtifactDetails.addStyleName("text-bold"); titleOfArtifactDetails.addStyleName("text-cut"); titleOfArtifactDetails.addStyleName("header-caption-right"); headerCaptionLayout = new HorizontalLayout(); headerCaptionLayout.setMargin(false); headerCaptionLayout.setSpacing(true); headerCaptionLayout.setSizeFull(); headerCaptionLayout.addStyleName("header-caption"); headerCaptionLayout.addComponent(prefixTitleOfArtifactDetails); headerCaptionLayout.setComponentAlignment(prefixTitleOfArtifactDetails, Alignment.TOP_LEFT); headerCaptionLayout.setExpandRatio(prefixTitleOfArtifactDetails, 0.0F); headerCaptionLayout.addComponent(titleOfArtifactDetails); headerCaptionLayout.setComponentAlignment(titleOfArtifactDetails, Alignment.TOP_LEFT); headerCaptionLayout.setExpandRatio(titleOfArtifactDetails, 1.0F); maxMinButton = createMaxMinButton(); artifactDetailsTable = createArtifactDetailsTable(); artifactDetailsTable.setContainerDataSource(createArtifactLazyQueryContainer()); addGeneratedColumn(artifactDetailsTable); if (!readOnly) { addGeneratedColumnButton(artifactDetailsTable); } setTableColumnDetails(artifactDetailsTable); }
Example 16
Source File: AddUpdateRolloutWindowLayout.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
private static Label getPercentHintLabel() { final Label percentSymbol = new Label("%"); percentSymbol.addStyleName(ValoTheme.LABEL_TINY + " " + ValoTheme.LABEL_BOLD); percentSymbol.setSizeUndefined(); return percentSymbol; }
Example 17
Source File: GroupsLegendLayout.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
private static Label createGroupTargetsLabel() { final Label label = new LabelBuilder().visible(false).name("").buildLabel(); label.addStyleName("rollout-group-count"); label.setSizeUndefined(); return label; }
Example 18
Source File: GroupsLegendLayout.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
private static Label createUnassignedTargetsLabel() { final Label label = new LabelBuilder().visible(false).name("").buildLabel(); label.addStyleName("rollout-group-unassigned"); label.setSizeUndefined(); return label; }
Example 19
Source File: WebUserIndicator.java From cuba with Apache License 2.0 | 4 votes |
@Override public void refreshUserSubstitutions() { component.removeAllComponents(); UserSessionSource uss = beanLocator.get(UserSessionSource.NAME); List<UserSubstitution> substitutions = getUserSubstitutions(); AppUI ui = AppUI.getCurrent(); User currentOrSubstitutedUser = uss.getUserSession().getCurrentOrSubstitutedUser(); if (substitutions.isEmpty()) { String substitutedUserCaption = getSubstitutedUserCaption(currentOrSubstitutedUser); userComboBox = null; userNameLabel = new Label(substitutedUserCaption); userNameLabel.setStyleName("c-user-select-label"); userNameLabel.setSizeUndefined(); if (ui != null && ui.isTestMode()) { userNameLabel.setCubaId("currentUserLabel"); } component.addComponent(userNameLabel); component.setDescription(substitutedUserCaption); } else { userNameLabel = null; userComboBox = new CubaComboBox<>(); userComboBox.setEmptySelectionAllowed(false); userComboBox.setItemCaptionGenerator(this::getSubstitutedUserCaption); userComboBox.setStyleName("c-user-select-combobox"); if (ui != null) { if (ui.isTestMode()) { userComboBox.setCubaId("substitutedUserSelect"); } if (ui.isPerformanceTestMode()) { userComboBox.setId(ui.getTestIdManager().getTestId("substitutedUserSelect")); } } List<User> options = new ArrayList<>(); User sessionUser = uss.getUserSession().getUser(); options.add(sessionUser); for (UserSubstitution substitution : substitutions) { User substitutedUser = substitution.getSubstitutedUser(); options.add(substitutedUser); } userComboBox.setItems(options); userComboBox.setValue(currentOrSubstitutedUser); userComboBox.addValueChangeListener(this::substitutedUserChanged); component.addComponent(userComboBox); component.setDescription(null); } adjustWidth(); adjustHeight(); }
Example 20
Source File: WebTimeZoneIndicator.java From cuba with Apache License 2.0 | 4 votes |
public WebTimeZoneIndicator() { component = new Label(); component.setSizeUndefined(); component.setStyleName(USER_TIMEZONE_LABEL_STYLENAME); }