Java Code Examples for com.vaadin.ui.Alignment

The following examples show how to use com.vaadin.ui.Alignment. These examples are extracted from open source projects.
Example 1
Project: jdal   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 2
Project: hawkbit   File: MultipleTargetFilter.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private Component getSimpleFilterTab() {
    simpleFilterTab = new VerticalLayout();
    targetTagTableLayout = new VerticalLayout();
    targetTagTableLayout.setSizeFull();
    if (menu != null) {
        targetTagTableLayout.addComponent(menu);
        targetTagTableLayout.setComponentAlignment(menu, Alignment.TOP_RIGHT);
    }
    targetTagTableLayout.addComponent(filterByButtons);
    targetTagTableLayout.setComponentAlignment(filterByButtons, Alignment.MIDDLE_CENTER);
    targetTagTableLayout.setId(UIComponentIdProvider.TARGET_TAG_DROP_AREA_ID);
    targetTagTableLayout.setExpandRatio(filterByButtons, 1.0F);
    simpleFilterTab.setCaption(i18n.getMessage("caption.filter.simple"));
    simpleFilterTab.addComponent(targetTagTableLayout);
    simpleFilterTab.setExpandRatio(targetTagTableLayout, 1.0F);
    simpleFilterTab.addComponent(filterByStatusFooter);
    simpleFilterTab.setComponentAlignment(filterByStatusFooter, Alignment.MIDDLE_CENTER);
    simpleFilterTab.setSizeFull();
    simpleFilterTab.addStyleName(SPUIStyleDefinitions.SIMPLE_FILTER_HEADER);
    return simpleFilterTab;
}
 
Example 3
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 4
Project: gazpachoquest   File: QuestionnaireView.java    License: GNU General Public License v3.0 6 votes vote down vote up
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 5
Project: mycollab   File: SelectChildTicketWindow.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public Component generateRow(IBeanList<ProjectTicket> host, ProjectTicket item, int rowIndex) {
    MButton ticketLink = new MButton(item.getName(), clickEvent -> {
        if (item.getTypeId().equals(parentTicket.getTypeId())) {
            NotificationUtil.showErrorNotification(UserUIContext.getMessage(TaskI18nEnum.ERROR_CAN_NOT_ASSIGN_PARENT_TASK_TO_ITSELF));
        } else {
            TicketHierarchy ticketHierarchy = new TicketHierarchy();
            ticketHierarchy.setParentid(parentTicket.getTypeId());
            ticketHierarchy.setParenttype(parentTicket.getType());
            ticketHierarchy.setProjectid(CurrentProjectVariables.getProjectId());
            ticketHierarchy.setTicketid(item.getTypeId());
            ticketHierarchy.setTickettype(item.getType());
            TicketHierarchyMapper ticketHierarchyMapper = AppContextUtil.getSpringBean(TicketHierarchyMapper.class);
            ticketHierarchyMapper.insert(ticketHierarchy);
            EventBusFactory.getInstance().post(new TicketEvent.SubTicketAdded(this, item.getType(), item.getTypeId()));
        }

        close();
    }).withStyleName(WebThemes.BUTTON_LINK, WebThemes.TEXT_ELLIPSIS).withFullWidth();
    return new MHorizontalLayout(ELabel.fontIcon(ProjectAssetsManager.getAsset(item.getType())), ticketLink).expand(ticketLink).withStyleName("list-row").withFullWidth()
            .alignAll(Alignment.MIDDLE_LEFT);
}
 
Example 6
Project: usergrid   File: MainView.java    License: Apache License 2.0 6 votes vote down vote up
MainView( ) {
    this.setHeight( "100%" );

    VerticalLayout verticalLayoutForButtons = new VerticalLayout();
    verticalLayoutForButtons.setSizeFull();

    buttons = addButtons();
    this.addComponent( buttons );
    setComponentAlignment( buttons , Alignment.TOP_CENTER );

    tabSheet = addTabSheet();
    tabSheet.setSizeFull();
    this.addComponent( tabSheet );
    this.setComponentAlignment( tabSheet, Alignment.TOP_CENTER );

    this.setExpandRatio( buttons, 0.04f );
    this.setExpandRatio( tabSheet, 0.96f );
}
 
Example 7
Project: mycollab   File: GroupPageAddWindow.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public AbstractComponent getLayout() {
    final MVerticalLayout layout = new MVerticalLayout().withMargin(false);
    informationLayout = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);
    layout.addComponent(informationLayout.getLayout());

    final MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);

    MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> {
        if (EditForm.this.validateForm()) {
            PageService pageService = AppContextUtil.getSpringBean(PageService.class);
            pageService.createFolder(folder, UserUIContext.getUsername());
            folder.setCreatedTime(new GregorianCalendar());
            folder.setCreatedUser(UserUIContext.getUsername());
            GroupPageAddWindow.this.close();
            EventBusFactory.getInstance().post(new PageEvent.GotoList(GroupPageAddWindow.this, folder.getPath()));
        }
    }).withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION)
            .withClickShortcut(KeyCode.ENTER);

    MHorizontalLayout controlsBtn = new MHorizontalLayout(cancelBtn, saveBtn).withMargin(new MarginInfo(true, false, true, false));
    layout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
    return layout;
}
 
