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

The following examples show how to use com.vaadin.ui.Label#setWidth() . 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: UploadDropAreaLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private VerticalLayout createDropAreaLayout() {
    final VerticalLayout dropAreaLayout = new VerticalLayout();
    final Label dropHereLabel = new Label(i18n.getMessage(UIMessageIdProvider.LABEL_DROP_AREA_UPLOAD));
    dropHereLabel.setWidth(null);

    final Label dropIcon = new Label(FontAwesome.ARROW_DOWN.getHtml(), ContentMode.HTML);
    dropIcon.addStyleName("drop-icon");
    dropIcon.setWidth(null);

    dropAreaLayout.addComponent(dropIcon);
    dropAreaLayout.setComponentAlignment(dropIcon, Alignment.TOP_CENTER);
    dropAreaLayout.addComponent(dropHereLabel);
    dropAreaLayout.setComponentAlignment(dropHereLabel, Alignment.TOP_CENTER);

    uploadButtonLayout.setWidth(null);
    uploadButtonLayout.addStyleName("upload-button");
    dropAreaLayout.addComponent(uploadButtonLayout);
    dropAreaLayout.setComponentAlignment(uploadButtonLayout, Alignment.BOTTOM_CENTER);

    dropAreaLayout.setSizeFull();
    dropAreaLayout.setStyleName("upload-drop-area-layout-info");
    dropAreaLayout.setSpacing(false);
    return dropAreaLayout;
}
 
Example 2
Source File: AdminUI.java    From sensorhub with Mozilla Public License 2.0 6 votes vote down vote up
protected Component buildHeader()
{
    HorizontalLayout header = new HorizontalLayout();
    header.setMargin(false);
    header.setHeight(100.0f, Unit.PIXELS);
    header.setWidth(100.0f, Unit.PERCENTAGE);
    Image img = new Image(null, LOGO_ICON);
    img.setHeight(90, Unit.PIXELS);
    img.setStyleName(STYLE_LOGO);
    header.addComponent(img);
    Label title = new Label("SensorHub");
    title.addStyleName(UIConstants.STYLE_H1);
    title.addStyleName(STYLE_LOGO);
    title.setWidth(null);
    header.addComponent(title);
    header.setExpandRatio(img, 0);
    header.setExpandRatio(title, 1);
    header.setComponentAlignment(img, Alignment.MIDDLE_LEFT);
    header.setComponentAlignment(title, Alignment.MIDDLE_RIGHT);
    return header;
}
 
Example 3
Source File: RowUtil.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the row item.
 *
 * @param row         the row
 * @param button      the button
 * @param description the description
 */
