Java Code Examples for com.vaadin.ui.VerticalLayout#setSpacing()

The following examples show how to use com.vaadin.ui.VerticalLayout#setSpacing() . 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: TargetBulkUpdateWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildLayout() {
    mainLayout = new VerticalLayout();
    mainLayout.setSpacing(Boolean.TRUE);
    mainLayout.setSizeUndefined();
    mainLayout.setWidth("200px");

    final HorizontalLayout captionLayout = new HorizontalLayout();
    captionLayout.setSizeFull();
    captionLayout.addComponents(windowCaption, minimizeButton, closeButton);
    captionLayout.setExpandRatio(windowCaption, 1.0F);
    captionLayout.addStyleName("v-window-header");

    final HorizontalLayout uploaderLayout = new HorizontalLayout();
    uploaderLayout.addComponent(bulkUploader);
    uploaderLayout.addComponent(linkToSystemConfigHelp);
    uploaderLayout.setComponentAlignment(linkToSystemConfigHelp, Alignment.BOTTOM_RIGHT);
    uploaderLayout.setExpandRatio(bulkUploader, 1.0F);
    uploaderLayout.setSizeFull();
    mainLayout.addComponents(captionLayout, dsNamecomboBox, descTextArea, tokenVerticalLayout, descTextArea,
            progressBar, targetsCountLabel, uploaderLayout);
}
 
Example 2
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 3
Source File: PolicyWorkspace.java    From XACML with MIT License 6 votes vote down vote up
@AutoGenerated
private VerticalLayout buildVerticalLayoutRightPanel() {
	// common part: create layout
	verticalLayoutRightPanel = new VerticalLayout();
	verticalLayoutRightPanel.setImmediate(false);
	verticalLayoutRightPanel.setWidth("100.0%");
	verticalLayoutRightPanel.setHeight("-1px");
	verticalLayoutRightPanel.setMargin(true);
	verticalLayoutRightPanel.setSpacing(true);
	
	// horizontalLayoutRightToolbar
	horizontalLayoutRightToolbar = buildHorizontalLayoutRightToolbar();
	verticalLayoutRightPanel.addComponent(horizontalLayoutRightToolbar);
	
	// tabSheet
	tabSheet = new TabSheet();
	tabSheet.setImmediate(true);
	tabSheet.setWidth("100.0%");
	tabSheet.setHeight("-1px");
	verticalLayoutRightPanel.addComponent(tabSheet);
	verticalLayoutRightPanel.setExpandRatio(tabSheet, 1.0f);
	
	return verticalLayoutRightPanel;
}
 
Example 4
Source File: GitSynchronizeWindow.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("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textAreaResults
	textAreaResults = new TextArea();
	textAreaResults.setCaption("Synch Results");
	textAreaResults.setImmediate(false);
	textAreaResults.setWidth("462px");
	textAreaResults.setHeight("222px");
	mainLayout.addComponent(textAreaResults);
	
	// buttonSynchronize
	buttonSynchronize = new Button();
	buttonSynchronize.setCaption("Synchronize");
	buttonSynchronize.setImmediate(true);
	buttonSynchronize.setWidth("-1px");
	buttonSynchronize.setHeight("-1px");
	mainLayout.addComponent(buttonSynchronize);
	mainLayout.setComponentAlignment(buttonSynchronize, new Alignment(24));
	
	return mainLayout;
}
 
Example 5
Source File: MultiFileUpload.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
protected Layout getprogressBarsLayout() {
    if (progressBars == null) {
        final VerticalLayout verticalLayout = new VerticalLayout();
        verticalLayout.setMargin(false);
        verticalLayout.setSpacing(false);
        progressBars = verticalLayout;
    }
    return progressBars;
}
 