Example 8
Project: cia   File: AbstractView.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates the top header actions for user context.
 */
private void createTopHeaderActionsForUserContext() {
	if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN) || UserContextUtil.allowRoleInSecurityContext(ROLE_USER)) {
		final Link userHomePageLink = pageLinkFactory.createUserHomeViewPageLink();
		topHeaderRightPanel.addComponent(userHomePageLink);
		topHeaderRightPanel.setComponentAlignment(userHomePageLink, Alignment.MIDDLE_RIGHT);

		final Button logoutButton = new Button(LOGOUT,VaadinIcons.SIGN_OUT);

		final LogoutRequest logoutRequest = new LogoutRequest();
		logoutRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
		logoutButton.addClickListener(new LogoutClickListener(logoutRequest));

		topHeaderRightPanel.addComponent(logoutButton);
		topHeaderRightPanel.setComponentAlignment(logoutButton, Alignment.MIDDLE_RIGHT);

	} else {
		final Link createRegisterPageLink = pageLinkFactory.createRegisterPageLink();
		topHeaderRightPanel.addComponent(createRegisterPageLink);
		topHeaderRightPanel.setComponentAlignment(createRegisterPageLink, Alignment.MIDDLE_RIGHT);

		final Link createLoginPageLink = pageLinkFactory.createLoginPageLink();
		topHeaderRightPanel.addComponent(createLoginPageLink);
		topHeaderRightPanel.setComponentAlignment(createLoginPageLink, Alignment.MIDDLE_RIGHT);
	}
}
 
Example 9
Project: mycollab   File: MassUpdateWindow.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
protected ComponentContainer buildButtonControls() {
    MHorizontalLayout controlsLayout = new MHorizontalLayout().withMargin(true).withFullWidth();

    updateBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_UPDATE_LABEL), clickEvent -> {
        updateForm.commit();
        massUpdateCommand.massUpdate(beanItem);
        close();
    }).withStyleName(WebThemes.BUTTON_ACTION).withIcon(VaadinIcons.CLIPBOARD);

    closeBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLOSE), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);

    Label spacing = new Label();
    controlsLayout.with(spacing, closeBtn, updateBtn).alignAll(Alignment.MIDDLE_RIGHT).expand(spacing);
    return controlsLayout;
}
 
Example 10
Project: mycollab   File: VersionAddWindow.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
VersionAddWindow() {
    super(UserUIContext.getMessage(VersionI18nEnum.NEW));
    AdvancedEditBeanForm<Version> editForm = new AdvancedEditBeanForm<>();
    editForm.addFormHandler(this);
    editForm.setFormLayoutFactory(new DefaultDynaFormLayout(ProjectTypeConstants.VERSION,
            VersionDefaultFormLayoutFactory.getAddForm(), "id"));
    editForm.setBeanFormFieldFactory(new VersionEditFormFieldFactory(editForm));
    Version version = new Version();
    version.setProjectid(CurrentProjectVariables.getProjectId());
    version.setSaccountid(AppUI.getAccountId());
    version.setStatus(StatusI18nEnum.Open.name());
    editForm.setBean(version);
    ComponentContainer buttonControls = generateEditFormControls(editForm,
            CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.VERSIONS),
            false, true);
    withWidth("750px").withModal(true).withResizable(false).withContent(new MVerticalLayout(editForm,
            buttonControls).withAlign(buttonControls, Alignment.TOP_RIGHT)).withCenter();
}
 