public static void createRowItem(final ResponsiveRow row, final Button button, final String description) {
	final CssLayout layout = new CssLayout();
	layout.addStyleName("v-layout-content-overview-panel-level2");
	Responsive.makeResponsive(layout);
	layout.setSizeUndefined();

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

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

	row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE, DISPLAYS_SIZE_XM_DEVICE, DISPLAY_SIZE_MD_DEVICE,
			DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
 
Example 4
Source File: RowUtil.java    From cia with 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 5
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 6
Source File: LabelBuilder.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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: 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 8
Source File: SPUIComponentProvider.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * 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 9
Source File: AbstractMenuItemFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the button link.
 *
 * @param row
 *            the panel content
 * @param linkText
 *            the link text
 * @param icon
 *            the icon
 * @param command
 *            the command
 * @param description
 *            the description
 */
protected final void createButtonLink(final ResponsiveRow row,final String linkText,final Resource icon, final ClickListener command, final String description) {
	final CssLayout layout = new CssLayout();
	layout.addStyleName("v-layout-content-overview-panel-level2");
	Responsive.makeResponsive(layout);
	layout.setSizeUndefined();


	final Button button = new Button(linkText);
	Responsive.makeResponsive(button);
	button.setStyleName(LINK_STYLE_NAME);
	button.addStyleName("title");
	button.addClickListener(command);
	button.setIcon(icon);
	button.setWidth(100, Unit.PERCENTAGE);


	layout.addComponent(button);

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

	row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE,DISPLAYS_SIZE_XM_DEVICE,DISPLAY_SIZE_MD_DEVICE,DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
 
Example 10
Source File: SoftwareModuleAddUpdateWindow.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private CommonDialogWindow createWindow() {
    final Label madatoryStarLabel = new Label("*");
    madatoryStarLabel.setStyleName("v-caption v-required-field-indicator");
    madatoryStarLabel.setWidth(null);
    addStyleName("lay-color");
    setSizeUndefined();

    formLayout = new FormLayout();
    formLayout.setCaption(null);
    if (editSwModule) {
        formLayout.addComponent(softwareModuleType);
    } else {
        formLayout.addComponent(typeComboBox);
        typeComboBox.focus();
    }

    formLayout.addComponent(nameTextField);
    formLayout.addComponent(versionTextField);
    formLayout.addComponent(vendorTextField);
    formLayout.addComponent(descTextArea);

    setCompositionRoot(formLayout);

    final CommonDialogWindow window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW)
            .caption(i18n.getMessage("caption.create.new", i18n.getMessage("caption.software.module")))
            .id(UIComponentIdProvider.SW_MODULE_CREATE_DIALOG).content(this).layout(formLayout).i18n(i18n)
            .saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow();
    nameTextField.setEnabled(!editSwModule);
    versionTextField.setEnabled(!editSwModule);

    return window;
}
 
Example 11
Source File: AbstractElementsDemo.java    From serverside-elements with Apache License 2.0 5 votes vote down vote up
@Override
public void attach() {
    super.attach();
    if (layout.getComponentCount() == 0) {

        Label descriptionLabel = new Label(getDemoDescription());
        descriptionLabel.setWidth("600px");
        layout.addComponent(descriptionLabel);
        layout.addComponent(getDemoView());
    }
}
 
Example 12
Source File: AbstractHawkbitLoginUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
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 13
Source File: Box.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Try to imitate HorizontalStruct on Swing BoxLayout
 * @param layout Layout to add the struct
 * @param width struct withd
 */
public static void addHorizontalStruct(AbstractOrderedLayout layout, int width) {
	Label label = new Label();
	label.setWidth(width + "px");
	layout.addComponent(label);
	layout.setExpandRatio(label, 0f);
}
 
Example 14
Source File: Box.java    From jdal with Apache License 2.0 4 votes vote down vote up
/**
 * @param defaultSpace
 * @return new struct 
 */
public static Component createHorizontalStrut(int defaultSpace) {
	Label label = new Label(" ");
	label.setWidth(defaultSpace, Unit.PIXELS);
	return label;
}
 
Example 15
Source File: ArtifactDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
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: ServiceDescBasic.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void attach() {
    addStyleName(Reindeer.PANEL_LIGHT);
    setHeight("100%");

    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.addStyleName("service-desc-basic");
    setContent(layout);

    // サービス基本情報
    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setMargin(false);
    leftLayout.setSpacing(false);
    leftLayout.setWidth("100%");
    leftLayout.setHeight("100%");

    left = new BasicInfoOpe();
    left.setWidth("100%");
    leftLayout.addComponent(left);
    leftLayout.setExpandRatio(left, 1.0f);
    layout.addComponent(leftLayout);

    // 表同士の間隔をあける
    Label padding = new Label(" ");
    padding.setWidth("7px");
    padding.setHeight("99%");
    padding.addStyleName("desc-padding");
    layout.addComponent(padding);

    Label padding2 = new Label("");
    padding2.setWidth("1px");
    layout.addComponent(padding2);

    // 割り当てサーバ
    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setMargin(false);
    rightLayout.setSpacing(false);
    rightLayout.setWidth("100%");
    rightLayout.setHeight("100%");

    right = new AttachServersOpe();
    right.setWidth("100%");
    rightLayout.addComponent(right);
    serverOpe = new ServiceSvrOperation();
    rightLayout.addComponent(serverOpe);
    rightLayout.setExpandRatio(right, 1.0f);
    layout.addComponent(rightLayout);

    layout.setExpandRatio(leftLayout, 40);
    layout.setExpandRatio(rightLayout, 60);
}
 
Example 17
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 18
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 19
Source File: LoadBalancerDescServer.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void attach() {
    addStyleName(Reindeer.PANEL_LIGHT);
    setHeight("100%");

    VerticalLayout panel = (VerticalLayout) getContent();
    panel.setWidth("100%");
    panel.setHeight("100%");
    panel.setMargin(true);
    panel.setSpacing(false);
    panel.addStyleName("loadbalancer-desc-basic");

    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.addStyleName("loadbalancer-desc-basic");

    // ロードバランサ詳細情報
    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setWidth("100%");
    leftLayout.setHeight("100%");
    leftLayout.setMargin(true, false, false, false);
    leftLayout.setSpacing(false);

    loadBalancerInfo = new LoadBalancerDetailInfo();
    leftLayout.addComponent(loadBalancerInfo);
    leftLayout.setExpandRatio(loadBalancerInfo, 10);
    layout.addComponent(leftLayout);

    // 表同士の間隔をあける
    Label padding = new Label(" ");
    padding.setWidth("7px");
    padding.setHeight("99%");
    padding.addStyleName("desc-padding");
    layout.addComponent(padding);

    Label padding2 = new Label("");
    padding2.setWidth("1px");
    layout.addComponent(padding2);

    // 割り当てサーバ
    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setWidth("100%");
    rightLayout.setHeight("100%");
    rightLayout.setMargin(false);
    rightLayout.setSpacing(false);
    rightLayout.addStyleName("loadbalancer-desc-server-right");

    attachServiceServerTable = new AttachSeriviceServerTable();
    rightLayout.addComponent(attachServiceServerTable);
    loadBalancerOpe = new LoadbalancerServerOperation();
    rightLayout.addComponent(loadBalancerOpe);
    rightLayout.setExpandRatio(attachServiceServerTable, 100);
    layout.addComponent(rightLayout);

    layout.setExpandRatio(leftLayout, 48);
    layout.setExpandRatio(rightLayout, 52);

    panel.addComponent(layout);
}
 
Example 20
Source File: SignInViewImpl.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 4 votes vote down vote up
@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);
}