Java Code Examples for com.vaadin.ui.TabSheet#addSelectedTabChangeListener()

The following examples show how to use com.vaadin.ui.TabSheet#addSelectedTabChangeListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private TabSheet createGroupDefinitionTabs() {
    final TabSheet tabSheet = new TabSheet();
    tabSheet.setId(UIComponentIdProvider.ROLLOUT_GROUPS);
    tabSheet.setWidth(850, Unit.PIXELS);
    tabSheet.setHeight(300, Unit.PIXELS);
    tabSheet.setStyleName(SPUIStyleDefinitions.ROLLOUT_GROUPS);

    final TabSheet.Tab simpleTab = tabSheet.addTab(createSimpleGroupDefinitionTab(),
            i18n.getMessage("caption.rollout.tabs.simple"));
    simpleTab.setId(UIComponentIdProvider.ROLLOUT_SIMPLE_TAB);

    final TabSheet.Tab advancedTab = tabSheet.addTab(defineGroupsLayout,
            i18n.getMessage("caption.rollout.tabs.advanced"));
    advancedTab.setId(UIComponentIdProvider.ROLLOUT_ADVANCED_TAB);

    tabSheet.addSelectedTabChangeListener(event -> validateGroups());

    return tabSheet;
}
 
Example 2
Source File: StatView.java    From chipster with MIT License 5 votes vote down vote up
public StatView(ChipsterAdminUI app) {
	
	super(app, TIMEOUT);
				
	this.addComponent(getToolbar());
	this.addComponent(super.getProggressIndicator());

	tabSheet = new TabSheet();
	tabSheet.setSizeFull();
	
       this.addComponent(tabSheet);        
       this.setExpandRatio(tabSheet, 1);
	this.setSizeFull();
	
       tabSheet.addTab(monthlyStats, "Monthly statistics");        
       tabSheet.addTab(yearlyStats, "Yearly statistics");
       tabSheet.addTab(toolUsage, "Tools usage (1 year)");
       tabSheet.addTab(topUsers, "Top users (1 year)");
       tabSheet.addTab(toolFails, "Tool fails (1 year)");
       tabSheet.addTab(moduleUsage, "Module job counts (beta)");
       
	tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {
		@Override
		public void selectedTabChange(SelectedTabChangeEvent e) {				
			update();
		}
	});
}
 
Example 3
Source File: ReportView.java    From chipster with MIT License 5 votes vote down vote up
public ReportView(ChipsterAdminUI app) {
	
	super(app, UPDATE_WAIT);
				
	this.addComponent(getToolbar());
	
	this.addComponent(super.getProggressIndicator());

	tabSheet = new TabSheet();
	
	dataSource = new ReportDataSource(app.getEndpoint());
			
	tabSheet.setSizeFull();
	
       this.addComponent(tabSheet);        
       this.setExpandRatio(tabSheet, 1);
	this.setSizeFull();
	
	filebrokerLabel = createReportLabel("waiting for status report...");
	compLabel = createReportLabel("waiting for status report...");
	jobmanagerLabel = createReportLabel("waiting for status report...");
	
	filebrokerLayout.addComponent(filebrokerLabel);
	tabSheet.addTab(filebrokerLayout, "Filebroker");
	compLayout.addComponent(compLabel);
	tabSheet.addTab(compLayout, "Comp");
	jobmanagerLayout.addComponent(jobmanagerLabel);
	tabSheet.addTab(jobmanagerLayout, "Jobmanager");
	
	tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {

		@Override
		public void selectedTabChange(SelectedTabChangeEvent e) {
			update();
		}
	});
}