Example 11
Project: mycollab   File: UpgradeConfirmWindow.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
public UpgradeConfirmWindow(final String version, String manualDownloadLink, final String installerFilePath) {
    super(UserUIContext.getMessage(ShellI18nEnum.OPT_NEW_UPGRADE_IS_READY));
    this.withModal(true).withResizable(false).withCenter().withWidth("600px");
    this.installerFilePath = installerFilePath;

    currentUI = UI.getCurrent();

    MVerticalLayout content = new MVerticalLayout();
    this.setContent(content);

    Div titleDiv = new Div().appendText(UserUIContext.getMessage(ShellI18nEnum.OPT_REQUEST_UPGRADE, version)).setStyle("font-weight:bold");
    content.with(ELabel.html(titleDiv.write()));

    Div manualInstallLink = new Div().appendText("&nbsp;&nbsp;&nbsp;&nbsp;" + UserUIContext.getMessage(ShellI18nEnum.OPT_MANUAL_INSTALL) + ": ")
            .appendChild(new A(manualDownloadLink, "_blank")
                    .appendText(UserUIContext.getMessage(ShellI18nEnum.OPT_DOWNLOAD_LINK)));
    content.with(ELabel.html(manualInstallLink.write()));

    Div manualUpgradeHowtoLink = new Div().appendText("&nbsp;&nbsp;&nbsp;&nbsp;" + UserUIContext.getMessage(ShellI18nEnum.OPT_MANUAL_UPGRADE) + ": ")
            .appendChild(new A("https://docs.mycollab.com/administration/upgrade-mycollab-automatically/", "_blank").appendText("Link"));
    content.with(ELabel.html(manualUpgradeHowtoLink.write()));

    Div releaseNoteLink = new Div().appendText("&nbsp;&nbsp;&nbsp;&nbsp;" + UserUIContext.getMessage(ShellI18nEnum.OPT_RELEASE_NOTES) + ": ")
            .appendChild(new A("https://docs.mycollab.com/administration/hosting-mycollab-on-your-own-server/releases/", "_blank").appendText("Link"));
    content.with(ELabel.html(releaseNoteLink.write()));

    MButton skipBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_SKIP), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);

    MButton autoUpgradeBtn = new MButton(UserUIContext.getMessage(ShellI18nEnum.ACTION_AUTO_UPGRADE), clickEvent -> {
        close();
        navigateToWaitingUpgradePage();
    }).withStyleName(WebThemes.BUTTON_ACTION);
    if (installerFilePath == null) {
        autoUpgradeBtn.setEnabled(false);
    }

    MHorizontalLayout buttonControls = new MHorizontalLayout(skipBtn, autoUpgradeBtn).withMargin(true);
    content.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_RIGHT);
}
 
Example 12
Project: XACML   File: PIPResolverEditorWindow.java    License: MIT License 5 votes vote down vote up
protected void initializeButtons() {
	this.grid.setComponentAlignment(this.buttonSave, Alignment.BOTTOM_CENTER);
	this.buttonSave.setImmediate(true);
	this.buttonSave.setEnabled(false);
	this.buttonSave.addClickListener(new ClickListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void buttonClick(ClickEvent event) {
			try {
				//
				// Commit changes
				//
				self.fieldGroup.commit();
				//
				// Save
				//
				self.isSaved = true;
				//
				// We can close
				//
				self.close();
			} catch (CommitException e) {
				logger.warn("Couldn't commit, the save button should NOT be enabled.");
			}
		}			
	});
}
 
Example 13
Project: viritin   File: PersonPickerExample.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected Component initContent() {
    selectBtn.setDescription("Click to select person.");
    selectBtn.addClickListener(e -> {
        getUI().addWindow(window);
    });
    return new MHorizontalLayout(display, selectBtn).alignAll(Alignment.MIDDLE_LEFT);
}
 
Example 14
Project: mycollab   File: ContactInfoChangeWindow.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
private void initUI() {
    MVerticalLayout mainLayout = new MVerticalLayout().withMargin(true).withFullWidth();

    GridFormLayoutHelper passInfo = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);

    passInfo.addComponent(txtWorkPhone, UserUIContext.getMessage(UserI18nEnum.FORM_WORK_PHONE), 0, 0);
    passInfo.addComponent(txtHomePhone, UserUIContext.getMessage(UserI18nEnum.FORM_HOME_PHONE), 0, 1);
    passInfo.addComponent(txtFaceBook, "Facebook", 0, 2);
    passInfo.addComponent(txtTwitter, "Twitter", 0, 3);
    passInfo.addComponent(txtSkype, "Skype", 0, 4);

    txtWorkPhone.setValue(MoreObjects.firstNonNull(user.getWorkphone(), ""));
    txtHomePhone.setValue(MoreObjects.firstNonNull(user.getHomephone(), ""));
    txtFaceBook.setValue(MoreObjects.firstNonNull(user.getFacebookaccount(), ""));
    txtTwitter.setValue(MoreObjects.firstNonNull(user.getTwitteraccount(), ""));
    txtSkype.setValue(MoreObjects.firstNonNull(user.getSkypecontact(), ""));
    mainLayout.addComponent(passInfo.getLayout());
    mainLayout.setComponentAlignment(passInfo.getLayout(), Alignment.TOP_LEFT);

    MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);

    MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> changeUserInfo())
            .withIcon(VaadinIcons.CLIPBOARD).withStyleName(WebThemes.BUTTON_ACTION).withClickShortcut(KeyCode.ENTER);

    MHorizontalLayout hlayoutControls = new MHorizontalLayout(cancelBtn, saveBtn);
    mainLayout.with(hlayoutControls).withAlign(hlayoutControls, Alignment.MIDDLE_RIGHT);
    this.setContent(mainLayout);
}
 
Example 15
Project: hawkbit   File: TenantConfigurationDashboardView.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Init method adds all Configuration Views to the list of Views.
 */
