Java Code Examples for com.vaadin.ui.Label

The following examples show how to use com.vaadin.ui.Label. These examples are extracted from open source projects. 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
@Override
public void attach() {
    // テーブル基本設定
    setCaption(ViewProperties.getCaption("table.selectCloud"));
    setWidth("470px");
    setPageLength(4);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);
    addStyleName("win-server-add-cloud");

    // カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Cloud", Label.class, new Label());
    setColumnExpandRatio("Cloud", 100);
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example 2
public void show(List<PlatformDto> platforms) {
    removeAllItems();

    if (platforms == null) {
        return;
    }

    for (int i = 0; i < platforms.size(); i++) {
        PlatformDto platform = platforms.get(i);

        // プラットフォーム名
        Icons icon = IconUtils.getPlatformIcon(platform);
        String description = platform.getPlatform().getPlatformNameDisp();
        Label slbl = new Label(IconUtils.createImageTag(getApplication(), icon, description),
                Label.CONTENT_XHTML);
        slbl.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { (i + 1), slbl }, platform.getPlatform().getPlatformNo());
    }
}
 
Example 3
@Override
public void attach() {
    // テーブル基本設定
    setCaption(ViewProperties.getCaption("table.availableService"));
    setWidth("100%");
    setHeight("100px");
    setPageLength(3);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(false);
    setMultiSelect(false);
    setImmediate(true);
    addStyleName("win-server-add-service");

    //カラム設定
    addContainerProperty("Service", Label.class, new Label());
    addContainerProperty("Description", String.class, null);
    setColumnExpandRatio("Service", 100);
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example 4
Source Project: cia   Source File: AbstractView.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates the top title header.
 *
 * @param topHeader
 *            the top header
 */
private static void createTopTitleHeader(final HorizontalLayout topHeader) {
	final HorizontalLayout topTitleHeadertPanel = new HorizontalLayout();


	final Label titleLabel = new Label("Citizen Intelligence Agency");
	titleLabel.setStyleName("Header");
	topTitleHeadertPanel.addComponent(titleLabel);
	topTitleHeadertPanel.setComponentAlignment(titleLabel, Alignment.MIDDLE_LEFT);

	final Label sloganLabel = new Label("// Tracking politicians like bugs!");
	sloganLabel.setStyleName("HeaderSlogan");
	topTitleHeadertPanel.addComponent(sloganLabel);
	topTitleHeadertPanel.setComponentAlignment(sloganLabel, Alignment.MIDDLE_RIGHT);

	topHeader.addComponent(topTitleHeadertPanel);
	topHeader.setComponentAlignment(topTitleHeadertPanel, Alignment.MIDDLE_LEFT);
	topHeader.setExpandRatio(topTitleHeadertPanel, ContentRatio.GRID);
}
 
Example 5
@Override
public void attach() {
    // テーブル基本設定
    setWidth("100%");
    addStyleName("win-mycloud-add-temp");
    setCaption(ViewProperties.getCaption("table.selectTemplate"));
    setPageLength(4);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);

    // カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Name", Label.class, new Label());
    setColumnExpandRatio("Name", 100);

    // テーブルのカラムに対してStyleNameを設定
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example 6
public void show(List<String> types) {
    removeAllItems();

    if (types == null) {
        return;
    }

    for (int i = 0; i < types.size(); i++) {
        String type = types.get(i);

        // ロードバランサ種別
        Icons typeIcon = Icons.NONE;
        String typeString = ViewProperties.getLoadBalancerType(type);
        Label nlbl = new Label(IconUtils.createImageTag(getApplication(), typeIcon, typeString),
                Label.CONTENT_XHTML);
        nlbl.setHeight(COLUMN_HEIGHT);

        addItem(new Object[] { (i + 1), nlbl }, type);
    }
}
 
Example 7
Source Project: hawkbit   Source File: GroupsLegendLayout.java    License: 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 8
Source Project: usergrid   Source File: ModuleLayout.java    License: Apache License 2.0 6 votes vote down vote up
public void loadData( Table userTable ){
    ModuleDao moduleDao = InjectorFactory.getInstance( ModuleDao.class );
    List<Module> modules = moduleDao.getAll();
    for( final Module module : modules ) {
        Label groupLabel = new Label( module.getGroupId( ) );
        Label artifactLabel = new Label( module.getArtifactId( ) );
        Label versionLabel = new Label( module.getVersion( ) );

        Button detailsField = new Button( "show details" );
        detailsField.addStyleName( "link" );
        detailsField.addClickListener( new Button.ClickListener( ) {
            @Override
            public void buttonClick( Button.ClickEvent event ) {
                onItemClick( module.getId() );
            }
        } );
        userTable.addItem( new Object[]{ groupLabel, artifactLabel, versionLabel, detailsField }, module.getId( ) );
    }
}
 
Example 9
Source Project: jdal   Source File: FormUtils.java    License: Apache License 2.0 6 votes vote down vote up
/**
   * 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 10
@Override
public void attach() {
    // テーブル基本設定
    setCaption(ViewProperties.getCaption("table.selectService"));
    setWidth("440px");
    setPageLength(4);
    setSortDisabled(true);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);
    addStyleName("win-service-add-service");

    // カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Service", Label.class, new Label());
    addContainerProperty("Description", String.class, null);
    setColumnExpandRatio("Description", 100);
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example 11
private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();
    detailsTabLayout.removeAllComponents();

    final Label typeLabel = SPUIComponentProvider
            .createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type == null ? "" : type);
    typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
    detailsTabLayout.addComponent(typeLabel);

    final Label requiredMigrationStepLabel = SPUIComponentProvider.createNameValueLabel(
            getI18n().getMessage("checkbox.dist.migration.required"),
            getMigrationRequiredValue(isMigrationRequired));
    requiredMigrationStepLabel.setId(UIComponentIdProvider.DETAILS_REQUIRED_MIGRATION_STEP_LABEL_ID);
    if (!isMultiAssignmentEnabled()) {
        detailsTabLayout.addComponent(requiredMigrationStepLabel);
    }

}
 
Example 12
public void show(List<ComponentType> componentTypes) {
    removeAllItems();

    if (componentTypes == null) {
        return;
    }

    for (ComponentType componentType : componentTypes) {
        // サービス名
        String name = componentType.getComponentTypeNameDisp();
        Icons nameIcon = Icons.fromName(componentType.getComponentTypeName());
        Label slbl = new Label(IconUtils.createImageTag(getApplication(), nameIcon, name), Label.CONTENT_XHTML);
        slbl.setHeight("26px");

        // サービス説明
        String description = componentType.getLayerDisp();

        addItem(new Object[] { slbl, description }, componentType.getComponentTypeNo());
    }
}
 
Example 13
@Override
public void attach() {
    // テーブル基本設定
    setCaption(ViewProperties.getCaption("table.selectCloud"));
    setWidth("260px");
    setPageLength(6);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);
    addStyleName("win-server-add-cloud");

    //カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Cloud", Label.class, new Label());
    setColumnExpandRatio("Cloud", 100);
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example 14
Source Project: chipster   Source File: Tool.java    License: MIT License 6 votes vote down vote up
private void initElements() {
	lbId.setValue("Id:");
	lbModule = new Label("Module:");
	lbCategory = new Label("Category:");
	
	module = new ComboBox();
	module.setWidth(WIDTH);
	
	category = new ComboBox();
	category.setWidth(WIDTH);
	
	id.setImmediate(true);
	name.setRequired(true);
	name.setRequiredError(REQUIRED_TEXT);
	description.setRequired(true);
	description.setRequiredError(REQUIRED_TEXT);
}
 
Example 15
Source Project: cia   Source File: RowUtil.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates the row component.
 *
 * @param row         the row
 * @param component   the component
 * @param description the description
 */
public static void createRowComponent(final ResponsiveRow row, final Component component,
		final String description) {
	final CssLayout layout = new CssLayout();
	layout.addStyleName(".v-layout-content-pagemode-panel-level2");
	Responsive.makeResponsive(layout);
	layout.setSizeUndefined();

	final Label descriptionLabel = new Label(description);
	descriptionLabel.addStyleName(ITEMBOX);
	Responsive.makeResponsive(descriptionLabel);
	descriptionLabel.setWidth(100, Unit.PERCENTAGE);
	layout.addComponent(descriptionLabel);

	component.addStyleName(ITEMBOX);
	component.addStyleName(TITLE);
	Responsive.makeResponsive(component);
	component.setWidth(100, Unit.PERCENTAGE);
	layout.addComponent(component);

	row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE, DISPLAYS_SIZE_XM_DEVICE, DISPLAY_SIZE_MD_DEVICE,
			DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
 
Example 16
@Override
public void attach() {
    //テーブル基本設定
    setWidth("100%");

    setPageLength(4);
    setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
    setSortDisabled(true);
    setColumnReorderingAllowed(false);
    setColumnCollapsingAllowed(false);
    setSelectable(true);
    setMultiSelect(false);
    setNullSelectionAllowed(false);
    setImmediate(true);
    addStyleName("win-mycloud-edit-table");

    //カラム設定
    addContainerProperty("No", Integer.class, null);
    addContainerProperty("Name", Label.class, new Label());
    addContainerProperty("Description", String.class, null);
    setColumnExpandRatio("Name", 40);
    setColumnExpandRatio("Description", 60);

    //テーブルのカラムに対してStyleNameを設定
    setCellStyleGenerator(new StandardCellStyleGenerator());
}
 
Example 17
private void displayInfo(SimpleUser user) {
    Div infoDiv = new Div().appendText("You have not setup SMTP account properly. So we can not send the invitation by email automatically. Please copy/paste below paragraph and inform to the user by yourself").setStyle("font-weight:bold;color:red");
    Label infoLbl = new Label(infoDiv.write(), ContentMode.HTML);

    Div userInfoDiv = new Div().appendText("Your username is ").appendChild(new B().appendText(user.getEmail()));
    Label userInfoLbl = ELabel.html(userInfoDiv.write());

    if (Boolean.TRUE.equals(user.isAccountOwner())) {
        user.setRoleName(UserUIContext.getMessage(RoleI18nEnum.OPT_ACCOUNT_OWNER));
    }
    Div roleInfoDiv = new Div().appendText("Your role is ").appendChild(new B().appendText(user.getRoleName()));
    Label roleInfoLbl = new Label(roleInfoDiv.write(), ContentMode.HTML);
    contentLayout.with(infoLbl, userInfoLbl, roleInfoLbl);

    final Button addNewBtn = new Button("Create another user", clickEvent -> {
        EventBusFactory.getInstance().post(new UserEvent.GotoAdd(GetStartedInstructionWindow.this, null));
        close();
    });
    addNewBtn.setStyleName(WebThemes.BUTTON_ACTION);

    Button doneBtn = new Button(UserUIContext.getMessage(GenericI18Enum.ACTION_DONE), clickEvent -> close());
    doneBtn.setStyleName(WebThemes.BUTTON_ACTION);

    final MHorizontalLayout controlsBtn = new MHorizontalLayout(addNewBtn, doneBtn).withMargin(true);
    contentLayout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
}
 
Example 18
Source Project: hawkbit   Source File: TargetTable.java    License: 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 19
Source Project: hawkbit   Source File: TargetDetails.java    License: Eclipse Public License 1.0 6 votes vote down vote up
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);
}
 
