List of usage examples for com.vaadin.ui CssLayout setWidth
@Override public void setWidth(String width)
From source file:org.escidoc.browser.ui.maincontent.SearchResultsView.java
License:Open Source License
private CssLayout configureLayout() { setWidth("100.0%"); setHeight("92%"); setMargin(true);/* w ww . j a va2 s. c o m*/ final CssLayout cssLayout = new CssLayout(); cssLayout.setWidth("100%"); cssLayout.setHeight("100%"); addAdvancedSearchBtn(cssLayout); return cssLayout; }
From source file:org.escidoc.browser.ui.view.helpers.DirectMember.java
License:Open Source License
@SuppressWarnings("serial") private CssLayout headerButton() throws EscidocClientException { CssLayout cssLayout = new CssLayout(); cssLayout.addStyleName("v-accordion-item-caption v-caption v-captiontext"); cssLayout.setWidth("100%"); cssLayout.setMargin(false);//from w ww . j a va 2s . co m final Label nameofPanel = new Label(ViewConstants.DIRECT_MEMBERS, Label.CONTENT_RAW); nameofPanel.setStyleName("accordion v-captiontext"); nameofPanel.setWidth("70%"); cssLayout.addComponent(nameofPanel); ThemeResource plusIcon = new ThemeResource("images/assets/plus.png"); if (resourceType == ResourceType.CONTAINER.toString()) { resourceProxy = new ContainerProxyImpl( router.getRepositories().container().findContainerById(parentId)); contextId = resourceProxy.getContext().getObjid(); } else { // It has to be a context resourceProxy = router.getRepositories().context().findById(parentId); } final Button addResourceButton = new Button(); addResourceButton.setStyleName(BaseTheme.BUTTON_LINK); addResourceButton.addStyleName("floatright paddingtop3"); addResourceButton.setWidth("20px"); addResourceButton.setIcon(plusIcon); addResourceButton.addListener(new ClickListener() { @Override public void buttonClick(@SuppressWarnings("unused") final ClickEvent event) { try { new ResourceAddViewImpl(resourceProxy, contextId, router).openSubWindow(); } catch (final EscidocClientException e) { mainWindow.showNotification(e.getMessage(), Window.Notification.TYPE_ERROR_MESSAGE); } } }); cssLayout.addComponent(nameofPanel); cssLayout.addComponent(addResourceButton); return cssLayout; }
From source file:org.hip.vif.web.util.UploadComponent.java
License:Open Source License
private Component createDropBox(final IBibliographyTask inTask) { final CssLayout lDropPane = new CssLayout(); lDropPane.setWidth("200px"); //$NON-NLS-1$ lDropPane.setHeight("40px"); //$NON-NLS-1$ lDropPane.addStyleName("v-textfield"); //$NON-NLS-1$ final Label lHint = new Label(Activator.getMessages().getMessage("ui.upload.drop.box")); //$NON-NLS-1$ lHint.setStyleName("vif-drop-hint"); //$NON-NLS-1$ lDropPane.addComponent(lHint);/*from w ww. ja v a 2s . c o m*/ final DragAndDropWrapper outDrop = new DragAndDropWrapper(lDropPane); outDrop.setDropHandler(new DropHandler() { @Override public AcceptCriterion getAcceptCriterion() { // NOPMD return AcceptAll.get(); } @Override public void drop(final DragAndDropEvent inEvent) { // NOPMD final Transferable lTransferable = inEvent.getTransferable(); if (lTransferable instanceof WrapperTransferable) { final Html5File[] lFiles = ((WrapperTransferable) lTransferable).getFiles(); for (final Html5File lFile : lFiles) { lFile.setStreamVariable(createStreamVariable(lFile.getFileName(), inTask)); } } } }); outDrop.setSizeUndefined(); outDrop.setImmediate(true); return outDrop; }
From source file:org.icrisat.gdms.ui.GDMSMain.java
VerticalLayout buildWelcomeScreen() { VerticalLayout layoutForWelcomeTab = new VerticalLayout(); layoutForWelcomeTab.setMargin(true); layoutForWelcomeTab.setSpacing(true); layoutForWelcomeTab.setCaption("Welcome"); layoutForWelcomeTab.setStyleName(Reindeer.LAYOUT_WHITE); CssLayout cssLayout = new CssLayout(); cssLayout.setMargin(true);/*from w w w.j a va2 s. c o m*/ cssLayout.setWidth("100%"); layoutForWelcomeTab.addComponent(cssLayout); HeadingOne title = new HeadingOne("Welcome to Genotyping Data Management"); cssLayout.addComponent(title); HorizontalLayout horizLayoutForIntroPara = new HorizontalLayout(); horizLayoutForIntroPara.setSpacing(true); horizLayoutForIntroPara.setWidth("100%"); horizLayoutForIntroPara.setMargin(true, false, true, false); cssLayout.addComponent(horizLayoutForIntroPara); String strIntroPara1 = "<p>The Genotyping Data Management System aims to provide a comprehensive public repository " + "for genotype, linkage map and QTL data from crop species relevant in the semi-arid tropics.</p>"; String strIntroPara2 = "<p>This system is developed in Java and the database is MySQL. The initial release record " + "details of current genotype datasets generated for GCP mandate crops along with details of " + "molecular markers and related metadata. The Retrieve tab is a good starting point to browse " + "or query the database contents. The datasets available for each crop species can be queried. " + "Access to data sets requires a login.</p>"; String strIntroPara3 = "<p>Data may be currently exported to the following formats: 2x2 matrix and flapjack software formats. " + "Data submission is through templates; upload templates are available for genotype, QTL and " + "map data(type of markers - SSR, SNP and DArt). The templates are in the form of excel sheets with built-in " + "validation functions.</p>"; Label lblPara = new Label(strIntroPara1 + strIntroPara2 + strIntroPara3, Label.CONTENT_XHTML); horizLayoutForIntroPara.addComponent(lblPara); horizLayoutForIntroPara.setExpandRatio(lblPara, 1); //Spacer lblPara = new Label(""); lblPara.setWidth("20px"); horizLayoutForIntroPara.addComponent(lblPara); ThemeResource themeResource = new ThemeResource("images/FlowChart.jpg"); Embedded headerImage = new Embedded("", themeResource); headerImage.setWidth("500px"); headerImage.setHeight("400px"); horizLayoutForIntroPara.addComponent(headerImage); return layoutForWelcomeTab; }
From source file:org.icrisat.gdms.ui.GDMSMain.java
VerticalLayout buildAboutScreen() { VerticalLayout layoutForAboutTab = new VerticalLayout(); layoutForAboutTab.setMargin(true);//from w ww. j av a 2 s.co m layoutForAboutTab.setSpacing(true); layoutForAboutTab.setCaption("About"); layoutForAboutTab.setStyleName(Reindeer.LAYOUT_WHITE); CssLayout cssLayout = new CssLayout(); cssLayout.setMargin(true); cssLayout.setWidth("100%"); layoutForAboutTab.addComponent(cssLayout); HeadingOne title = new HeadingOne("About GDMS Version"); cssLayout.addComponent(title); HorizontalLayout horizLayoutForIntroPara = new HorizontalLayout(); horizLayoutForIntroPara.setSpacing(true); //horizLayoutForIntroPara.setWidth("100%"); horizLayoutForIntroPara.setMargin(true, false, true, false); cssLayout.addComponent(horizLayoutForIntroPara); //_main.getApplication().getContext().getBaseDirectory(); WebApplicationContext ctx = (WebApplicationContext) _main.getApplication().getContext(); //System.out.println(ctx.getHttpSession().getServletContext().getRealPath("\\")); final String strTemplateFolderPath = ctx.getHttpSession().getServletContext().getRealPath("\\"); final String strFileName = "License Agreement for software rev.doc"; final String licensePath = strTemplateFolderPath + "\\" + strFileName; final String strApplicationVersion = "<p>Application Version : 2.1.10</p>"; final String strLicense = ""; String strDBVersion = "<p>Database Verison : IBDBv2</p>"; String strContact = "<p>Contact : <a href='mailto:bioinformatics@cgiar.org'>bioinformatics@cgiar.org </a></p>"; Label lblPara = new Label(strApplicationVersion + strDBVersion + strContact, Label.CONTENT_XHTML); horizLayoutForIntroPara.addComponent(lblPara); horizLayoutForIntroPara.setExpandRatio(lblPara, 1); HorizontalLayout horizLayout = new HorizontalLayout(); horizLayout.setSpacing(true); //horizLayout.setWidth("50%"); horizLayout.setMargin(true, false, true, false); cssLayout.addComponent(horizLayout); //cssLayout.setWidth("600px"); btnDownloadMarker = new Button("License Information"); btnDownloadMarker.setImmediate(true); btnDownloadMarker.setStyleName(Reindeer.BUTTON_LINK); btnDownloadMarker.addListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { //strLicense = "License Information"; File strFileLoc = new File(strTemplateFolderPath + "\\" + strFileName); FileResource fileResource = new FileResource(strFileLoc, _main.getApplication()); if (strFileName.endsWith(".doc")) { _main.getWindow().open(fileResource, "", true); } } }); //Spacer lblPara = new Label(""); //lblPara.setWidth("20px"); horizLayout.addComponent(lblPara); horizLayout.addComponent(btnDownloadMarker); horizLayout.setComponentAlignment(btnDownloadMarker, Alignment.MIDDLE_LEFT); return layoutForAboutTab; }
From source file:org.icrisat.gdms.ui.GDMSMain.java
CssLayout getHeader() { CssLayout cssLayoutForHeaderImage = new CssLayout(); cssLayoutForHeaderImage.setWidth("100%"); ThemeResource themeResource = new ThemeResource("images/GDMS.gif"); //ThemeResource themeResource = new ThemeResource("images/Banner3.jpg"); Embedded headerImage = new Embedded("", themeResource); headerImage.setSizeFull();//from ww w .j a va 2 s . c o m cssLayoutForHeaderImage.setSizeFull(); cssLayoutForHeaderImage.addComponent(headerImage); cssLayoutForHeaderImage.setMargin(false, false, false, false); return cssLayoutForHeaderImage; }
From source file:org.icrisat.gdms.ui.GDMSMain.java
CssLayout getBottomPanelLayout() { CssLayout cssLayoutForContactImage = new CssLayout(); cssLayoutForContactImage.setWidth("100%"); ThemeResource themeResource = new ThemeResource("images/GDMS_Footer.gif"); Embedded contactImage = new Embedded("", themeResource); contactImage.setWidth("1000px"); contactImage.setHeight("20px"); cssLayoutForContactImage.addComponent(contactImage); return cssLayoutForContactImage; }
From source file:org.ikasan.dashboard.ui.framework.panel.LandingViewPanel.java
License:BSD License
private Component createContentWrapper(final Component content) { final CssLayout slot = new CssLayout(); slot.setWidth("100%"); slot.addStyleName("dashboard-panel-slot"); CssLayout card = new CssLayout(); card.setWidth("100%"); card.addStyleName(ValoTheme.LAYOUT_CARD); HorizontalLayout toolbar = new HorizontalLayout(); toolbar.addStyleName("dashboard-panel-toolbar"); toolbar.setWidth("100%"); Label caption = new Label(content.getCaption()); caption.addStyleName(ValoTheme.LABEL_H4); caption.addStyleName(ValoTheme.LABEL_COLORED); caption.addStyleName(ValoTheme.LABEL_NO_MARGIN); content.setCaption(null);//w w w. jav a2 s.co m MenuBar tools = new MenuBar(); tools.addStyleName(ValoTheme.MENUBAR_BORDERLESS); MenuItem max = tools.addItem("", VaadinIcons.EXPAND, new Command() { @Override public void menuSelected(final MenuItem selectedItem) { if (!slot.getStyleName().contains("max")) { selectedItem.setIcon(FontAwesome.COMPRESS); toggleMaximized(slot, true); } else { slot.removeStyleName("max"); selectedItem.setIcon(FontAwesome.EXPAND); toggleMaximized(slot, false); } } }); max.setStyleName("icon-only"); MenuItem root = tools.addItem("", VaadinIcons.COG, null); root.addItem("Configure", new Command() { @Override public void menuSelected(final MenuItem selectedItem) { Notification.show("Not implemented in this demo"); } }); root.addSeparator(); root.addItem("Close", new Command() { @Override public void menuSelected(final MenuItem selectedItem) { Notification.show("Not implemented in this demo"); } }); toolbar.addComponents(caption, tools); toolbar.setExpandRatio(caption, 1); toolbar.setComponentAlignment(caption, Alignment.MIDDLE_LEFT); card.addComponents(toolbar, content); slot.addComponent(card); return slot; }
From source file:org.ikasan.dashboard.ui.monitor.component.MonitorPanel.java
License:BSD License
protected Component createContentWrapper(final Component small, final Component large) { final CssLayout slot = new CssLayout(); slot.setWidth("100%"); slot.addStyleName("monitor-panel-slot"); final CssLayout card1 = new CssLayout(); card1.setWidth("100%"); card1.addStyleName(ValoTheme.LAYOUT_CARD); final CssLayout card2 = new CssLayout(); card2.setWidth("100%"); card2.addStyleName(ValoTheme.LAYOUT_CARD); final HorizontalLayout toolbar = new HorizontalLayout(); toolbar.addStyleName("dashboard-panel-toolbar"); toolbar.setWidth("100%"); Label caption = new Label(large.getCaption()); caption.addStyleName(ValoTheme.LABEL_H4); caption.addStyleName(ValoTheme.LABEL_COLORED); caption.addStyleName(ValoTheme.LABEL_NO_MARGIN); large.setCaption(null);// www.j ava 2s . c o m MenuBar tools = new MenuBar(); tools.addStyleName(ValoTheme.MENUBAR_BORDERLESS); MenuItem max = tools.addItem("", VaadinIcons.EXPAND, new Command() { @Override public void menuSelected(final MenuItem selectedItem) { if (!slot.getStyleName().contains("max")) { selectedItem.setIcon(FontAwesome.COMPRESS); slot.removeAllComponents(); card2.removeAllComponents(); card2.addComponents(toolbar, large); slot.addComponents(card2); toggleMaximized(slot, true); } else { slot.removeStyleName("max"); selectedItem.setIcon(FontAwesome.EXPAND); toggleMaximized(slot, false); card1.removeAllComponents(); card1.addComponents(toolbar, small); slot.removeAllComponents(); slot.addComponents(card1); } } }); max.setStyleName("icon-only"); MenuItem root = tools.addItem("", VaadinIcons.COG, null); root.addItem("Configure", new Command() { @Override public void menuSelected(final MenuItem selectedItem) { Notification.show("Not implemented in this demo"); } }); root.addSeparator(); root.addItem("Close", new Command() { @Override public void menuSelected(final MenuItem selectedItem) { Notification.show("Not implemented in this demo"); } }); toolbar.addComponents(caption, tools); toolbar.setExpandRatio(caption, 1); toolbar.setComponentAlignment(caption, Alignment.MIDDLE_LEFT); card1.addComponents(toolbar, small); // card2.addComponents(toolbar, large); slot.addComponent(card1); return slot; }
From source file:org.jug.montpellier.sonni.about.AboutPerspectiveContribution.java
License:Apache License
private Component getAboutDialog() { CssLayout titleLayout = new CssLayout(); titleLayout.addStyleName("transparent-frame"); titleLayout.setWidth("90%"); Label title = new Label("Sonni - Dynamic Vaadin OSGi Demo"); title.setWidth("100%"); title.addStyleName("about-title"); titleLayout.addComponent(title);//from w w w .ja v a 2 s.c om Label description = new Label( "<br/>Copyright (c) Developer <a href='mailto:eric.taix@gmail.com'>Eric Taix</a> - <a href='http://www.montpellier-jug.org'>Montpellier JUG</a><br>" + "<br/><br/>This application aims to demonstrate how to develop a dynamic application with <a href='http://www.vaadin.com'>Vaadin</a> and OSGi<br/>" + "All buttons in the left panel are loaded dynamically from components stored in differents bundles. Play with the parameter view to activate or desactivate components." // + "This application can be forked from <a href='https://github.com/eric-taix/sonni'>gitHub</a>." + "<br/><br/><br/>The Montpellier Java User Group's goals are:" + "<li>Create an independent community 'In Real Life' (the JUG is not intended to be another virtual community built around an electronic forum)</li>" + "<li>Promote exchanges between industry, academia and students</li>" + "<li>Share knowledge and experiences around Java</li>" + "<li>Promote Java and associated technologies</li>" + "All in a professional and user-friendly form.<br/><br><br/>" + "Licensed under Apache Software Foundation 2.0 license (ASF)<br>" + "This software contains modules licenced under the Apache Software Foundation 2.0 license (ASF) and EPL<br>" + "Many thanks to Siemens AG, Kai Tdter, Chris Brind, Neil Bartlett, " + " Petter Holmstrm and others for their OSGi and Vaadin" + " related work, blogs, and bundles." + "<br/><br/><br/>Why <b>Sonni</b>?<br/>'Sonni' is the finish translation for bulls. Finland has a lot of reinders and in our county we have a lot of bulls !<br/><br/>"); description.addStyleName("about"); description.setWidth("100%"); description.setContentMode(Label.CONTENT_XHTML); titleLayout.addComponent(description); return titleLayout; }