List of usage examples for com.vaadin.ui FormLayout setHeight
@Override public void setHeight(String height)
From source file:com.squadd.chat.ChatController.java
public FormLayout createPhotoLayout(Embedded image) { FormLayout photoLayout = new FormLayout(); photoLayout.addComponent(image);//from ww w. j av a 2 s . c om photoLayout.setWidth("50px"); photoLayout.setHeight("50px"); UserInfoBean use = man.get(userTo.getId(), UserInfo.class, UserInfoBean.class); MouseEvents.ClickListener showUserButtonListener = new MouseEvents.ClickListener() { @Override public void click(MouseEvents.ClickEvent event) { if (use != null) { System.out.println(use.getId()); view.setAnotherUser(use); UI.getCurrent().getNavigator().navigateTo(UserPageView.NAME); } } }; //if(use!=null){ //photoLayout.addClickListener(showUserButtonListener);} return photoLayout; }
From source file:de.escidoc.admintool.view.resource.FormLayoutFactory.java
License:Open Source License
public static FormLayout create() { final FormLayout formLayout = new FormLayout(); formLayout.setMargin(true);// w w w . j a v a 2s . com formLayout.setWidth("800px"); formLayout.setHeight("100%"); return formLayout; }
From source file:eu.hurion.hello.vaadin.shiro.application.LoginScreen.java
License:Apache License
public LoginScreen(final HerokuShiroApplication app) { setSizeFull();//from w w w . j a v a 2 s .c om final Panel loginPanel = new Panel("Login"); loginPanel.setWidth("300px"); final FormLayout content = new FormLayout(); content.setSizeFull(); user = new TextField("User"); content.addComponent(user); password = new PasswordField("Password"); content.addComponent(password); final Button loginButton = new Button("Log in"); content.setHeight("150px"); loginButton.addClickListener(new ShiroLoginListener(app)); content.addComponent(loginButton); loginPanel.setContent(content); addComponent(loginPanel); setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER); final HorizontalLayout footer = new HorizontalLayout(); footer.setHeight("50px"); addComponent(footer); }
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. j a v a 2 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);//w ww .j av a 2 s .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:org.apache.usergrid.chop.webapp.view.chart.layout.ChartLayout.java
License:Apache License
private FormLayout addFormLayout() { FormLayout formLayout = new FormLayout(); formLayout.setWidth("250px"); formLayout.setHeight("250px"); formLayout.addStyleName("outlined"); formLayout.setSpacing(true);/*from w w w . ja va 2 s .c om*/ addComponent(formLayout, "left: 10px; top: 10px;"); return formLayout; }
From source file:org.apache.usergrid.chop.webapp.view.user.UserLayout.java
License:Apache License
private FormLayout addFormLayout(int x, int y) { FormLayout formLayout = new FormLayout(); formLayout.setWidth(String.format("%spx", x)); formLayout.setHeight(String.format("%spx", y)); formLayout.addStyleName("outlined"); formLayout.setSpacing(true);/*from w w w .j av a 2 s . co m*/ addComponent(formLayout, "left: 350px; top: 50px;"); return formLayout; }
From source file:org.opencms.ui.editors.messagebundle.CmsMessageBundleEditorOptions.java
License:Open Source License
/** * Initializes the language switcher UI Component {@link #m_languageSwitch}, including {@link #m_languageSelect}. * @param locales the locales that can be selected. * @param current the currently selected locale. *///from ww w. j av a 2 s .co m private void initLanguageSwitch(Collection<Locale> locales, Locale current) { FormLayout languages = new FormLayout(); languages.setHeight("100%"); languages.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); ComboBox languageSelect = new ComboBox(); languageSelect.setCaption(m_messages.key(Messages.GUI_LANGUAGE_SWITCHER_LABEL_0)); languageSelect.setNullSelectionAllowed(false); // set Locales for (Locale locale : locales) { languageSelect.addItem(locale); String caption = locale.getDisplayName(UI.getCurrent().getLocale()); if (CmsLocaleManager.getDefaultLocale().equals(locale)) { caption += " (" + Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_DEFAULT_LOCALE_0) + ")"; } languageSelect.setItemCaption(locale, caption); } languageSelect.setValue(current); languageSelect.setNewItemsAllowed(false); languageSelect.setTextInputAllowed(false); languageSelect.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; public void valueChange(ValueChangeEvent event) { m_listener.handleLanguageChange((Locale) event.getProperty().getValue()); } }); if (locales.size() == 1) { languageSelect.setEnabled(false); } languages.addComponent(languageSelect); m_languageSwitch = languages; }
From source file:org.opencms.ui.editors.messagebundle.CmsMessageBundleEditorOptions.java
License:Open Source License
/** * Initializes the mode switcher./*from w ww . ja v a 2s . c o m*/ * @param current the current edit mode */ private void initModeSwitch(final EditMode current) { FormLayout modes = new FormLayout(); modes.setHeight("100%"); modes.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT); m_modeSelect = new ComboBox(); m_modeSelect.setCaption(m_messages.key(Messages.GUI_VIEW_SWITCHER_LABEL_0)); // add Modes m_modeSelect.addItem(CmsMessageBundleEditorTypes.EditMode.DEFAULT); m_modeSelect.setItemCaption(CmsMessageBundleEditorTypes.EditMode.DEFAULT, m_messages.key(Messages.GUI_VIEW_SWITCHER_EDITMODE_DEFAULT_0)); m_modeSelect.addItem(CmsMessageBundleEditorTypes.EditMode.MASTER); m_modeSelect.setItemCaption(CmsMessageBundleEditorTypes.EditMode.MASTER, m_messages.key(Messages.GUI_VIEW_SWITCHER_EDITMODE_MASTER_0)); // set current mode as selected m_modeSelect.setValue(current); m_modeSelect.setNewItemsAllowed(false); m_modeSelect.setTextInputAllowed(false); m_modeSelect.setNullSelectionAllowed(false); m_modeSelect.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 1L; public void valueChange(ValueChangeEvent event) { m_listener.handleModeChange((EditMode) event.getProperty().getValue()); } }); modes.addComponent(m_modeSelect); m_modeSwitch = modes; }
From source file:org.ow2.sirocco.cloudmanager.AddressAssociateDialog.java
License:Open Source License
public AddressAssociateDialog(final List<MachineChoice> choices, final DialogCallback callback) { super("Associate Address"); this.callback = callback; this.center(); this.setClosable(false); this.setModal(true); this.setResizable(false); FormLayout content = new FormLayout(); content.setMargin(true);//from www . j ava2s .c om content.setWidth("400px"); content.setHeight("150px"); this.machineBox = new ComboBox("Machine"); this.machineBox.setRequired(true); this.machineBox.setTextInputAllowed(false); this.machineBox.setNullSelectionAllowed(false); this.machineBox.setInputPrompt("select machine"); this.machineBox.setImmediate(true); content.addComponent(this.machineBox); final HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setSpacing(true); this.okButton = new Button("Ok", this); this.cancelButton = new Button("Cancel", this); this.cancelButton.focus(); buttonLayout.addComponent(this.okButton); buttonLayout.addComponent(this.cancelButton); content.addComponent(buttonLayout); content.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT); this.setContent(content); for (MachineChoice choice : choices) { this.machineBox.addItem(choice.id); this.machineBox.setItemCaption(choice.id, choice.name); } }