Example 20
Source Project: mycollab   Source File: AboutWindow.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
public AboutWindow() {
    MHorizontalLayout content = new MHorizontalLayout().withMargin(true).withFullWidth();
    this.setContent(content);

    Image about = new Image("", new ExternalResource(StorageUtils.generateAssetRelativeLink(WebResourceIds._about)));

    MVerticalLayout rightPanel = new MVerticalLayout();
    ELabel versionLbl = ELabel.h2(String.format("MyCollab Community Edition %s", Version.getVersion())).withFullWidth();
    ELabel javaNameLbl = new ELabel(String.format("%s, %s", System.getProperty("java.vm.name"),
            System.getProperty("java.runtime.version"))).withFullWidth();
    Label homeFolderLbl = new Label("Home folder: " + AppContextUtil.getSpringBean(ServerConfiguration.class).getHomeDir().getAbsolutePath());
    WebBrowser browser = Page.getCurrent().getWebBrowser();
    ELabel osLbl = new ELabel(String.format("%s, %s", System.getProperty("os.name"), browser.getBrowserApplication())).withFullWidth();
    Div licenseDiv = new Div().appendChild(new Text("Powered by: "))
            .appendChild(new A("https://www.mycollab.com")
                    .appendText("MyCollab")).appendChild(new Text(". Open source under GPL license"));
    ELabel licenseLbl = ELabel.html(licenseDiv.write()).withFullWidth();
    Label copyRightLbl = ELabel.html(String.format("&copy; %s - %s MyCollab Ltd. All rights reserved", "2011",
            LocalDate.now().getYear() + "")).withFullWidth();
    rightPanel.with(versionLbl, javaNameLbl, osLbl, homeFolderLbl, licenseLbl, copyRightLbl).withAlign(copyRightLbl, Alignment.BOTTOM_LEFT);
    content.with(about, rightPanel).expand(rightPanel);
}
 