@PostConstruct
public void init() {
    if (defaultDistributionSetTypeLayout.getComponentCount() > 0) {
        configurationViews.add(defaultDistributionSetTypeLayout);
    }
    configurationViews.add(repositoryConfigurationView);
    configurationViews.add(rolloutConfigurationView);
    configurationViews.add(authenticationConfigurationView);
    configurationViews.add(pollingConfigurationView);
    if (customConfigurationViews != null) {
        configurationViews.addAll(
                customConfigurationViews.stream().filter(ConfigurationGroup::show).collect(Collectors.toList()));
    }

    final Panel rootPanel = new Panel();
    rootPanel.setStyleName("tenantconfig-root");

    final VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setSizeFull();
    rootLayout.setMargin(true);
    rootLayout.setSpacing(true);

    configurationViews.forEach(rootLayout::addComponent);

    final HorizontalLayout buttonContent = saveConfigurationButtonsLayout();
    rootLayout.addComponent(buttonContent);
    rootLayout.setComponentAlignment(buttonContent, Alignment.BOTTOM_LEFT);
    rootPanel.setContent(rootLayout);
    setCompositionRoot(rootPanel);

    configurationViews.forEach(view -> view.addChangeListener(this));
}
 
Example 16
Project: hawkbit   File: AbstractHawkbitLoginUI.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private void addFooter(final VerticalLayout rootLayout) {
    final Resource resource = context
            .getResource("classpath:/VAADIN/themes/" + UI.getCurrent().getTheme() + "/layouts/footer.html");

    try (final InputStream resourceStream = resource.getInputStream()) {
        final CustomLayout customLayout = new CustomLayout(resourceStream);
        customLayout.setSizeUndefined();
        rootLayout.addComponent(customLayout);
        rootLayout.setComponentAlignment(customLayout, Alignment.BOTTOM_LEFT);
    } catch (final IOException ex) {
        LOG.error("Footer file cannot be loaded", ex);
    }
}
 
Example 17
Project: mycollab   File: GridCellWrapper.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
GridCellWrapper(Component captionComp) {
    this.captionComp = captionComp;
    fieldWrapper = new MHorizontalLayout().withFullWidth();
    if (captionComp != null) {
        this.withSpacing(true).with(captionComp, fieldWrapper).withAlign(captionComp, Alignment.TOP_LEFT).withMargin(true).withFullWidth().withStyleName("gridform-field");
    } else {
        this.withSpacing(true).with(fieldWrapper).withMargin(true).withFullWidth().withStyleName("gridform-field");
    }
}
 
Example 18
Project: hawkbit   File: FilterManagementView.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private void viewListView() {
    removeAllComponents();
    final VerticalLayout tableListViewLayout = new VerticalLayout();
    tableListViewLayout.setSizeFull();
    tableListViewLayout.setSpacing(false);
    tableListViewLayout.setMargin(false);
    tableListViewLayout.setStyleName("table-layout");
    tableListViewLayout.addComponent(targetFilterHeader);
    tableListViewLayout.setComponentAlignment(targetFilterHeader, Alignment.TOP_CENTER);
    tableListViewLayout.addComponent(targetFilterTable);
    tableListViewLayout.setComponentAlignment(targetFilterTable, Alignment.TOP_CENTER);
    tableListViewLayout.setExpandRatio(targetFilterTable, 1.0F);
    addComponent(tableListViewLayout);
}
 
Example 19
Project: hawkbit   File: TargetFilterHeader.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    final HorizontalLayout titleFilterIconsLayout = createHeaderFilterIconLayout();
    titleFilterIconsLayout.addComponents(headerCaption, searchField, searchResetIcon);
    if (permissionChecker.hasCreateTargetPermission()) {
        titleFilterIconsLayout.addComponent(createfilterButton);
        titleFilterIconsLayout.setComponentAlignment(createfilterButton, Alignment.TOP_LEFT);
    }
    titleFilterIconsLayout.setExpandRatio(headerCaption, 0.3F);
    titleFilterIconsLayout.setExpandRatio(searchField, 0.7F);
    titleFilterIconsLayout.setHeight("40px");
    addComponent(titleFilterIconsLayout);
    addStyleName("bordered-layout");
    addStyleName("no-border-bottom");

}
 