Example 6
Source File: SelectWorkspacePoliciesWindow.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("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// treeWorkspace
	treeWorkspace = new TreeTable();
	treeWorkspace.setCaption("Select Policy(s) for PDP Group");
	treeWorkspace.setImmediate(true);
	treeWorkspace.setWidth("100.0%");
	treeWorkspace.setHeight("-1px");
	mainLayout.addComponent(treeWorkspace);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(false);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example 7
Source File: ConfirmDialog.java    From sensorhub with Mozilla Public License 2.0 5 votes vote down vote up
public ConfirmDialog(String caption, String message, String okButtonText, String cancelButtonText)
{
    super(caption);
    super.setModal(true);
    super.setClosable(false);
    super.setResizable(false);
    
    VerticalLayout windowLayout = new VerticalLayout();
    windowLayout.setMargin(true);
    
    // confirmation message
    windowLayout.addComponent(new Label(message, ContentMode.HTML));
    windowLayout.setSpacing(true);
    
    // buttons
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setWidth(100.0f, Unit.PERCENTAGE);
    windowLayout.addComponent(buttonsLayout);
    
    okButton = new Button(okButtonText);
    buttonsLayout.addComponent(okButton);
    okButton.setTabIndex(1);
    okButton.addClickListener(this);
    buttonsLayout.setComponentAlignment(okButton, Alignment.MIDDLE_CENTER);
            
    cancelButton = new Button(cancelButtonText);
    buttonsLayout.addComponent(cancelButton);
    cancelButton.setTabIndex(0);
    cancelButton.setClickShortcut(KeyCode.ESCAPE, null);
    cancelButton.addClickListener(this);
    buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_CENTER);
            
    super.setContent(windowLayout);
}
 
Example 8
Source File: ServerDescDetail.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setHeight("100%");
    addStyleName(Reindeer.PANEL_LIGHT);

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

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

    left = new DetailInfo();
    left.setWidth("200px");
    layout.addComponent(left);

    right = new DetailParameters();
    right.setWidth("100%");
    right.setHeight("100%");
    layout.addComponent(right);

    layout.setExpandRatio(right, 100);

    panel.addComponent(layout);
    panel.setExpandRatio(layout, 1.0f);
}
 
Example 9
Source File: PIPManagement.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");
	
	// horizontalLayoutToolbar
	horizontalLayoutToolbar = buildHorizontalLayoutToolbar();
	mainLayout.addComponent(horizontalLayoutToolbar);
	
	// tablePIP
	tablePIP = new Table();
	tablePIP.setCaption("PIP Configurations");
	tablePIP.setImmediate(false);
	tablePIP.setWidth("100.0%");
	tablePIP.setHeight("-1px");
	mainLayout.addComponent(tablePIP);
	
	return mainLayout;
}
 
Example 10
Source File: CubaColorPickerPopup.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
protected Component createSelectTab() {
    VerticalLayout selLayout = new VerticalLayout();
    selLayout.setSpacing(false);
    selLayout.setMargin(new MarginInfo(false, false, true, false));
    selLayout.addComponent(selPreview);
    selLayout.addStyleName("seltab");

    colorSelect = new CubaColorPickerSelect();
    colorSelect.addValueChangeListener(this::colorChanged);

    selLayout.addComponent(colorSelect);
    return selLayout;
}
 
Example 11
Source File: ToolEditorUI.java    From chipster with MIT License 5 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
	treeToolEditor = new TreeToolEditor(this);
	toolEditor = new ToolEditor(this);
	textEditor = new TextEditor(this);
	final Panel vLayout = new Panel();
	vSplitPanel = new VerticalSplitPanel();
	vSplitPanel.setSplitPosition(50, Unit.PERCENTAGE);
	vSplitPanel.setImmediate(true);
	vSplitPanel.setLocked(false);
	vSplitPanel.setWidth("100%");
	vLayout.setContent(vSplitPanel);
    setContent(vSplitPanel);
    VerticalLayout vvLayout = new VerticalLayout();
    vvLayout.setSizeFull();
    Label title = new Label("<h2><b>&nbsp;Tool Editor</b></h2>", ContentMode.HTML);

    vvLayout.addComponent(title);
    vvLayout.setComponentAlignment(title, Alignment.TOP_LEFT);
    HorizontalSplitPanel hSplitpPanel = new HorizontalSplitPanel();
    hSplitpPanel.setSizeFull();
    vvLayout.addComponent(hSplitpPanel);

    HorizontalLayout buttonPanel = getButtonPanel();
    vvLayout.addComponent(buttonPanel);
    vvLayout.setComponentAlignment(buttonPanel, Alignment.MIDDLE_CENTER);

    vvLayout.setExpandRatio(hSplitpPanel, 5);
    vvLayout.setComponentAlignment(hSplitpPanel, Alignment.TOP_LEFT);
    vvLayout.setMargin(false);
    vvLayout.setSpacing(false);
    hSplitpPanel.setFirstComponent(treeToolEditor);
    hSplitpPanel.setSecondComponent(toolEditor);
    vSplitPanel.setFirstComponent(vvLayout);
    vSplitPanel.setSecondComponent(textEditor);
    hSplitpPanel.setStyleName("topborder");
}
 
