List of usage examples for com.vaadin.ui HorizontalLayout setWidth
@Override public void setWidth(String width)
From source file:de.symeda.sormas.ui.caze.CaseContactsView.java
License:Open Source License
public HorizontalLayout createStatusFilterBar() { HorizontalLayout statusFilterLayout = new HorizontalLayout(); statusFilterLayout.setSpacing(true); statusFilterLayout.setWidth("100%"); statusFilterLayout.addStyleName(CssStyles.VSPACE_3); statusButtons = new HashMap<>(); Button statusAll = new Button(I18nProperties.getCaption(Captions.all), e -> { criteria.contactStatus(null);//from w ww .ja va 2 s . c om navigateTo(criteria); }); CssStyles.style(statusAll, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER); statusAll.setCaptionAsHtml(true); statusFilterLayout.addComponent(statusAll); statusButtons.put(statusAll, I18nProperties.getCaption(Captions.all)); activeStatusButton = statusAll; for (ContactStatus status : ContactStatus.values()) { Button statusButton = new Button(status.toString(), e -> { criteria.contactStatus(status); navigateTo(criteria); }); statusButton.setData(status); CssStyles.style(statusButton, ValoTheme.BUTTON_BORDERLESS, CssStyles.BUTTON_FILTER, CssStyles.BUTTON_FILTER_LIGHT); statusButton.setCaptionAsHtml(true); statusFilterLayout.addComponent(statusButton); statusButtons.put(statusButton, status.toString()); } statusFilterLayout .setExpandRatio(statusFilterLayout.getComponent(statusFilterLayout.getComponentCount() - 1), 1); // Bulk operation dropdown if (UserProvider.getCurrent().hasUserRight(UserRight.PERFORM_BULK_OPERATIONS)) { statusFilterLayout.setWidth(100, Unit.PERCENTAGE); MenuBar bulkOperationsDropdown = new MenuBar(); MenuItem bulkOperationsItem = bulkOperationsDropdown .addItem(I18nProperties.getCaption(Captions.bulkActions), null); Command changeCommand = selectedItem -> { ControllerProvider.getContactController().showBulkContactDataEditComponent( grid.asMultiSelect().getSelectedItems(), getCaseRef().getUuid()); }; bulkOperationsItem.addItem(I18nProperties.getCaption(Captions.bulkEdit), VaadinIcons.ELLIPSIS_H, changeCommand); Command cancelFollowUpCommand = selectedItem -> { ControllerProvider.getContactController() .cancelFollowUpOfAllSelectedItems(grid.asMultiSelect().getSelectedItems(), new Runnable() { public void run() { grid.deselectAll(); grid.reload(); } }); }; bulkOperationsItem.addItem(I18nProperties.getCaption(Captions.bulkCancelFollowUp), VaadinIcons.CLOSE, cancelFollowUpCommand); Command lostToFollowUpCommand = selectedItem -> { ControllerProvider.getContactController().setAllSelectedItemsToLostToFollowUp( grid.asMultiSelect().getSelectedItems(), new Runnable() { public void run() { grid.deselectAll(); grid.reload(); } }); }; bulkOperationsItem.addItem(I18nProperties.getCaption(Captions.bulkLostToFollowUp), VaadinIcons.UNLINK, lostToFollowUpCommand); Command deleteCommand = selectedItem -> { ControllerProvider.getContactController() .deleteAllSelectedItems(grid.asMultiSelect().getSelectedItems(), new Runnable() { public void run() { grid.deselectAll(); grid.reload(); } }); }; bulkOperationsItem.addItem(I18nProperties.getCaption(Captions.bulkDelete), VaadinIcons.TRASH, deleteCommand); statusFilterLayout.addComponent(bulkOperationsDropdown); statusFilterLayout.setComponentAlignment(bulkOperationsDropdown, Alignment.TOP_RIGHT); statusFilterLayout.setExpandRatio(bulkOperationsDropdown, 1); } if (UserProvider.getCurrent().hasUserRight(UserRight.CONTACT_EXPORT)) { Button exportButton = new Button(I18nProperties.getCaption(Captions.export)); exportButton.addStyleName(ValoTheme.BUTTON_PRIMARY); exportButton.setIcon(VaadinIcons.DOWNLOAD); StreamResource streamResource = new GridExportStreamResource(grid, "sormas_contacts", "sormas_contacts_" + DateHelper.formatDateForExport(new Date()) + ".csv"); FileDownloader fileDownloader = new FileDownloader(streamResource); fileDownloader.extend(exportButton); statusFilterLayout.addComponent(exportButton); statusFilterLayout.setComponentAlignment(exportButton, Alignment.MIDDLE_RIGHT); if (!UserProvider.getCurrent().hasUserRight(UserRight.PERFORM_BULK_OPERATIONS)) { statusFilterLayout.setExpandRatio(exportButton, 1); } } if (UserProvider.getCurrent().hasUserRight(UserRight.CONTACT_CREATE)) { newButton = new Button( I18nProperties.getPrefixCaption(ContactDto.I18N_PREFIX, Captions.contactNewContact)); newButton.addStyleName(ValoTheme.BUTTON_PRIMARY); newButton.setIcon(VaadinIcons.PLUS_CIRCLE); newButton.addClickListener(e -> ControllerProvider.getContactController().create(this.getCaseRef())); statusFilterLayout.addComponent(newButton); statusFilterLayout.setComponentAlignment(newButton, Alignment.MIDDLE_RIGHT); } statusFilterLayout.addStyleName("top-bar"); activeStatusButton = statusAll; return statusFilterLayout; }
From source file:de.symeda.sormas.ui.events.EventParticipantsView.java
License:Open Source License
public HorizontalLayout createTopBar() { HorizontalLayout topLayout = new HorizontalLayout(); topLayout.setSpacing(true);/*from w w w. ja va 2 s. co m*/ topLayout.setWidth("100%"); Label header = new Label(I18nProperties.getPrefixCaption(EventDto.I18N_PREFIX, EventDto.EVENT_PERSONS)); header.setSizeUndefined(); CssStyles.style(header, CssStyles.H2, CssStyles.VSPACE_NONE); topLayout.addComponent(header); // Bulk operation dropdown if (UserProvider.getCurrent().hasUserRight(UserRight.PERFORM_BULK_OPERATIONS)) { topLayout.setWidth(100, Unit.PERCENTAGE); MenuBar bulkOperationsDropdown = new MenuBar(); MenuItem bulkOperationsItem = bulkOperationsDropdown .addItem(I18nProperties.getCaption(Captions.bulkActions), null); Command deleteCommand = selectedItem -> { ControllerProvider.getEventParticipantController() .deleteAllSelectedItems(grid.asMultiSelect().getSelectedItems(), new Runnable() { public void run() { grid.deselectAll(); grid.reload(); } }); }; bulkOperationsItem.addItem(I18nProperties.getCaption(Captions.bulkDelete), VaadinIcons.TRASH, deleteCommand); topLayout.addComponent(bulkOperationsDropdown); topLayout.setComponentAlignment(bulkOperationsDropdown, Alignment.TOP_RIGHT); topLayout.setExpandRatio(bulkOperationsDropdown, 1); } if (UserProvider.getCurrent().hasUserRight(UserRight.EVENTPARTICIPANT_CREATE)) { addButton = new Button(I18nProperties.getCaption(Captions.eventParticipantAddPerson)); addButton.addStyleName(ValoTheme.BUTTON_PRIMARY); addButton.setIcon(VaadinIcons.PLUS_CIRCLE); addButton.addClickListener(e -> { ControllerProvider.getEventParticipantController().createEventParticipant(this.getEventRef(), r -> grid.reload()); }); topLayout.addComponent(addButton); topLayout.setComponentAlignment(addButton, Alignment.MIDDLE_RIGHT); } topLayout.addStyleName(CssStyles.VSPACE_3); return topLayout; }
From source file:de.uni_leipzig.informatik.pcai042.boa.gui.evaluation.EvaluationView.java
License:Open Source License
/** * Build content 'evaluation process' of tab 3. * //from ww w .j ava 2s .c om * @return content of third tab */ private Layout buildTab3Content() { VerticalLayout tab3Content = new VerticalLayout(); tab3Content.setSpacing(true); tab3Content.setMargin(true); tab3Content.setSizeFull(); Label instructions = new Label( "<b>Instructions:</b> <i>Please select and click a sentence below in order to process the evaluation.</i>", Label.CONTENT_XHTML); tab3Content.addComponent(instructions); this.tableEvaluation = new Table("Evaluation process:"); tableEvaluation.setHeight("150px"); tableEvaluation.setWidth("100%"); tableEvaluation.setImmediate(true); tableEvaluation.setSelectable(true); tableEvaluation.setMultiSelect(false); tableEvaluation.setSortDisabled(false); tableEvaluation.addContainerProperty("ID", Integer.class, null); tableEvaluation.addContainerProperty("Sentence", String.class, null); tableEvaluation.addContainerProperty("Precision", Double.class, null); tableEvaluation.addContainerProperty("Recall", Double.class, null); tableEvaluation.addContainerProperty("F-Score", Double.class, null); tab3Content.addComponent(tableEvaluation); this.buttonNext2 = new Button("Next"); buttonNext2.setImmediate(true); buttonNext2.setDescription("Get the next sentence in table"); tab3Content.addComponent(buttonNext2); this.textAreaEvalSentence = new TextArea("Sentence:"); textAreaEvalSentence.setImmediate(false); textAreaEvalSentence.setReadOnly(true); textAreaEvalSentence.setRows(3); textAreaEvalSentence.setWidth("100%"); tab3Content.addComponent(textAreaEvalSentence); HorizontalLayout hlay1 = new HorizontalLayout(); this.listSelectGoldstandard = new ListSelect("Goldstandard:"); listSelectGoldstandard.setImmediate(true); listSelectGoldstandard.setHeight("120px"); listSelectGoldstandard.setWidth("100%"); listSelectGoldstandard.setNullSelectionAllowed(false); this.listSelectFramework = new ListSelect("Framework:"); listSelectFramework.setImmediate(true); listSelectFramework.setHeight("120px"); listSelectFramework.setWidth("100%"); listSelectFramework.setNullSelectionAllowed(false); hlay1.setSpacing(true); hlay1.setMargin(false); hlay1.setWidth("100%"); hlay1.addComponent(listSelectGoldstandard); hlay1.addComponent(listSelectFramework); tab3Content.addComponent(hlay1); return tab3Content; }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.AddPatientView.java
License:Open Source License
/** * //from w w w . j a va2 s . c o m * @return */ VerticalLayout initButtonLayout() { registerPatients = new Button("Register Patients"); // registerPatients.setWidth("100%"); registerPatients.setStyleName(ValoTheme.BUTTON_FRIENDLY); registerPatients.setVisible(false); registerPatients.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { callPatientRegistration(); } }); buttonLayoutSection = new VerticalLayout(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setMargin(new MarginInfo(true, false, true, false)); buttonLayout.setHeight(null); buttonLayout.setWidth("100%"); buttonLayoutSection.setWidth("100%"); buttonLayoutSection.addComponent(buttonLayout); buttonLayout.addComponent(registerPatients); return buttonLayoutSection; }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.AddPatientView.java
License:Open Source License
/** * initializes the hla typing registration layout * // www . j av a 2 s . com * @return */ void hlaTypingLayout() { hlaLayout.removeAllComponents(); hlaLayout.setWidth("100%"); hlaLayout.setVisible(false); hlaLayout.setMargin(new MarginInfo(true, false, false, false)); hlaLayout.setHeight(null); hlaLayout.setSpacing(true); hlaInfo = new CustomVisibilityComponent(new Label("HLA Typing")); ((Label) hlaInfo.getInnerComponent()).setHeight("24px"); Component hlaContext = Utils.questionize(hlaInfo, "Register available HLA typing for this patient (one allele per line)", "HLA Typing"); hlaLayout.addComponent(hlaContext); HorizontalLayout hlalayout = new HorizontalLayout(); VerticalLayout hlaLayout1 = new VerticalLayout(); hlaLayout1.addComponent(registerHLAI); hlaLayout1.addComponent(hlaItypes); VerticalLayout hlaLayout2 = new VerticalLayout(); hlaLayout2.addComponent(registerHLAII); hlaLayout2.addComponent(hlaIItypes); hlalayout.addComponent(hlaLayout1); hlalayout.addComponent(hlaLayout2); hlalayout.setSpacing(true); typingMethod.addItems(datahandler.getOpenBisClient().getVocabCodesForVocab("Q_HLA_TYPING_METHODS")); hlaLayout.addComponent(typingMethod); hlaLayout.addComponent(hlalayout); }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.DatasetView.java
License:Open Source License
/** * Precondition: {DatasetView#table} has to be initialized. e.g. with * {DatasetView#buildFilterTable} If it is not, strange behaviour has to be expected. builds the * Layout of this view./* w w w. j a v a 2s . c o m*/ */ private void buildLayout() { this.vert.removeAllComponents(); int browserWidth = UI.getCurrent().getPage().getBrowserWindowWidth(); int browserHeight = UI.getCurrent().getPage().getBrowserWindowHeight(); this.vert.setWidth("100%"); this.setWidth(String.format("%spx", (browserWidth * 0.6))); // this.setHeight(String.format("%spx", (browserHeight * 0.8))); VerticalLayout statistics = new VerticalLayout(); HorizontalLayout statContent = new HorizontalLayout(); statContent.setCaption("Statistics"); statContent.setIcon(FontAwesome.BAR_CHART_O); statContent.addComponent(new Label(String.format("%s registered dataset(s).", numberOfDatasets))); statContent.setMargin(true); statContent.setSpacing(true); statistics.addComponent(statContent); statistics.setMargin(true); this.vert.addComponent(statistics); // Table (containing datasets) section VerticalLayout tableSection = new VerticalLayout(); HorizontalLayout tableSectionContent = new HorizontalLayout(); tableSectionContent.setCaption("Registered Datasets"); tableSectionContent.setIcon(FontAwesome.FLASK); tableSectionContent.addComponent(this.table); tableSectionContent.setMargin(true); tableSection.setMargin(true); tableSection.addComponent(tableSectionContent); this.vert.addComponent(tableSection); table.setWidth("100%"); tableSection.setWidth("100%"); tableSectionContent.setWidth("100%"); // this.table.setSizeFull(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setHeight(null); buttonLayout.setWidth("100%"); buttonLayout.setSpacing(false); final Button visualize = new Button(VISUALIZE_BUTTON_CAPTION); buttonLayout.addComponent(this.download); buttonLayout.addComponent(visualize); Button checkAll = new Button("Select all datasets"); checkAll.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { for (Object itemId : table.getItemIds()) { ((CheckBox) table.getItem(itemId).getItemProperty("Select").getValue()).setValue(true); } } }); Button uncheckAll = new Button("Unselect all datasets"); uncheckAll.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { for (Object itemId : table.getItemIds()) { ((CheckBox) table.getItem(itemId).getItemProperty("Select").getValue()).setValue(false); } } }); buttonLayout.addComponent(checkAll); buttonLayout.addComponent(uncheckAll); /** * prepare download. */ download.setResource(new ExternalResource("javascript:")); download.setEnabled(false); visualize.setEnabled(false); for (final Object itemId : this.table.getItemIds()) { setCheckedBox(itemId, (String) this.table.getItem(itemId).getItemProperty("CODE").getValue()); } /* * Update the visualize button. It is only enabled, if the files can be visualized. */ this.table.addValueChangeListener(new ValueChangeListener() { /** * */ private static final long serialVersionUID = -4875903343717437913L; /** * check for what selection can be visualized. If so, enable the button. TODO change to * checked. */ @Override public void valueChange(ValueChangeEvent event) { // Nothing selected or more than one selected. Set<Object> selectedValues = (Set<Object>) event.getProperty().getValue(); if (selectedValues == null || selectedValues.size() == 0 || selectedValues.size() > 1) { visualize.setEnabled(false); return; } // if one selected check whether its dataset type is either fastqc or qcml. // For now we only visulize these two file types. Iterator<Object> iterator = selectedValues.iterator(); Object next = iterator.next(); String datasetType = (String) table.getItem(next).getItemProperty("Dataset Type").getValue(); String fileName = (String) table.getItem(next).getItemProperty("File Name").getValue(); // TODO: No hardcoding!! // if (datasetType.equals("FASTQC") || datasetType.equals("QCML") || // datasetType.equals("BAM") // || datasetType.equals("VCF")) { if (datasetType.equals("Q_WF_MS_QUALITYCONTROL_RESULTS") && (fileName.endsWith(".html") || fileName.endsWith(".qcML"))) { visualize.setEnabled(true); } else if (datasetType.equals("Q_WF_MS_QUALITYCONTROL_LOGS") && (fileName.endsWith(".err") || fileName.endsWith(".out"))) { visualize.setEnabled(true); } else { visualize.setEnabled(false); } } }); // TODO Workflow Views should get those data and be happy /* * Send message that in datasetview the following was selected. WorkflowViews get those messages * and save them, if it is valid information for them. */ this.table.addValueChangeListener(new ValueChangeListener() { /** * */ private static final long serialVersionUID = -3554627008191389648L; @Override public void valueChange(ValueChangeEvent event) { // Nothing selected or more than one selected. Set<Object> selectedValues = (Set<Object>) event.getProperty().getValue(); State state = (State) UI.getCurrent().getSession().getAttribute("state"); ArrayList<String> message = new ArrayList<String>(); message.add("DataSetView"); if (selectedValues != null && selectedValues.size() == 1) { Iterator<Object> iterator = selectedValues.iterator(); Object next = iterator.next(); String datasetType = (String) table.getItem(next).getItemProperty("Dataset Type").getValue(); message.add(datasetType); String project = (String) table.getItem(next).getItemProperty("Project").getValue(); String space = datahandler.getOpenBisClient().getProjectByCode(project).getSpaceCode();// .getIdentifier().split("/")[1]; message.add(project); message.add((String) table.getItem(next).getItemProperty("Sample").getValue()); // message.add((String) table.getItem(next).getItemProperty("Sample Type").getValue()); message.add((String) table.getItem(next).getItemProperty("dl_link").getValue()); message.add((String) table.getItem(next).getItemProperty("File Name").getValue()); message.add(space); // state.notifyObservers(message); } else { message.add("null"); } // TODO // state.notifyObservers(message); } }); // TODO get the GV to work here. Together with reverse proxy // Assumes that table Value Change listner is enabling or disabling the button if preconditions // are not fullfilled visualize.addClickListener(new ClickListener() { /** * */ private static final long serialVersionUID = 9015273307461506369L; @Override public void buttonClick(ClickEvent event) { Set<Object> selectedValues = (Set<Object>) table.getValue(); Iterator<Object> iterator = selectedValues.iterator(); Object next = iterator.next(); String datasetCode = (String) table.getItem(next).getItemProperty("CODE").getValue(); String datasetFileName = (String) table.getItem(next).getItemProperty("File Name").getValue(); URL url; try { Object parent = table.getParent(next); if (parent != null) { String parentDatasetFileName = (String) table.getItem(parent).getItemProperty("File Name") .getValue(); url = datahandler.getOpenBisClient().getUrlForDataset(datasetCode, parentDatasetFileName + "/" + datasetFileName); } else { url = datahandler.getOpenBisClient().getUrlForDataset(datasetCode, datasetFileName); } Window subWindow = new Window( "QC of Sample: " + (String) table.getItem(next).getItemProperty("Sample").getValue()); VerticalLayout subContent = new VerticalLayout(); subContent.setMargin(true); subWindow.setContent(subContent); QbicmainportletUI ui = (QbicmainportletUI) UI.getCurrent(); // Put some components in it Resource res = null; String datasetType = (String) table.getItem(next).getItemProperty("Dataset Type").getValue(); final RequestHandler rh = new ProxyForGenomeViewerRestApi(); boolean rhAttached = false; if (datasetType.equals("Q_WF_MS_QUALITYCONTROL_RESULTS") && datasetFileName.endsWith(".qcML")) { QcMlOpenbisSource re = new QcMlOpenbisSource(url); StreamResource streamres = new StreamResource(re, datasetFileName); streamres.setMIMEType("application/xml"); res = streamres; } else if (datasetType.equals("Q_WF_MS_QUALITYCONTROL_RESULTS") && datasetFileName.endsWith(".html")) { QcMlOpenbisSource re = new QcMlOpenbisSource(url); StreamResource streamres = new StreamResource(re, datasetFileName); streamres.setMIMEType("text/html"); res = streamres; } else if (datasetType.equals("Q_WF_MS_QUALITYCONTROL_LOGS") && (datasetFileName.endsWith(".err") || datasetFileName.endsWith(".out"))) { QcMlOpenbisSource re = new QcMlOpenbisSource(url); StreamResource streamres = new StreamResource(re, datasetFileName); streamres.setMIMEType("text/plain"); res = streamres; } else if (datasetType.equals("FASTQC")) { res = new ExternalResource(url); } else if (datasetType.equals("BAM") || datasetType.equals("VCF")) { String filePath = (String) table.getItem(next).getItemProperty("dl_link").getValue(); filePath = String.format("/store%s", filePath.split("store")[1]); String fileId = (String) table.getItem(next).getItemProperty("File Name").getValue(); // fileId = "control.1kg.panel.samples.vcf.gz"; // UI.getCurrent().getSession().addRequestHandler(rh); rhAttached = true; ThemeDisplay themedisplay = (ThemeDisplay) VaadinService.getCurrentRequest() .getAttribute(WebKeys.THEME_DISPLAY); String hostTmp = "http://localhost:7778/vizrest/rest";// "http://localhost:8080/web/guest/mainportlet?p_p_id=QbicmainportletApplicationPortlet_WAR_QBiCMainPortlet_INSTANCE_5pPd5JQ8uGOt&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1"; // hostTmp += // "&qbicsession=" + UI.getCurrent().getSession().getAttribute("gv-restapi-session") // + "&someblabla="; // String hostTmp = themedisplay.getURLPortal() + // UI.getCurrent().getPage().getLocation().getPath() + "?qbicsession=" + // UI.getCurrent().getSession().getAttribute("gv-restapi-session") + "&someblabla=" ; // String host = Base64.encode(hostTmp.getBytes()); String title = (String) table.getItem(next).getItemProperty("Sample").getValue(); // res = // new ExternalResource( // String // .format( // "http://localhost:7778/genomeviewer/?host=%s&title=%s&fileid=%s&featuretype=alignments&filepath=%s&removeZeroGenotypes=false", // host, title, fileId, filePath)); } BrowserFrame frame = new BrowserFrame("", res); if (rhAttached) { frame.addDetachListener(new DetachListener() { /** * */ private static final long serialVersionUID = 1534523447730906543L; @Override public void detach(DetachEvent event) { UI.getCurrent().getSession().removeRequestHandler(rh); } }); } frame.setSizeFull(); subContent.addComponent(frame); // Center it in the browser window subWindow.center(); subWindow.setModal(true); subWindow.setSizeFull(); frame.setHeight((int) (ui.getPage().getBrowserWindowHeight() * 0.8), Unit.PIXELS); // Open it in the UI ui.addWindow(subWindow); } catch (MalformedURLException e) { LOGGER.error(String.format("Visualization failed because of malformedURL for dataset: %s", datasetCode)); Notification.show( "Given dataset has no file attached to it!! Please Contact your project manager. Or check whether it already has some data", Notification.Type.ERROR_MESSAGE); } } }); this.vert.addComponent(buttonLayout); }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.ExperimentComponent.java
License:Open Source License
private void initUI() { expSteps = new VerticalLayout(); expSteps.setWidth(100.0f, Unit.PERCENTAGE); expSteps.setMargin(new MarginInfo(true, true, true, true)); expSteps.setSpacing(true);/* www . j a va2s . co m*/ export = new Button("Export as TSV"); export.setIcon(FontAwesome.DOWNLOAD); VerticalLayout buttonLayoutSection = new VerticalLayout(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setHeight(null); buttonLayout.setWidth("100%"); buttonLayout.addComponent(this.export); buttonLayout.setMargin(new MarginInfo(false, false, false, false)); buttonLayoutSection.addComponent(buttonLayout); buttonLayoutSection.setSpacing(true); buttonLayoutSection.setMargin(new MarginInfo(false, false, false, false)); experiments = new Grid(); experiments.setReadOnly(true); experiments.setWidth(100.0f, Unit.PERCENTAGE); experiments.setCaption("Registered Experimental Steps"); // experiments.setContainerDataSource(new // BeanItemContainer<ExperimentBean>(ExperimentBean.class)); expSteps.addComponent(new Label( "This view shows the experimental steps which have been registered for this project. Experimental steps contain real biological experiments as well as executed computational workflows on project data", ContentMode.HTML)); expSteps.addComponent(experiments); expSteps.addComponent(buttonLayoutSection); setCompositionRoot(expSteps); }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.ExperimentView.java
License:Open Source License
/** * /*w w w . ja va 2 s .c o m*/ * @return */ HorizontalLayout initButtonLayout() { this.export = new Button("Export as TSV"); buttonLayoutSection = new VerticalLayout(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setMargin(new MarginInfo(false, false, true, true)); buttonLayout.setHeight(null); buttonLayout.setWidth("100%"); buttonLayoutSection.setSpacing(true); buttonLayoutSection.addComponent(buttonLayout); buttonLayoutSection.setMargin(new MarginInfo(false, false, true, true)); buttonLayout.addComponent(this.export); return buttonLayout; }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.ExperimentView.java
License:Open Source License
VerticalLayout initTable() { this.table = this.buildFilterTable(); this.tableClickChangeTreeView(); VerticalLayout tableSection = new VerticalLayout(); HorizontalLayout tableSectionContent = new HorizontalLayout(); // tableSectionContent.setCaption("Registered Samples"); // tableSectionContent.setIcon(FontAwesome.FLASK); tableSectionContent.addComponent(this.table); tableSectionContent.setMargin(new MarginInfo(true, true, false, true)); // tableSectionContent.setMargin(true); // tableSection.setMargin(true); tableSection.setMargin(new MarginInfo(true, false, false, true)); // this.table.setWidth("100%"); tableSection.setWidth("100%"); tableSectionContent.setWidth("100%"); tableSection.addComponent(tableSectionContent); this.export = new Button("Export as TSV"); buttonLayoutSection = new VerticalLayout(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setMargin(new MarginInfo(false, false, false, true)); buttonLayout.setHeight(null);//from w ww . j a va2 s . c om buttonLayout.setWidth("100%"); buttonLayoutSection.setSpacing(true); buttonLayoutSection.addComponent(buttonLayout); buttonLayoutSection.setMargin(new MarginInfo(true, false, true, false)); buttonLayout.addComponent(this.export); tableSection.addComponent(buttonLayoutSection); return tableSection; }
From source file:de.uni_tuebingen.qbic.qbicmainportlet.HomeView.java
License:Open Source License
private void setExportButton() { buttonLayoutSection.removeAllComponents(); HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setHeight(null);//ww w . ja v a 2 s. com buttonLayout.setWidth("100%"); buttonLayoutSection.addComponent(buttonLayout); buttonLayout.addComponent(this.export); StreamResource sr = Utils.getTSVStream(Utils.containerToString(currentBean.getProjects()), "project_overview"); FileDownloader fileDownloader = new FileDownloader(sr); fileDownloader.extend(this.export); }