com.vaadin.ui.TabSheet.SelectedTabChangeEvent Java Examples

The following examples show how to use com.vaadin.ui.TabSheet.SelectedTabChangeEvent. 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: LoadBalancerDesc.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setWidth("100%");
    setHeight("100%");
    setCaption(ViewProperties.getCaption("panel.loadBalancerDesc"));
    addStyleName("loadbalancer-desc-panel");
    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(false);
    layout.setSpacing(false);
    layout.addStyleName("loadbalancer-desc-layout");

    tab = new TabSheet();
    tab.addStyleName(Reindeer.TABSHEET_BORDERLESS);
    tab.setWidth("100%");
    tab.setHeight("100%");
    addComponent(tab);

    // 基本情報
    loadBalancerDescBasic = new LoadBalancerDescBasic(sender);
    tab.addTab(loadBalancerDescBasic, ViewProperties.getCaption("tab.loadBalancerDescBasic"),
            Icons.BASIC.resource());

    // 詳細情報
    loadBalancerDescServer = new LoadBalancerDescServer(sender);
    tab.addTab(loadBalancerDescServer, ViewProperties.getCaption("tab.loadBalancerDescServer"),
            Icons.DETAIL.resource());

    tab.addListener(TabSheet.SelectedTabChangeEvent.class, this, "selectedTabChange");
}
 
Example #2
Source File: ServerDesc.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setWidth("100%");
    setHeight("100%");
    setCaption(ViewProperties.getCaption("panel.serverDesc"));
    addStyleName(Reindeer.PANEL_LIGHT);
    addStyleName("server-desc-panel");

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(false);
    layout.setSpacing(false);
    layout.addStyleName("server-desc-layout");

    tab = new TabSheet();
    tab.addStyleName(Reindeer.TABSHEET_BORDERLESS);
    tab.setWidth("100%");
    tab.setHeight("100%");
    addComponent(tab);

    // 基本情報タブ
    serverDescBasic = new ServerDescBasic(sender);
    tab.addTab(serverDescBasic, ViewProperties.getCaption("tab.serverDescBasic"), Icons.BASIC.resource());

    // 詳細情報タブ
    serverDescDetail = new ServerDescDetail();
    tab.addTab(serverDescDetail, ViewProperties.getCaption("tab.serverDescDetail"), Icons.DETAIL.resource());

    tab.addListener(new SelectedTabChangeListener() {
        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            ServerDesc.this.selectedTabChange(event);
        }
    });
}
 
Example #3
Source File: MainView.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void selectedTabChange(SelectedTabChangeEvent event) {
    if (tab.getSelectedTab() == servicePanel) {
        servicePanel.refreshDesc();
    } else if (tab.getSelectedTab() == serverPanel) {
        serverPanel.refreshDesc();
    } else if (tab.getSelectedTab() == loadBalancerPanel) {
        loadBalancerPanel.refreshDesc();
    }
}
 
Example #4
Source File: ServiceDesc.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setWidth("100%");
    setHeight("100%");
    setCaption(ViewProperties.getCaption("panel.serviceDesc"));
    addStyleName("service-desc-panel");
    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(false);
    layout.setSpacing(false);
    layout.addStyleName("service-desc-layout");

    tab = new TabSheet();
    tab.addStyleName(Reindeer.TABSHEET_BORDERLESS);
    tab.setWidth("100%");
    tab.setHeight("100%");
    addComponent(tab);

    // 基本情報タブ
    serviceDescBasic = new ServiceDescBasic(sender);
    tab.addTab(serviceDescBasic, ViewProperties.getCaption("tab.serviceDescBasic"), Icons.BASIC.resource());

    // 詳細情報タブ
    serviceDescDetail = new ServiceDescDetail();
    tab.addTab(serviceDescDetail, ViewProperties.getCaption("tab.serviceDescDetail"), Icons.DETAIL.resource());

    tab.addListener(new SelectedTabChangeListener() {
        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            ServiceDesc.this.selectedTabChange(event);
        }
    });
}
 
Example #5
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 #6
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();
		}
	});
}
 
Example #7
Source File: LoadBalancerDesc.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
public void selectedTabChange(SelectedTabChangeEvent event) {
    sender.loadBalancerPanel.refreshDesc();
}
 
Example #8
Source File: ServerDesc.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
public void selectedTabChange(SelectedTabChangeEvent event) {
    sender.serverPanel.refreshDesc();
}
 
Example #9
Source File: ServiceDesc.java    From primecloud-controller with GNU General Public License v2.0 4 votes vote down vote up
public void selectedTabChange(SelectedTabChangeEvent event) {
    sender.servicePanel.refreshDesc();
}
 
Example #10
Source File: VerticalTabsheet.java    From mycollab with GNU Affero General Public License v3.0 4 votes vote down vote up
public void addTab(String parentId, String id, String caption, String link, Resource resource) {
    if (!hasTab(id)) {
        ButtonTab tab = new ButtonTab(id, caption, link);

        tab.addClickListener(clickEvent -> {
            if (!clickEvent.isCtrlKey() && !clickEvent.isMetaKey()) {
                if (selectedComp != tab) {
                    setSelectedTab(tab);
                }
                fireTabChangeEvent(new SelectedTabChangeEvent(VerticalTabsheet.this, true));
            } else {
                Page.getCurrent().open(tab.link, "_blank", false);
            }
        });

        tab.setIcon(resource);
        tab.withStyleName(TAB_STYLE, WebThemes.TEXT_ELLIPSIS).withFullWidth();

        if (parentId == null) {
            navigatorContainer.addComponent(tab);
        } else {
            ButtonTab parentTab = compMap.get(parentId);
            if (parentTab != null) {
                parentTab.addSubTab(tab);
                navigatorContainer.addComponent(tab);
                parentTab.addStyleName("collapsed-tab");
                tab.addStyleName("child-tab");
                tab.addStyleName("hide");

                if (parentTab.getListeners(Button.ClickEvent.class).size() < 2) {
                    parentTab.addClickListener((Button.ClickListener) event -> parentTab.toggleGroupTabDisplay());
                }
            } else {
                throw new MyCollabException("Not found parent tab with id " + parentId);
            }
        }

        compMap.put(id, tab);
    } else {
        throw new MyCollabException("Existing tab has id " + id);
    }
}
 
Example #11
Source File: VerticalTabsheet.java    From mycollab with GNU Affero General Public License v3.0 4 votes vote down vote up
private void fireTabChangeEvent(SelectedTabChangeEvent event) {
    this.fireEvent(event);
}
 
Example #12
Source File: VerticalTabsheet.java    From mycollab with GNU Affero General Public License v3.0 4 votes vote down vote up
public void addSelectedTabChangeListener(TabSheet.SelectedTabChangeListener listener) {
    this.addListener(SelectedTabChangeEvent.class, listener, SELECTED_TAB_CHANGE_METHOD);
}