List of usage examples for com.vaadin.ui FormLayout FormLayout
public FormLayout()
From source file:nl.kpmg.lcm.ui.view.metadata.MetadataCreateWindow.java
License:Apache License
private void init() { tabsheet = new TabSheet(); sectionPanel = initSectionPanel();/* w w w .ja va2 s . com*/ tabsheet.addTab(sectionPanel, "Section view"); rawPanel = initRawPanel(); tabsheet.addTab(rawPanel, "Raw view"); tabsheet.addSelectedTabChangeListener((event) -> { if (event.getTabSheet().getSelectedTab() == rawPanel) { try { updateRawView(); } catch (Property.ReadOnlyException | IOException ex) { Notification.show("Unable to merge metadata sections. Raw metadata is not updated!"); } } else if (event.getTabSheet().getSelectedTab() == sectionPanel) { updateSectionView(); } }); this.setWidth(PANEL_WIDTH); this.setModal(true); FormLayout mainPanel = new FormLayout(); mainPanel.addComponent(tabsheet); saveButton = new Button("Save"); saveButton.addClickListener(this); mainPanel.addComponent(saveButton); this.setContent(mainPanel); }
From source file:nl.kpmg.lcm.ui.view.transfer.components.StartTransferWindow.java
License:Apache License
private void init(String remoteLcmUrl, String remoteMetadataId, String remoteMetadataName) { FormLayout commonContentPanel = initCommonContentPanel(remoteMetadataId, remoteMetadataName); tabsheet.addTab(commonContentPanel, "Common"); FormLayout settingsContent = initSettingsPanel(); tabsheet.addTab(settingsContent, "Settings"); startButton.addClickListener(this); FormLayout mainPanel = new FormLayout(); mainPanel.addComponent(tabsheet);//w ww. j av a 2 s. co m createExpirationTimeWarning(); if (expirationTimeWarning != null) { mainPanel.addComponent(expirationTimeWarning); } mainPanel.addComponent(startButton); this.setWidth(DIALOG_WIDTH); this.setModal(true); this.setContent(mainPanel); }
From source file:nl.kpmg.lcm.ui.view.transfer.components.StartTransferWindow.java
License:Apache License
private FormLayout initSettingsPanel() throws UnsupportedOperationException { FormLayout settingsContent = new FormLayout(); overwriteComboBox = new ComboBox("Overwrite existing data"); overwriteComboBox.addItem("true"); overwriteComboBox.setItemCaption("true", "true"); overwriteComboBox.addItem("false"); overwriteComboBox.setItemCaption("false", "false"); writeChunkSizeField = new TextField("Write chunck size"); varcharSizeField = new TextField("Varchar size"); decimalPrecisionField = new TextField("Decinal precision"); initSettings();// w w w. ja v a2 s .co m settingsContent.addComponent(overwriteComboBox); settingsContent.addComponent(writeChunkSizeField); settingsContent.addComponent(varcharSizeField); settingsContent.addComponent(decimalPrecisionField); settingsContent.setHeight(TAB_HEIGHT); settingsContent.setMargin(true); return settingsContent; }
From source file:nl.kpmg.lcm.ui.view.transfer.components.StartTransferWindow.java
License:Apache License
private FormLayout initCommonContentPanel(String metadataId, String metadataName) throws UnsupportedOperationException { remoteLcmLabel = new Label(); remoteLcmLabel.setCaption("Remote LCM"); remoteLcmLabel.setValue(remoteLcmUrl); metadataIdLabel = new Label(); metadataIdLabel.setCaption("Metadata Id"); metadataIdLabel.setValue(metadataId); metadataNameLabel = new Label(); metadataNameLabel.setCaption("Metadata Name"); metadataNameLabel.setValue(metadataName); FormLayout commonContentPanel = new FormLayout(); commonContentPanel.setMargin(true);// ww w .j a va 2s . co m storageListComboBox = initStorageListComboBox(); metadataNameSpaceField = new TextField("Namespace path"); commonContentPanel.addComponent(remoteLcmLabel); commonContentPanel.addComponent(metadataIdLabel); commonContentPanel.addComponent(metadataNameLabel); commonContentPanel.addComponent(storageListComboBox); commonContentPanel.addComponent(metadataNameSpaceField); commonContentPanel.addComponent(startButton); commonContentPanel.setMargin(true); commonContentPanel.setHeight(TAB_HEIGHT); return commonContentPanel; }
From source file:nz.co.senanque.vaadinsupport.TouchkitMaduraForm.java
License:Apache License
public TouchkitMaduraForm(MaduraSessionManager maduraSessionManager) { this(new FormLayout(), maduraSessionManager); }
From source file:org.apache.ace.useradmin.ui.vaadin.EditUserInfoWindow.java
License:Apache License
/** * Creates a new {@link EditUserInfoWindow} instance. *//*from ww w. j av a2 s. c o m*/ public EditUserInfoWindow() { setCaption("My info"); setWidth("20%"); m_usernameTextField = new TextField(); m_usernameTextField.setEnabled(false); m_usernameTextField.setCaption("Username"); m_passwordTextField = new PasswordField(); m_passwordTextField.setCaption("Password"); m_passwordTextField.setImmediate(true); m_passwordTextField.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { boolean changed = passwordChanged(); m_applyButton.setEnabled(changed); } }); m_groupField = new TextField(); m_groupField.setEnabled(false); m_groupField.setCaption("Role"); m_applyButton = new Button(); m_applyButton.setCaption("Apply changes"); m_applyButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { storeUserInfo(); } }); FormLayout formLayout = new FormLayout(); formLayout.setMargin(false, false, false, true); formLayout.addComponent(m_usernameTextField); formLayout.addComponent(m_passwordTextField); formLayout.addComponent(m_groupField); formLayout.addComponent(m_applyButton); addComponent(formLayout); }
From source file:org.apache.ace.useradmin.ui.vaadin.UserAdminWindow.java
License:Apache License
/** * Creates a new {@link UserAdminWindow} instance. *///from w w w . j ava2s . com public UserAdminWindow() { setCaption("Manage users"); setWidth("30%"); m_userTable = new Table(); m_userTable.setSizeFull(); m_userTable.setImmediate(true); m_userTable.setSelectable(true); m_userTable.setSortDisabled(false); m_userTable.addContainerProperty("User", UserDTO.class, null); m_userTable.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { selectUser((UserDTO) m_userTable.getValue()); } }); VerticalLayout usersList = new VerticalLayout(); usersList.setSizeFull(); usersList.addComponent(m_userTable); Button addUserButton = new Button("+"); addUserButton.setStyleName(Reindeer.BUTTON_SMALL); addUserButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { prepareForNewUser(); } }); m_removeUserButton = new Button(); m_removeUserButton.setStyleName(Reindeer.BUTTON_SMALL); m_removeUserButton.setCaption("-"); m_removeUserButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { removeSelectedUser((UserDTO) m_userTable.getValue()); } }); HorizontalLayout addRemoveUserButtons = new HorizontalLayout(); addRemoveUserButtons.setMargin(true, false, false, false); addRemoveUserButtons.setSpacing(true); addRemoveUserButtons.addComponent(addUserButton); addRemoveUserButtons.addComponent(m_removeUserButton); usersList.addComponent(addRemoveUserButtons); usersList.setExpandRatio(m_userTable, 1.0f); usersList.setExpandRatio(addRemoveUserButtons, 0.0f); ValueChangeListener changeListener = new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { m_applyButton.setEnabled(isCurrentFormValid()); m_cancelButton.setEnabled(true); } }; m_usernameTextField = new TextField(); m_usernameTextField.setCaption("Username"); m_usernameTextField.setImmediate(true); m_usernameTextField.setRequired(true); m_usernameTextField.addListener(changeListener); m_passwordTextField = new PasswordField(); m_passwordTextField.setCaption("Password"); m_passwordTextField.setImmediate(true); m_passwordTextField.setRequired(true); m_passwordTextField.addListener(changeListener); m_groupSelect = new Select(); m_groupSelect.setCaption("Role"); m_groupSelect.setImmediate(true); m_groupSelect.setNullSelectionAllowed(false); m_groupSelect.setRequired(true); m_groupSelect.addListener(changeListener); FormLayout formLayout = new FormLayout(); formLayout.addComponent(m_usernameTextField); formLayout.addComponent(m_passwordTextField); formLayout.addComponent(m_groupSelect); m_applyButton = new Button(); m_applyButton.setCaption("Apply changes"); m_applyButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { storeUserInfo(); } }); m_cancelButton = new Button(); m_cancelButton.setEnabled(false); m_cancelButton.setCaption("Cancel"); m_cancelButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { selectUser((UserDTO) m_userTable.getValue()); } }); HorizontalLayout addUserButtons = new HorizontalLayout(); addUserButtons.setMargin(true, false, false, false); addUserButtons.setSpacing(true); addUserButtons.addComponent(m_applyButton); addUserButtons.addComponent(m_cancelButton); formLayout.addComponent(addUserButtons); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); horizontalLayout.setSpacing(true); horizontalLayout.addComponent(usersList); horizontalLayout.addComponent(formLayout); horizontalLayout.setExpandRatio(usersList, 0.35f); horizontalLayout.setExpandRatio(formLayout, 0.65f); addComponent(horizontalLayout); updateState(null, false /* editAllowed */); }
From source file:org.apache.openaz.xacml.admin.view.windows.PolicyNameEditorWindow.java
License:Apache License
@AutoGenerated private FormLayout buildMainLayout() { // common part: create layout mainLayout = new FormLayout(); mainLayout.setImmediate(false);/*from w ww . ja v a 2 s .c om*/ // textFieldPolicyName textFieldPolicyName = new TextField(); textFieldPolicyName.setCaption("Policy File Name"); textFieldPolicyName.setImmediate(true); textFieldPolicyName.setWidth("-1px"); textFieldPolicyName.setHeight("-1px"); textFieldPolicyName.setInputPrompt("Enter filename eg. foobar.xml"); textFieldPolicyName.setRequired(true); mainLayout.addComponent(textFieldPolicyName); // textAreaDescription textAreaDescription = new TextArea(); textAreaDescription.setCaption("Description"); textAreaDescription.setImmediate(false); textAreaDescription.setWidth("100%"); textAreaDescription.setHeight("-1px"); textAreaDescription.setInputPrompt("Enter a description for the Policy/PolicySet."); textAreaDescription.setNullSettingAllowed(true); mainLayout.addComponent(textAreaDescription); // optionPolicySet optionPolicySet = new OptionGroup(); optionPolicySet.setCaption("Policy or PolicySet?"); optionPolicySet.setImmediate(true); optionPolicySet.setDescription("Is the root level a Policy or Policy Set."); optionPolicySet.setWidth("-1px"); optionPolicySet.setHeight("-1px"); optionPolicySet.setRequired(true); mainLayout.addComponent(optionPolicySet); // comboAlgorithms comboAlgorithms = new ComboBox(); comboAlgorithms.setCaption("Combining Algorithm"); comboAlgorithms.setImmediate(false); comboAlgorithms.setDescription("Select the combining algorithm."); comboAlgorithms.setWidth("-1px"); comboAlgorithms.setHeight("-1px"); comboAlgorithms.setRequired(true); mainLayout.addComponent(comboAlgorithms); // 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; }
From source file:org.apache.openaz.xacml.admin.view.windows.SubDomainEditorWindow.java
License:Apache License
@AutoGenerated private FormLayout buildMainLayout() { // common part: create layout mainLayout = new FormLayout(); mainLayout.setImmediate(false);// w w w .j av a 2s . co m mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); // top-level component properties setWidth("-1px"); setHeight("-1px"); // textFieldSubdomain textFieldSubdomain = new TextField(); textFieldSubdomain.setCaption("Enter Sub Domain"); textFieldSubdomain.setImmediate(false); textFieldSubdomain .setDescription("You can enter sub domain name - do not use spaces or wildcard characters."); textFieldSubdomain.setWidth("-1px"); textFieldSubdomain.setHeight("-1px"); textFieldSubdomain.setInvalidAllowed(false); textFieldSubdomain.setInputPrompt("Examples: sales hr business marketing."); mainLayout.addComponent(textFieldSubdomain); mainLayout.setExpandRatio(textFieldSubdomain, 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; }
From source file:org.apache.tamaya.ui.views.login.LoginBox.java
License:Apache License
private void addForm() { FormLayout loginForm = new FormLayout(); MessageProvider mp = ServiceContextManager.getServiceContext().getService(MessageProvider.class); username = new TextField(mp.getMessage("default.label.username")); password = new PasswordField(mp.getMessage("default.label.password")); loginForm.addComponents(username, password); addComponent(loginForm);//from w ww. j a v a2 s . c o m loginForm.setSpacing(true); for (Component component : loginForm) { component.setWidth("100%"); } username.focus(); }