Example 21
protected void updateSoftwareModuleDetailsLayout(final String type, final String vendor, final String maxAssign) {
    final VerticalLayout detailsTabLayout = getDetailsLayout();

    detailsTabLayout.removeAllComponents();

    final Label vendorLabel = SPUIComponentProvider
            .createNameValueLabel(getI18n().getMessage("label.dist.details.vendor"), vendor == null ? "" : vendor);
    vendorLabel.setId(UIComponentIdProvider.DETAILS_VENDOR_LABEL_ID);
    detailsTabLayout.addComponent(vendorLabel);

    if (type != null) {
        final Label typeLabel = SPUIComponentProvider
                .createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type);
        typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
        detailsTabLayout.addComponent(typeLabel);
    }

    final Label assignLabel = SPUIComponentProvider
            .createNameValueLabel(getI18n().getMessage("label.assigned.type"), maxAssign == null ? "" : maxAssign);
    assignLabel.setId(UIComponentIdProvider.SWM_DTLS_MAX_ASSIGN);
    detailsTabLayout.addComponent(assignLabel);
}
 
Example 22
Source Project: cuba   Source File: WindowBreadCrumbs.java    License: Apache License 2.0 5 votes vote down vote up
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("&nbsp;&gt;&nbsp;");
            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 23
