Java Code Examples for com.vaadin.ui.FormLayout#setMargin()
The following examples show how to use
com.vaadin.ui.FormLayout#setMargin() .
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: SubDomainEditorWindow.java From XACML with MIT License | 5 votes |
@AutoGenerated private FormLayout buildMainLayout() { // common part: create layout mainLayout = new FormLayout(); mainLayout.setImmediate(false); 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; }
Example 2
Source File: WinLoadBalancerConfigListener.java From primecloud-controller with GNU General Public License v2.0 | 4 votes |
@Override public void attach() { // メインフォーム Form mainForm = new Form(); Layout mainLayout = mainForm.getLayout(); addComponent(mainForm); // ロードバランサ名 nameField = new TextField(ViewProperties.getCaption("field.loadBalancerName")); nameField.setReadOnly(true); mainLayout.addComponent(nameField); // サービス名 serviceField = new TextField(ViewProperties.getCaption("field.loadBalancerService")); serviceField.setReadOnly(true); mainLayout.addComponent(serviceField); // ロードバランサ設定パネル Panel panel = new Panel(ViewProperties.getCaption("field.loadBalancerConfig")); ((Layout) panel.getContent()).setMargin(false, false, false, true); mainLayout.addComponent(panel); // サブフォーム subForm = new Form(); FormLayout sublayout = (FormLayout) this.subForm.getLayout(); sublayout.setMargin(false); sublayout.setSpacing(false); panel.getContent().addComponent(subForm); subForm.setHeight("200px"); // ロードバランサポート loadBalancerPortField = new TextField(ViewProperties.getCaption("field.loadBalancerPort")); loadBalancerPortField.setWidth(TEXT_WIDTH); sublayout.addComponent(loadBalancerPortField); // サービスポート servicePortField = new TextField(ViewProperties.getCaption("field.loadBalancerServicePort")); servicePortField.setWidth(TEXT_WIDTH); sublayout.addComponent(servicePortField); // プロトコル protocolSelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerProtocol")); protocolSelect.setWidth(TEXT_WIDTH); protocolSelect.setImmediate(true); sublayout.addComponent(protocolSelect); protocolSelect.addListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { protocolValueChange(event); } }); // SSLキー sslKeySelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerSSLKey")); sslKeySelect.setWidth(TEXT_WIDTH); sslKeySelect.addContainerProperty(SSLKEY_CAPTION_ID, String.class, null); sslKeySelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); sslKeySelect.setItemCaptionPropertyId(SSLKEY_CAPTION_ID); sublayout.addComponent(sslKeySelect); initValidation(); }