Example 20
Project: hawkbit   File: AbstractTagLayout.java    License: Eclipse Public License 1.0 5 votes vote down vote up
protected void buildLayout() {
    mainLayout = new GridLayout(3, 2);
    mainLayout.setSpacing(true);
    colorPickerLayout = new ColorPickerLayout();
    ColorPickerHelper.setRgbSliderValues(colorPickerLayout);
    contentLayout = new VerticalLayout();

    colorLabelLayout = new HorizontalLayout();
    colorLabelLayout.setMargin(false);
    colorLabelLayout.addComponents(colorLabel, tagColorPreviewBtn);

    formLayout.addComponent(tagName);
    formLayout.addComponent(tagDesc);
    formLayout.setSizeFull();

    contentLayout.addComponent(formLayout);
    contentLayout.addComponent(colorLabelLayout);
    contentLayout.setComponentAlignment(formLayout, Alignment.MIDDLE_CENTER);
    contentLayout.setComponentAlignment(colorLabelLayout, Alignment.MIDDLE_LEFT);
    contentLayout.setSizeUndefined();

    mainLayout.setSizeFull();
    mainLayout.addComponent(contentLayout, 0, 0);

    colorPickerLayout.setVisible(false);
    mainLayout.addComponent(colorPickerLayout, 1, 0);
    mainLayout.setComponentAlignment(colorPickerLayout, Alignment.MIDDLE_CENTER);

    setCompositionRoot(mainLayout);
    tagName.focus();
}
 
Example 21
Project: XACML   File: RegexpEditorComponent.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
	// common part: create layout
	verticalLayout_2 = new VerticalLayout();
	verticalLayout_2.setImmediate(false);
	verticalLayout_2.setWidth("100.0%");
	verticalLayout_2.setHeight("100.0%");
	verticalLayout_2.setMargin(false);
	
	// textFieldTestValue
	textFieldTestValue = new TextField();
	textFieldTestValue.setCaption("Test Value");
	textFieldTestValue.setImmediate(true);
	textFieldTestValue
			.setDescription("Enter a value to match against the regular expression.");
	textFieldTestValue.setWidth("-1px");
	textFieldTestValue.setHeight("-1px");
	textFieldTestValue.setInputPrompt("eg. example");
	verticalLayout_2.addComponent(textFieldTestValue);
	
	// buttonTest
	buttonTest = new Button();
	buttonTest.setCaption("Test");
	buttonTest.setImmediate(true);
	buttonTest.setWidth("-1px");
	buttonTest.setHeight("-1px");
	verticalLayout_2.addComponent(buttonTest);
	verticalLayout_2.setComponentAlignment(buttonTest, new Alignment(48));
	
	return verticalLayout_2;
}
 
Example 22
Project: mycollab   File: ProjectPagedList.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
protected MHorizontalLayout createPageControls() {
    MHorizontalLayout pageControls = super.createPageControls();
    if (pageControls != null) {
        Button browseProjectsBtn = new Button(UserUIContext.getMessage(ProjectI18nEnum.ACTION_BROWSE),
                clickEvent -> EventBusFactory.getInstance().post(new ProjectEvent.GotoList(this, null)));
        browseProjectsBtn.addStyleName(WebThemes.BUTTON_LINK);
        pageControls.addComponent(browseProjectsBtn, 0);
        pageControls.setComponentAlignment(browseProjectsBtn, Alignment.MIDDLE_LEFT);
    }
    return pageControls;
}
 
Example 23
Project: XACML   File: SelectPIPConfigurationWindow.java    License: 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");
	
	// table
	table = new Table();
	table.setCaption("PIP Configurations");
	table.setImmediate(false);
	table.setWidth("-1px");
	table.setHeight("-1px");
	mainLayout.addComponent(table);
	
	// 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 24
Project: hawkbit   File: DeploymentView.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private void maximizeActionHistory() {
    removeComponent(countMessageLabel);
    mainLayout.removeAllComponents();
    mainLayout.setColumns(3);
    mainLayout.setRows(1);
    mainLayout.addComponent(actionHistoryLayout, 0, 0);
    mainLayout.addComponent(actionStatusLayout, 1, 0);
    mainLayout.addComponent(actionStatusMsgLayout, 2, 0);
    mainLayout.setColumnExpandRatio(0, 0.55F);
    mainLayout.setColumnExpandRatio(1, 0.18F);
    mainLayout.setColumnExpandRatio(2, 0.27F);
    mainLayout.setComponentAlignment(actionHistoryLayout, Alignment.TOP_LEFT);
}
 