Example 12
Source File: MatchEditorWindow.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("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// tableFunctions
	tableFunctions = new Table();
	tableFunctions.setCaption("Function");
	tableFunctions.setImmediate(true);
	tableFunctions
			.setDescription("Select a function for matching the attribute.");
	tableFunctions.setWidth("100.0%");
	tableFunctions.setHeight("-1px");
	tableFunctions.setInvalidAllowed(false);
	tableFunctions.setRequired(true);
	mainLayout.addComponent(tableFunctions);
	mainLayout.setExpandRatio(tableFunctions, 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 13
Source File: AbstractMetadataPopupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
protected VerticalLayout createMetadataFieldsLayout() {
    final VerticalLayout metadataFieldsLayout = new VerticalLayout();
    metadataFieldsLayout.setSizeFull();
    metadataFieldsLayout.setHeight("100%");
    metadataFieldsLayout.addComponent(keyTextField);
    metadataFieldsLayout.addComponent(valueTextArea);
    metadataFieldsLayout.setSpacing(true);
    metadataFieldsLayout.setExpandRatio(valueTextArea, 1F);
    return metadataFieldsLayout;
}
 
Example 14
Source File: GoogleMapDemo.java    From serverside-elements with Apache License 2.0 5 votes vote down vote up
@Override
protected Component getDemoView() {
    CssLayout wrapper = new CssLayout();
    Root root = ElementIntegration.getRoot(wrapper);

    final Element googleMap = Elements.create("google-map");

    googleMap.setAttribute("style",
            "height: 500px; width: 500px; display: block");
    googleMap.setAttribute("latitude", "60.45235");
    googleMap.setAttribute("longitude", "22.299727");
    googleMap.setAttribute("zoom", "17");

    root.appendChild(googleMap);

    HorizontalLayout buttons = new HorizontalLayout(
            new Button("GWT.create US", event -> {
                googleMap.setAttribute("latitude", "37.414274");
                googleMap.setAttribute("longitude", "-122.077409");
            }), new Button("GWT.create EU", event -> {
                googleMap.setAttribute("latitude", "48.152663");
                googleMap.setAttribute("longitude", "11.598418");
            }));
    buttons.setSpacing(true);

    VerticalLayout layout = new VerticalLayout(buttons, wrapper);
    layout.setSpacing(true);
    return layout;
}
 
Example 15
Source File: PolicyEditor.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("-1px");
	mainLayout.setHeight("100.0%");
	mainLayout.setMargin(false);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("100.0%");
	
	// horizontalLayoutToolbar
	horizontalLayoutToolbar = buildHorizontalLayoutToolbar();
	mainLayout.addComponent(horizontalLayoutToolbar);
	mainLayout.setExpandRatio(horizontalLayoutToolbar, 1.0f);
	
	// tree
	tree = new TreeTable();
	tree.setImmediate(true);
	tree.setWidth("100.0%");
	tree.setHeight("100.0%");
	mainLayout.addComponent(tree);
	mainLayout.setExpandRatio(tree, 1.0f);
	
	return mainLayout;
}
 
Example 16
Source File: SQLPIPConfigurationComponent.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(false);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// comboBoxConnectionType
	comboBoxConnectionType = new ComboBox();
	comboBoxConnectionType.setCaption("Type of SQL Connection");
	comboBoxConnectionType.setImmediate(false);
	comboBoxConnectionType.setWidth("-1px");
	comboBoxConnectionType.setHeight("-1px");
	mainLayout.addComponent(comboBoxConnectionType);
	
	// textFieldDataSource
	textFieldDataSource = new TextField();
	textFieldDataSource.setCaption("Data Source");
	textFieldDataSource.setImmediate(false);
	textFieldDataSource.setWidth("-1px");
	textFieldDataSource.setHeight("-1px");
	mainLayout.addComponent(textFieldDataSource);
	mainLayout.setExpandRatio(textFieldDataSource, 1.0f);
	
	// comboBoxSQLDriver
	comboBoxSQLDriver = new ComboBox();
	comboBoxSQLDriver.setCaption("JDBC Driver");
	comboBoxSQLDriver.setImmediate(false);
	comboBoxSQLDriver.setWidth("-1px");
	comboBoxSQLDriver.setHeight("-1px");
	mainLayout.addComponent(comboBoxSQLDriver);
	mainLayout.setExpandRatio(comboBoxSQLDriver, 1.0f);
	
	// textFieldConnectionURL
	textFieldConnectionURL = new TextField();
	textFieldConnectionURL.setCaption("Connection URL");
	textFieldConnectionURL.setImmediate(false);
	textFieldConnectionURL.setWidth("-1px");
	textFieldConnectionURL.setHeight("-1px");
	mainLayout.addComponent(textFieldConnectionURL);
	mainLayout.setExpandRatio(textFieldConnectionURL, 1.0f);
	
	// textFieldUser
	textFieldUser = new TextField();
	textFieldUser.setCaption("User");
	textFieldUser.setImmediate(false);
	textFieldUser.setWidth("-1px");
	textFieldUser.setHeight("-1px");
	mainLayout.addComponent(textFieldUser);
	mainLayout.setExpandRatio(textFieldUser, 1.0f);
	
	// textFieldPassword
	textFieldPassword = new PasswordField();
	textFieldPassword.setCaption("Password");
	textFieldPassword.setImmediate(false);
	textFieldPassword.setWidth("-1px");
	textFieldPassword.setHeight("-1px");
	mainLayout.addComponent(textFieldPassword);
	mainLayout.setExpandRatio(textFieldPassword, 1.0f);
	
	// buttonTest
	buttonTest = new Button();
	buttonTest.setCaption("Test Connection");
	buttonTest.setImmediate(true);
	buttonTest.setWidth("-1px");
	buttonTest.setHeight("-1px");
	mainLayout.addComponent(buttonTest);
	mainLayout.setComponentAlignment(buttonTest, new Alignment(48));
	
	return mainLayout;
}
 
