当前位置: 首页>>代码示例>>Java>>正文


Java Accordion.addTab方法代码示例

本文整理汇总了Java中com.vaadin.ui.Accordion.addTab方法的典型用法代码示例。如果您正苦于以下问题:Java Accordion.addTab方法的具体用法?Java Accordion.addTab怎么用?Java Accordion.addTab使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.Accordion的用法示例。


在下文中一共展示了Accordion.addTab方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAddFilesLayout

import com.vaadin.ui.Accordion; //导入方法依赖的package包/类
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;
}
 
开发者ID:RosesTheN00b,项目名称:MetricsToGo,代码行数:35,代码来源:UIStartPage.java

示例2: addSystemInfo

import com.vaadin.ui.Accordion; //导入方法依赖的package包/类
@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());
}
 
开发者ID:apache,项目名称:incubator-tamaya-sandbox,代码行数:13,代码来源:AbstractTextInfoProvider.java

示例3: createStatAccordion

import com.vaadin.ui.Accordion; //导入方法依赖的package包/类
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;
}
 
开发者ID:daergoth,项目名称:HomeWire-Server,代码行数:28,代码来源:StatisticView.java

示例4: createSection

import com.vaadin.ui.Accordion; //导入方法依赖的package包/类
@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());
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:13,代码来源:AccordionSideBar.java

示例5: init

import com.vaadin.ui.Accordion; //导入方法依赖的package包/类
@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);
	}
}
 
开发者ID:akquinet,项目名称:vaangular,代码行数:51,代码来源:VaangularUI.java

示例6: createWestLayout

import com.vaadin.ui.Accordion; //导入方法依赖的package包/类
/**
    * 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;
   }
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:55,代码来源:TopologyWidgetTestApplication.java

示例7: buildLocationDataAccordion

import com.vaadin.ui.Accordion; //导入方法依赖的package包/类
@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;
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:43,代码来源:MapView.java


注:本文中的com.vaadin.ui.Accordion.addTab方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。