Example 25
private HorizontalLayout createTwinColumnLayout() {
    final HorizontalLayout twinColumnLayout = new HorizontalLayout();
    twinColumnLayout.setSizeFull();
    twinColumnLayout.setWidth("400px");

    buildSourceTable();
    buildSelectedTable();

    final VerticalLayout selectButtonLayout = new VerticalLayout();
    final Button selectButton = SPUIComponentProvider.getButton(UIComponentIdProvider.SELECT_DIST_TYPE, "", "",
            "arrow-button", true, FontAwesome.FORWARD, SPUIButtonStyleNoBorder.class);
    selectButton.addClickListener(event -> addSMType());
    final Button unSelectButton = SPUIComponentProvider.getButton("unselect-dist-type", "", "", "arrow-button",
            true, FontAwesome.BACKWARD, SPUIButtonStyleNoBorder.class);
    unSelectButton.addClickListener(event -> removeSMType());
    selectButtonLayout.addComponent(selectButton);
    selectButtonLayout.addComponent(unSelectButton);
    selectButtonLayout.setComponentAlignment(selectButton, Alignment.MIDDLE_CENTER);
    selectButtonLayout.setComponentAlignment(unSelectButton, Alignment.MIDDLE_CENTER);

    twinColumnLayout.addComponent(sourceTable);
    twinColumnLayout.addComponent(selectButtonLayout);
    twinColumnLayout.addComponent(selectedTable);
    twinColumnLayout.setComponentAlignment(sourceTable, Alignment.MIDDLE_LEFT);
    twinColumnLayout.setComponentAlignment(selectButtonLayout, Alignment.MIDDLE_CENTER);
    twinColumnLayout.setComponentAlignment(selectedTable, Alignment.MIDDLE_RIGHT);
    twinColumnLayout.setExpandRatio(sourceTable, 0.45F);
    twinColumnLayout.setExpandRatio(selectButtonLayout, 0.07F);
    twinColumnLayout.setExpandRatio(selectedTable, 0.48F);
    sourceTable.setVisibleColumns(DIST_TYPE_NAME);
    return twinColumnLayout;
}
 
Example 26
Project: chipster   File: ToolEditorUI.java    License: 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 27
Project: XACML   File: RangeEditorComponent.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
	// common part: create layout
	verticalLayout_2 = new VerticalLayout();
	verticalLayout_2.setImmediate(false);
	verticalLayout_2.setWidth("100.0%");
	verticalLayout_2.setHeight("100.0%");
	verticalLayout_2.setMargin(false);
	verticalLayout_2.setSpacing(true);
	
	// textFieldTestInput
	textFieldTestInput = new TextField();
	textFieldTestInput.setCaption("Value");
	textFieldTestInput.setImmediate(true);
	textFieldTestInput.setDescription("Enter a value to test against.");
	textFieldTestInput.setWidth("-1px");
	textFieldTestInput.setHeight("-1px");
	textFieldTestInput.setInputPrompt("eg. 50");
	verticalLayout_2.addComponent(textFieldTestInput);
	
	// buttonValidate
	buttonValidate = new Button();
	buttonValidate.setCaption("Test");
	buttonValidate.setImmediate(true);
	buttonValidate
			.setDescription("Click to test if value is within the range.");
	buttonValidate.setWidth("-1px");
	buttonValidate.setHeight("-1px");
	verticalLayout_2.addComponent(buttonValidate);
	verticalLayout_2.setComponentAlignment(buttonValidate,
			new Alignment(48));
	
	return verticalLayout_2;
}
 
Example 28
Project: hawkbit   File: AbstractFilterLayout.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private void buildLayout() {
    setWidth(SPUIDefinitions.FILTER_BY_TYPE_WIDTH, Unit.PIXELS);
    setStyleName("filter-btns-main-layout");
    setHeight(100.0F, Unit.PERCENTAGE);
    setSpacing(false);
    setMargin(false);

    addComponents(filterHeader, filterButtons);

    setComponentAlignment(filterHeader, Alignment.TOP_CENTER);
    setComponentAlignment(filterButtons, Alignment.TOP_CENTER);

    setExpandRatio(filterButtons, 1.0F);
}
 
Example 29
Project: XACML   File: AttributeDictionarySelectorComponent.java    License: MIT License 5 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_2() {
	// common part: create layout
	horizontalLayout_2 = new HorizontalLayout();
	horizontalLayout_2.setImmediate(false);
	horizontalLayout_2.setWidth("-1px");
	horizontalLayout_2.setHeight("-1px");
	horizontalLayout_2.setMargin(false);
	horizontalLayout_2.setSpacing(true);
	
	// comboBoxCategoryFilter
	comboBoxCategoryFilter = new ComboBox();
	comboBoxCategoryFilter.setCaption("Filter Category");
	comboBoxCategoryFilter.setImmediate(false);
	comboBoxCategoryFilter.setWidth("-1px");
	comboBoxCategoryFilter.setHeight("-1px");
	horizontalLayout_2.addComponent(comboBoxCategoryFilter);
	horizontalLayout_2.setExpandRatio(comboBoxCategoryFilter, 1.0f);
	
	// buttonNewAttribute
	buttonNewAttribute = new Button();
	buttonNewAttribute.setCaption("New Attribute");
	buttonNewAttribute.setImmediate(true);
	buttonNewAttribute
			.setDescription("Click to create a new attribute in the dictionary.");
	buttonNewAttribute.setWidth("-1px");
	buttonNewAttribute.setHeight("-1px");
	horizontalLayout_2.addComponent(buttonNewAttribute);
	horizontalLayout_2.setComponentAlignment(buttonNewAttribute,
			new Alignment(10));
	
	return horizontalLayout_2;
}
 