Example 17
Source File: ServerDescBasic.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void attach() {
    setHeight("100%");
    addStyleName(Reindeer.PANEL_LIGHT);

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

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

    // サーバ基本情報
    left = new BasicInfo();
    left.setWidth("100%");
    layout2.addComponent(left);

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

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

    // 割り当てサービス
    String enableService = Config.getProperty("ui.enableService");
    if (enableService == null || BooleanUtils.toBoolean(enableService)) {
        right = new AttachService();
        right.setHeight("100%");
        right.setWidth("100%");
        layout2.addComponent(right);
    }

    layout2.setExpandRatio(left, 40);
    if (right != null) {
        layout2.setExpandRatio(right, 60);
    } else {
        VerticalLayout dummyLayout = new VerticalLayout();
        dummyLayout.setSizeFull();
        layout2.addComponent(dummyLayout);
        layout2.setExpandRatio(dummyLayout, 60);
    }

    layout.addComponent(layout2);
    layout.setExpandRatio(layout2, 1.0f);
}
 
Example 18
Source File: AdviceEditorWindow.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");
	
	// textFieldAdviceID
	textFieldAdviceID = new TextField();
	textFieldAdviceID.setCaption("Advice ID");
	textFieldAdviceID.setImmediate(false);
	textFieldAdviceID.setWidth("-1px");
	textFieldAdviceID.setHeight("-1px");
	textFieldAdviceID.setInvalidAllowed(false);
	textFieldAdviceID.setRequired(true);
	textFieldAdviceID.setInputPrompt("Eg. urn:com:foo:advice:sample");
	mainLayout.addComponent(textFieldAdviceID);
	
	// optionGroupEffect
	optionGroupEffect = new OptionGroup();
	optionGroupEffect.setCaption("Applies To");
	optionGroupEffect.setImmediate(false);
	optionGroupEffect.setWidth("-1px");
	optionGroupEffect.setHeight("-1px");
	optionGroupEffect.setInvalidAllowed(false);
	optionGroupEffect.setRequired(true);
	mainLayout.addComponent(optionGroupEffect);
	
	// 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: 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);
}
 
Example 20
Source File: AbstractView.java    From cia with Apache License 2.0 3 votes vote down vote up
/**
 * Creates the full size vertical layout.
 *
 * @param margin
 *            the margin
 * @param spacing
 *            the spacing
 * @return the vertical layout
 */
private static VerticalLayout createFullSizeVerticalLayout(final boolean margin, final boolean spacing) {
	final VerticalLayout layout = new VerticalLayout();
	layout.setMargin(margin);
	layout.setSpacing(spacing);
	layout.setWidth(100, Unit.PERCENTAGE);
	layout.setHeight(100, Unit.PERCENTAGE);
	return layout;
}