Source Project: grpc-by-example-java   Source File: ChatUI.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected void init(VaadinRequest vaadinRequest) {

  final UI currentUI = getCurrent();
  final StreamObserver<Chat.ChatMessage> observer = stub.chat(new StreamObserver<Chat.ChatMessageFromServer>() {
    @Override
    public void onNext(Chat.ChatMessageFromServer chatMessageFromServer) {
      currentUI.access(() -> layout.addComponent(new Label(String.format("%s: %s" ,
                                                                         chatMessageFromServer.getMessage().getFrom() ,
                                                                         chatMessageFromServer.getMessage().getMessage()))));
    }

    @Override
    public void onError(Throwable throwable) {
      logger.log(Level.SEVERE , "gRPC Error" , throwable);
    }

    @Override
    public void onCompleted() {
      logger.info("gRPC Call Completed");
    }
  });

  button.addClickListener(e -> {

    final String nameValue = name.getValue();
    final String messageValue = message.getValue();

    observer.onNext(Chat.ChatMessage.newBuilder()
                                    .setFrom(nameValue)
                                    .setMessage(messageValue)
                                    .build());
  });

}
 
Example 24
@Override
public void postConstruct() {	
	super.postConstruct();
	setSizeFull();
	layout = new CssLayout();
	layout.setSizeFull();
	setCompositionRoot(layout);
	
	
	final Label label = new Label("This is admin only view");
	label.addStyleName(ValoTheme.LABEL_H2);
	layout.addComponent(label);		
	
}
 
