private VerticalLayout getAddFilesLayout() { VerticalLayout addFilesLayout = new VerticalLayout(); Label label = new Label(SUB_TITLE); label.addStyleName(ValoTheme.LABEL_H3); label.addStyleName("align-left"); addFilesLayout.addComponent(label); addFilesLayout.setComponentAlignment(label, Alignment.TOP_CENTER); Accordion accordion = new Accordion(); accordion.setSizeFull(); for (Options option : options) { VerticalLayout optionLayout = new VerticalLayout(); if (option == Options.Path) { optionLayout = getPathLayout(); } if (option == Options.Copy_Paste) { optionLayout = getCopyPasteLayout(); } if (option == Options.Edit) { optionLayout = getEditLayer(); } optionLayout.setSizeFull(); accordion.addTab(optionLayout, option.getText()); } addFilesLayout.addComponent(accordion); addFilesLayout.setComponentAlignment(accordion, Alignment.MIDDLE_CENTER); return addFilesLayout; }
private void clearMenuSelection() { for (Component next : this.menu) { if (next instanceof Accordion) { clearAccordionSubMenu((Accordion) next); } } }
private void clearAccordionSubMenu(Accordion subMenu) { for (Component next : subMenu) { if (next instanceof CssLayout) { clearSubmenuSelection((CssLayout) next); } } }
@Override public void addSystemInfo(Accordion systemInfoPanel) { VerticalLayout layout = new VerticalLayout(); textArea = new TextArea("System Info"); textArea.addStyleName(UIConstants.FIXED_FONT); textArea.setValue(getInfo()); textArea.setRows(20); textArea.setHeight("400px"); textArea.setWidth("100%"); layout.addComponents(textArea); systemInfoPanel.addTab(layout, getCaption()); }
private Component createStatAccordion() { Accordion statAccordion = new Accordion(); statAccordion.setWidth(75, Unit.PERCENTAGE); Collection<TimeSeries> minuteGroupedData = groupDataById(statisticDeviceDataService.getStats(DeviceStateEntity.StateInterval.MINUTE)) .values(); TimeSeriesChart minuteChart = new TimeSeriesChart(minuteGroupedData); charts.add(minuteChart); statAccordion.addTab(minuteChart, "By minute"); Collection<TimeSeries> hourGroupedData = groupDataById(statisticDeviceDataService.getStats(DeviceStateEntity.StateInterval.HOUR)) .values(); TimeSeriesChart hourChart = new TimeSeriesChart(hourGroupedData); charts.add(hourChart); statAccordion.addTab(hourChart, "By hour"); Collection<TimeSeries> dayGroupedData = groupDataById(statisticDeviceDataService.getStats(DeviceStateEntity.StateInterval.HOUR)) .values(); TimeSeriesChart dayChart = new TimeSeriesChart(dayGroupedData); charts.add(dayChart); statAccordion.addTab(dayChart, "By day"); return statAccordion; }
public VaadinInvoiceGui(VaadinInvoiceController controller) { super(); this.controller = controller; invoice = new Invoice(); invoiceBean = new BeanItem<Invoice>(invoice); createButton = new Button("Generate PDF"); titlePanel = new TitlePanel(createButton, invoiceBean, controller); infoPanel = new InfoPanel(invoiceBean); descriptionPanel = new DescriptionPanel(invoiceBean); invoiceRowPanel = new InvoiceRowPanel(invoiceBean); uploadPanel = new UploadPanel(invoiceBean, controller.getSessionId(), controller); descriptionAndUploadAccordion = new Accordion(); setActionListeners(); setLayout(); }
@Override public void createSection(Accordion compositionRoot, SideBarSectionDescriptor descriptor, Collection<SideBarItemDescriptor> itemDescriptors) { final Panel panel = new Panel(); panel.addStyleName(SIDE_BAR_SECTION_STYLE); panel.setSizeFull(); final VerticalLayout layout = new VerticalLayout(); panel.setContent(layout); for (SideBarItemDescriptor item : itemDescriptors) { layout.addComponent(itemComponentFactory.createItemComponent(item)); } compositionRoot.addTab(panel, descriptor.getCaption()); }
public AccordionBuilder() { super(new Accordion()); }
@Override protected Accordion build(Accordion instance) { return instance; }
@Override protected TabsBuilder<Accordion> builder() { return this; }
private void createAccordian() { accordion = new Accordion(); accordion.setSizeFull(); }
@Override protected void init(VaadinRequest request) { try { VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setMargin(true); mainLayout.setSpacing(true); Accordion accordion = new Accordion(); weatherInfo = new Weather(); final int[] times = new int[] { 10, 12, 14, 16 }; final String[] entries = new String[] { "<strong>10°</strong> sunny", "<strong>12°</strong> windy", "<strong>14°</strong> cold", "<strong>20°</strong> superb" }; weatherInfo.setDaten(times, entries); weatherInfo.addClickListener(new WeatherClickListener() { private static final long serialVersionUID = 1L; @Override public void click(int time, String entry) { showPopup(entry); } }); weatherInfo.setButtonCaption("E-Mail (from angular)"); accordion.addTab(weatherInfo, "Weather-Demo"); mainLayout.addComponent(accordion); javaSend = new Button(); javaSend.setCaption("E-Mail (from Java)"); javaSend.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { int index = weatherInfo.getSliderPos(); System.out.println("Button from w/in Java - value: " + index); showPopup(entries[index]); } }); mainLayout.addComponent(javaSend); setContent(mainLayout); } catch (Exception e) { throw new RuntimeException("some stupid error occured!", e); } }
@Override protected Accordion createCompositionRoot() { Accordion accordion = new Accordion(); accordion.setSizeFull(); return accordion; }
@Override protected SectionComponentFactory<Accordion> createDefaultSectionComponentFactory() { return new DefaultSectionComponentFactory(); }
/** * Creates the west area layout including the * accordion and tree views. * * @return */ @SuppressWarnings("serial") private Layout createWestLayout() { m_tree = createTree(); final TextField filterField = new TextField("Filter"); filterField.setTextChangeTimeout(200); final Button filterBtn = new Button("Filter"); filterBtn.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { GCFilterableContainer container = m_tree.getContainerDataSource(); container.removeAllContainerFilters(); String filterString = (String) filterField.getValue(); if(!filterString.equals("") && filterBtn.getCaption().toLowerCase().equals("filter")) { container.addContainerFilter(LABEL_PROPERTY, (String) filterField.getValue(), true, false); filterBtn.setCaption("Clear"); } else { filterField.setValue(""); filterBtn.setCaption("Filter"); } } }); HorizontalLayout filterArea = new HorizontalLayout(); filterArea.addComponent(filterField); filterArea.addComponent(filterBtn); filterArea.setComponentAlignment(filterBtn, Alignment.BOTTOM_CENTER); m_treeAccordion = new Accordion(); m_treeAccordion.addTab(m_tree, m_tree.getTitle()); m_treeAccordion.setWidth("100%"); m_treeAccordion.setHeight("100%"); AbsoluteLayout absLayout = new AbsoluteLayout(); absLayout.setWidth("100%"); absLayout.setHeight("100%"); absLayout.addComponent(filterArea, "top: 25px; left: 15px;"); absLayout.addComponent(m_treeAccordion, "top: 75px; left: 15px; right: 15px; bottom:25px;"); return absLayout; }
@AutoGenerated private Accordion buildLocationDataAccordion() { // common part: create layout locationDataAccordion = new Accordion(); locationDataAccordion.setImmediate(true); locationDataAccordion.setWidth("100.0%"); locationDataAccordion.setHeight("100.0%"); // statistic1Layout statistic1Layout = new VerticalLayout(); statistic1Layout.setImmediate(false); statistic1Layout.setWidth("100.0%"); statistic1Layout.setHeight("100.0%"); statistic1Layout.setMargin(false); locationDataAccordion.addTab(statistic1Layout, "Statistic 1", null); // statistic2Layout statistic2Layout = new VerticalLayout(); statistic2Layout.setImmediate(false); statistic2Layout.setWidth("100.0%"); statistic2Layout.setHeight("100.0%"); statistic2Layout.setMargin(false); locationDataAccordion.addTab(statistic2Layout, "Statistic 2", null); // statistic3Layout statistic3Layout = new VerticalLayout(); statistic3Layout.setImmediate(false); statistic3Layout.setWidth("100.0%"); statistic3Layout.setHeight("100.0%"); statistic3Layout.setMargin(false); locationDataAccordion.addTab(statistic3Layout, "Statistic 3", null); // statistic4Layout statistic4Layout = new VerticalLayout(); statistic4Layout.setImmediate(false); statistic4Layout.setWidth("100.0%"); statistic4Layout.setHeight("100.0%"); statistic4Layout.setMargin(false); locationDataAccordion.addTab(statistic4Layout, "Statistic 4", null); return locationDataAccordion; }
/** * Gets a builder to create an {@link Accordion}. * @return Accordion builder */ static TabsBuilder<Accordion> accordion() { return new AccordionBuilder(); }
void addSystemInfo(Accordion systemInfoPanel);
void updateSystemInfo(Accordion systemInfoPanel);