Example 30
Project: hawkbit   File: AbstractGridComponentLayout.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Layouts header, grid and optional footer.
 */
protected void buildLayout() {
    setSizeFull();
    setSpacing(true);
    setMargin(false);
    setStyleName("group");
    final VerticalLayout gridHeaderLayout = new VerticalLayout();
    gridHeaderLayout.setSizeFull();
    gridHeaderLayout.setSpacing(false);
    gridHeaderLayout.setMargin(false);

    gridHeaderLayout.setStyleName("table-layout");
    gridHeaderLayout.addComponent(gridHeader);

    gridHeaderLayout.setComponentAlignment(gridHeader, Alignment.TOP_CENTER);
    gridHeaderLayout.addComponent(grid);
    gridHeaderLayout.setComponentAlignment(grid, Alignment.TOP_CENTER);
    gridHeaderLayout.setExpandRatio(grid, 1.0F);

    addComponent(gridHeaderLayout);
    setComponentAlignment(gridHeaderLayout, Alignment.TOP_CENTER);
    setExpandRatio(gridHeaderLayout, 1.0F);
    if (hasFooterSupport()) {
        final Layout footerLayout = getFooterSupport().createFooterMessageComponent();
        addComponent(footerLayout);
        setComponentAlignment(footerLayout, Alignment.BOTTOM_CENTER);
    }

}
 
Example 31
Project: hawkbit   File: DefaultGridHeader.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Builds the layout for the header component.
 */
protected void buildComponent() {
    addComponent(titleLayout);
    setComponentAlignment(titleLayout, Alignment.TOP_LEFT);
    setWidth(100, Unit.PERCENTAGE);
    setImmediate(true);
    addStyleName("action-history-header");
    addStyleName("bordered-layout");
    addStyleName("no-border-bottom");
}
 
Example 32
Project: hawkbit   File: CommonDialogWindow.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private void createCancelButton() {
    cancelButton = SPUIComponentProvider.getButton(UIComponentIdProvider.CANCEL_BUTTON,
            i18n.getMessage(UIMessageIdProvider.BUTTON_CANCEL), "", "", true, FontAwesome.TIMES,
            SPUIButtonStyleNoBorderWithIcon.class);
    cancelButton.setSizeUndefined();
    cancelButton.addStyleName("default-color");
    addCloseListenerForCancelButton();
    if (cancelButtonClickListener != null) {
        cancelButton.addClickListener(cancelButtonClickListener);
    }

    buttonsLayout.addComponent(cancelButton);
    buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_LEFT);
    buttonsLayout.setExpandRatio(cancelButton, 1.0F);
}
 
Example 33
Project: XACML   File: SelectPDPGroupWindow.java    License: 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");
	
	// listSelectPDPGroup
	listSelectPDPGroup = new ListSelect();
	listSelectPDPGroup.setImmediate(false);
	listSelectPDPGroup.setWidth("-1px");
	listSelectPDPGroup.setHeight("-1px");
	listSelectPDPGroup.setInvalidAllowed(false);
	listSelectPDPGroup.setRequired(true);
	mainLayout.addComponent(listSelectPDPGroup);
	mainLayout.setExpandRatio(listSelectPDPGroup, 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 34
Project: viritin   File: ElementCollectionField.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void addInternalElement(final ET v) {
    ensureInited();
    items.add(v);
    MBeanFieldGroup<ET> fg = getFieldGroupFor(v);
    for (Object property : getVisibleProperties()) {
        Component c = fg.getField(property);
        if (c == null) {
            c = getComponentFor(v, property.toString());
            Logger.getLogger(ElementCollectionField.class.getName())
                    .log(Level.WARNING, "No editor field for{0}", property);
        }
        layout.addComponent(c);
        layout.setComponentAlignment(c, Alignment.MIDDLE_LEFT);
    }
    if (getPopupEditor() != null) {
        MButton b = new MButton(VaadinIcons.PENCIL)
                .withStyleName(ValoTheme.BUTTON_ICON_ONLY)
                .withListener(new Button.ClickListener() {
            private static final long serialVersionUID = 5019806363620874205L;
            @Override
            public void buttonClick(Button.ClickEvent event) {
                editInPopup(v);
            }
        });
        layout.add(b);
    }
    if (isAllowRemovingItems()) {
        layout.add(createRemoveButton(v));
    }
    if (!isAllowEditItems()) {
        fg.setReadOnly(true);
    }
}
 
Example 35
Project: jpa-invoicer   File: InvoicesView.java    License: The Unlicense 5 votes vote down vote up
@PostConstruct
public void initComponent() {
    table.setColumnCollapsingAllowed(true);
    table.setColumnWidth("invoiceDate", 105);
    table.setColumnWidth("lastEdited", 105);
    table.setColumnWidth("lastEditor", 110);
    if (session.getUser().getAdministrates().isEmpty()) {
        Notification.show("Add invoicer first!");
        ViewMenuUI.getMenu().navigateTo(MyAccount.class);
        return;
    }
    sender.addMValueChangeListener(e -> listEntities());

    form.setResetHandler(this::reset);
    form.setSavedHandler(this::save);

    table.addMValueChangeListener(e -> {
        if (e.getValue() != null) {
            form.setEntity(e.getValue());
            form.openInModalPopup();
        }
    });

    listEntities();

    Button addButton = new Button("Add", e -> {
        final Invoice invoice = facade.createFor(sender.getValue());
        form.setEntity(invoice);
        form.openInModalPopup();
    });

    add(
            new MHorizontalLayout(addButton, sender).space().add(backup)
            .alignAll(Alignment.MIDDLE_LEFT)
    );
    expand(table);
}
 
Example 36
Project: usergrid   File: RunnersLayout.java    License: Apache License 2.0 5 votes vote down vote up
private void addRefreshButton()  {

        Button button = new Button( "Refresh" );
        button.setWidth( "100px" );

        button.addClickListener( new Button.ClickListener() {
            public void buttonClick( Button.ClickEvent event ) {
                loadData();
            }
        });

        addComponent( button );
        this.setComponentAlignment( button, Alignment.BOTTOM_CENTER );
    }
 
Example 37
Project: XACML   File: ExpressionSelectionWindow.java    License: 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");
	
	// optionGroupExpression
	optionGroupExpression = new OptionGroup();
	optionGroupExpression
			.setCaption("Select One Of The Following Types of Expressions");
	optionGroupExpression.setImmediate(false);
	optionGroupExpression.setWidth("-1px");
	optionGroupExpression.setHeight("-1px");
	mainLayout.addComponent(optionGroupExpression);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Select");
	buttonSave.setImmediate(false);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(24));
	
	return mainLayout;
}
 