Example 25
Source Project: hawkbit   Source File: LabelBuilder.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private Label createLabel() {
    final Label label = new Label(name);
    label.setVisible(visible);
    final StringBuilder style = new StringBuilder(ValoTheme.LABEL_SMALL);
    style.append(' ');
    style.append(ValoTheme.LABEL_BOLD);
    label.addStyleName(style.toString());
    if (id != null) {
        label.setId(id);
    }

    return label;
}
 
Example 26
Source Project: gazpachoquest   Source File: LoginView.java    License: GNU General Public License v3.0 5 votes vote down vote up
protected HorizontalLayout createCompositionRootx() {
    VerticalLayout loginPanel = new VerticalLayout();
    loginPanel.setSpacing(true);
    loginPanel.setWidth("400px");

    Label header = new Label("Enter your invitation to start the questionnair");
    header.addStyleName(Reindeer.LABEL_H1);
    loginPanel.addComponent(header);

    invitation = new TextField("Invitation");
    invitation.setWidth("100%");
    invitation.focus();
    invitation.setValue("YAS5ICHRBE");
    loginPanel.addComponent(invitation);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    loginPanel.addComponent(buttons);
    loginPanel.setComponentAlignment(buttons, Alignment.MIDDLE_RIGHT);

    login = new Button("Start");
    login.setClickShortcut(KeyCode.ENTER);
    login.addStyleName(Reindeer.BUTTON_DEFAULT);
    login.addClickListener(createLoginButtonListener());
    buttons.addComponent(login);

    HorizontalLayout viewLayout = new HorizontalLayout();
    viewLayout.addComponent(loginPanel);
    viewLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
    viewLayout.setSizeFull();
    viewLayout.addStyleName(Reindeer.LAYOUT_BLUE);
    setSizeFull();

    return viewLayout;
}
 
Example 27
Source Project: hawkbit   Source File: AbstractHawkbitUI.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private HorizontalLayout buildViewTitle() {
    final HorizontalLayout viewHeadercontent = new HorizontalLayout();
    viewHeadercontent.setWidth("100%");
    viewHeadercontent.addStyleName("view-header-layout");

    viewTitle = new Label();
    viewTitle.setWidth("100%");
    viewTitle.setStyleName("header-content");
    viewHeadercontent.addComponent(viewTitle);

    viewHeadercontent.addComponent(notificationUnreadButton);
    viewHeadercontent.setComponentAlignment(notificationUnreadButton, Alignment.MIDDLE_RIGHT);
    return viewHeadercontent;
}
 
Example 28
Source Project: hawkbit   Source File: GroupsLegendLayout.java    License: Eclipse Public License 1.0 5 votes vote down vote up
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 29
Source Project: hawkbit   Source File: GroupsLegendLayout.java    License: 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 30
public ProgressBarIndicator() {
    super("progressBar");
    this.progressIndicator = new ProgressBar();
    this.progressIndicator.setWidth("100%");
    this.progressStatusLabel = new Label();
    this.progressStatusLabel.setWidth("100%");
    this.progressStatusLabel.setHeight("100%");
    this.addComponent(this.progressIndicator, "progressbar-container");
    this.addComponent(this.progressStatusLabel, "progressbar-status");
}