List of usage examples for com.vaadin.ui VerticalLayout setComponentAlignment
@Override public void setComponentAlignment(Component childComponent, Alignment alignment)
From source file:org.ow2.sirocco.cloudmanager.NetworkCreationWizard.java
License:Open Source License
public NetworkCreationWizard() { super("Network Creation"); this.center(); this.setClosable(false); this.setModal(true); this.setResizable(false); VerticalLayout content = new VerticalLayout(); content.setMargin(true);/*from w w w . jav a2 s. c om*/ this.wizard = new Wizard(); this.wizard.addListener(this); this.wizard.addStep(this.placementStep = new Util.PlacementStep(this.wizard), "placement"); this.wizard.addStep(this.metadataStep = new Util.MetadataStep(this.wizard), "metadata"); this.wizard.addStep(this.subnetStep = new SubnetStep(), "subnet"); this.wizard.setHeight("300px"); this.wizard.setWidth("560px"); content.addComponent(this.wizard); content.setComponentAlignment(this.wizard, Alignment.TOP_CENTER); this.setContent(content); }
From source file:org.ow2.sirocco.cloudmanager.ProviderAccountCreationWizard.java
License:Open Source License
public ProviderAccountCreationWizard() { super("New Cloud Provider Account"); this.center(); this.setClosable(false); this.setModal(true); this.setResizable(false); VerticalLayout content = new VerticalLayout(); content.setMargin(true);/* w ww .jav a 2 s .co m*/ this.wizard = new Wizard(); this.wizard.addListener(this); this.wizard.addStep(this.providerTypeStep = new ProviderTypeStep(), "type"); this.wizard.addStep(this.accountParametersStep = new AccountParametersStep(), "params"); this.wizard.addStep(this.importOptionsStep = new ImportOptionsStep(), "import"); this.wizard.setHeight("400px"); this.wizard.setWidth("560px"); content.addComponent(this.wizard); content.setComponentAlignment(this.wizard, Alignment.TOP_CENTER); this.setContent(content); }
From source file:org.ow2.sirocco.cloudmanager.SecurityGroupCreationWizard.java
License:Open Source License
public SecurityGroupCreationWizard() { super("SecurityGroup Creation"); this.center(); this.setClosable(false); this.setModal(true); this.setResizable(false); VerticalLayout content = new VerticalLayout(); content.setMargin(true);//from w w w . j av a 2s .c om this.wizard = new Wizard(); this.wizard.addListener(this); this.wizard.addStep(this.placementStep = new Util.PlacementStep(this.wizard), "placement"); this.wizard.addStep(this.metadataStep = new Util.MetadataStep(this.wizard), "metadata"); this.wizard.setHeight("300px"); this.wizard.setWidth("560px"); content.addComponent(this.wizard); content.setComponentAlignment(this.wizard, Alignment.TOP_CENTER); this.setContent(content); }
From source file:org.ow2.sirocco.cloudmanager.VolumeCreationWizard.java
License:Open Source License
public VolumeCreationWizard() { super("Volume Creation"); this.center(); this.setClosable(false); this.setModal(true); this.setResizable(false); VerticalLayout content = new VerticalLayout(); content.setMargin(true);//from w ww . j a va 2 s . com this.wizard = new Wizard(); this.wizard.addListener(this); this.wizard.addStep(this.placementStep = new Util.PlacementStep(this.wizard), "placement"); this.wizard.addStep(this.metadataStep = new Util.MetadataStep(this.wizard), "metadata"); this.wizard.addStep(this.configStep = new ConfigStep(), "config"); this.wizard.setHeight("300px"); this.wizard.setWidth("560px"); content.addComponent(this.wizard); content.setComponentAlignment(this.wizard, Alignment.TOP_CENTER); this.setContent(content); }
From source file:org.ozkar.vaadinBootstrapp.login.LoginPage.java
public LoginPage() { final VerticalLayout root = new VerticalLayout(); final FormLayout loginForm = new FormLayout(); txtUsername.setRequired(true);/*from ww w. j a v a 2 s .c o m*/ txtPassword.setRequired(true); btnOk.setClickShortcut(KeyCode.ENTER); root.addComponent(loginForm); root.setComponentAlignment(loginForm, Alignment.MIDDLE_CENTER); root.setSizeFull(); loginForm.addComponent(txtUsername); loginForm.addComponent(txtPassword); loginForm.addComponent(btnOk); loginForm.setSpacing(true); loginForm.setMargin(new MarginInfo(true, true, true, false)); loginForm.setCaption(":::LOGIN:::"); loginForm.setSizeUndefined(); this.setSizeFull(); this.setCompositionRoot(root); /* Event Handling */ btnOk.addClickListener((Button.ClickEvent event) -> { User user = User.getUser(txtUsername.getValue()); if (AuthUtils.validUser(user, txtPassword.getValue())) { Notification.show("Bienvenido..."); AuthUtils.logIn(getUI(), user); getUI().getNavigator().navigateTo(HomePage.URL); } else { Notification.show("Usuario o Contrasea Incorrecto."); } }); }
From source file:org.processbase.ui.core.template.HumanTaskWindow.java
License:Open Source License
private void preparePanel() { VerticalLayout vl = new VerticalLayout(); vl.setWidth("100%"); vl.setMargin(true, true, true, true); vl.setSpacing(false);/*from ww w . j a va2 s. c o m*/ vl.addComponent(taskPanel); taskPanel.setSizeUndefined(); vl.setComponentAlignment(taskPanel, Alignment.MIDDLE_CENTER); String tabCaption = taskInstance != null ? messages.getString("taskDetails") : (processDefinition.getLabel() != null ? processDefinition.getLabel() : processDefinition.getName()); if (taskInstance != null) { tabSheet.setSizeFull(); tabSheet.setStyleName("minimal"); layout.addComponent(tabSheet); layout.setExpandRatio(tabSheet, 1.0f); tabSheet.addTab(vl, tabCaption, new ThemeResource("icons/document-txt.png")); } else { // vl.setSizeUndefined(); mainLayout.setSizeUndefined(); mainLayout.setWidth("100%"); mainLayout.addComponent(vl); mainLayout.setExpandRatio(vl, 1.0f); } enabletabPanel(); }
From source file:org.ripla.web.internal.views.RiplaLogin.java
License:Open Source License
private void createForm(final VerticalLayout inLayout, final IAppConfiguration inConfiguration) { final IMessages lMessages = Activator.getMessages(); final FormLayout lLayout = new FormLayout(); lLayout.setStyleName("ripla-login-form"); //$NON-NLS-1$ lLayout.setWidth(400, Unit.PIXELS);/* w ww. j a v a 2 s .c o m*/ inLayout.addComponent(lLayout); inLayout.setComponentAlignment(lLayout, Alignment.TOP_CENTER); lLayout.addComponent(LabelHelper.createLabel(inConfiguration.getWelcome(), "ripla-welcome")); userid = new TextField(String.format("%s:", lMessages.getMessage("login.field.user"))); //$NON-NLS-1$ //$NON-NLS-2$ lLayout.addComponent(userid); userid.focus(); password = new PasswordField(String.format("%s:", lMessages.getMessage("login.field.pass"))); //$NON-NLS-1$ //$NON-NLS-2$ lLayout.addComponent(password); loginButton = new Button(lMessages.getMessage("login.button")); //$NON-NLS-1$ lLayout.addComponent(loginButton); loginItem = createLoginItem(); final FieldGroup lBinding = new FieldGroup(loginItem); lBinding.bindMemberFields(this); lBinding.setBuffered(false); }
From source file:org.robot.gtf.gui.GTFApplication.java
License:Apache License
private void buildAboutWindow() { // Create the window... aboutWindow = new Window("About"); aboutWindow.setModal(true);/* w w w . java2s . com*/ aboutWindow.setResizable(false); aboutWindow.setWidth(350, Window.UNITS_PIXELS); aboutWindow.setHeight(180, Window.UNITS_PIXELS); // Configure the window layout; by default a VerticalLayout VerticalLayout layout = (VerticalLayout) aboutWindow.getContent(); layout.setMargin(true); layout.setSpacing(true); // Add some content; a label and a close-button Label message = new Label(TextResources.getAboutText()); message.setContentMode(Label.CONTENT_XHTML); aboutWindow.addComponent(message); Button close = new Button("Close", new Button.ClickListener() { public void buttonClick(ClickEvent event) { (aboutWindow.getParent()).removeWindow(aboutWindow); } }); // The components added to the window are actually added to the window's // layout; you can use either. Alignments are set using the layout layout.addComponent(close); layout.setComponentAlignment(close, Alignment.TOP_RIGHT); }
From source file:org.semanticsoft.vaaclipsedemo.cassandra.app.editors.ImageView.java
License:Open Source License
@Inject public ImageView(VerticalLayout container, MInputPart inputPart) { super(inputPart.getInputURI()); embedded = new Embedded(); container.addComponent(embedded);// w ww . j a v a2 s . c o m container.setComponentAlignment(embedded, Alignment.MIDDLE_CENTER); embedded.setSource(new FileResource(getFile())); }
From source file:org.sensorhub.ui.ModuleInstanceSelectionPopup.java
License:Mozilla Public License
@SuppressWarnings("rawtypes") public ModuleInstanceSelectionPopup(final Class<? extends IModule> moduleType, final ModuleInstanceSelectionCallback callback) { super("Select Module"); VerticalLayout layout = new VerticalLayout(); // generate table with module list final Table table = new Table(); table.setSizeFull();/*from ww w .j av a 2 s . c om*/ table.setSelectable(true); table.setColumnReorderingAllowed(true); table.addContainerProperty(UIConstants.PROP_NAME, String.class, null); table.addContainerProperty(UIConstants.PROP_ID, String.class, null); table.setColumnHeaders(new String[] { "Module Name", "ID" }); table.setPageLength(10); table.setMultiSelect(false); final Map<Object, IModule<?>> moduleMap = new HashMap<Object, IModule<?>>(); for (IModule<?> module : SensorHub.getInstance().getModuleRegistry().getLoadedModules()) { Class<?> moduleClass = module.getClass(); if (moduleType.isAssignableFrom(moduleClass)) { Object id = table.addItem(new Object[] { module.getName(), module.getLocalID() }, null); moduleMap.put(id, module); } } layout.addComponent(table); // add OK button Button okButton = new Button("OK"); okButton.addClickListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { Object selectedItemId = table.getValue(); if (selectedItemId != null) { IModule<?> module = moduleMap.get(selectedItemId); if (module != null) callback.moduleSelected(module); } close(); } }); layout.addComponent(okButton); layout.setComponentAlignment(okButton, Alignment.MIDDLE_CENTER); setContent(layout); center(); }