Example 38
private void displayInfo(InviteMembers invitation) {
    Div infoDiv = new Div().appendText(UserUIContext.getMessage(ProjectMemberI18nEnum.OPT_NO_SMTP_SEND_MEMBERS))
            .setStyle("font-weight:bold;color:red");
    contentLayout.with(ELabel.html(infoDiv.write()));

    Div introDiv = new Div().appendText("Below users are invited to the project ")
            .appendChild(new B().appendText(CurrentProjectVariables.getProject().getName()))
            .appendText(" as role ").appendChild(new B().appendText(invitation.getRoleName()));
    contentLayout.with(ELabel.html(introDiv.write()));

    MVerticalLayout linksContainer = new MVerticalLayout().withStyleName(WebThemes.SCROLLABLE_CONTAINER);
    contentLayout.with(linksContainer);

    Collection<String> inviteEmails = invitation.getEmails();
    for (String inviteEmail : inviteEmails) {
        Div userEmailDiv = new Div().appendText(String.format("&nbsp;&nbsp;&nbsp;&nbsp;%s %s: ", VaadinIcons.PAPERPLANE.getHtml(),
                UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL))).appendChild(new A().setHref("mailto:" + inviteEmail)
                .appendText(inviteEmail));
        linksContainer.with(ELabel.html(userEmailDiv.write()), ELabel.hr());
    }

    MButton addNewBtn = new MButton(UserUIContext.getMessage(ProjectMemberI18nEnum.ACTION_INVITE_MORE_MEMBERS), clickEvent -> {
        EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoInviteMembers(CanSendEmailInstructionWindow.this, null));
        close();
    }).withStyleName(WebThemes.BUTTON_ACTION);

    MButton doneBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.ACTION_DONE), clickEvent -> {
        EventBusFactory.getInstance().post(new ProjectMemberEvent.GotoList(this, CurrentProjectVariables.getProjectId()));
        close();
    }).withStyleName(WebThemes.BUTTON_ACTION);

    MHorizontalLayout controlsBtn = new MHorizontalLayout(addNewBtn, doneBtn).withMargin(true);
    contentLayout.with(controlsBtn).withAlign(controlsBtn, Alignment.MIDDLE_RIGHT);
}
 
Example 39
Project: sensorhub   File: ConfirmDialog.java    License: 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 40
Project: XACML   File: XacmlErrorHandler.java    License: 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");
	
	// labelError
	labelError = new Label();
	labelError.setImmediate(false);
	labelError.setWidth("100.0%");
	labelError.setHeight("80px");
	labelError.setValue("This holds error messages.");
	mainLayout.addComponent(labelError);
	
	// buttonGo
	buttonGo = new Button();
	buttonGo.setCaption("Ok");
	buttonGo.setImmediate(true);
	buttonGo.setWidth("-1px");
	buttonGo.setHeight("-1px");
	mainLayout.addComponent(buttonGo);
	mainLayout.setComponentAlignment(buttonGo, new Alignment(48));
	
	return mainLayout;
}