Java 类com.vaadin.ui.TabSheet.SelectedTabChangeListener 实例源码

项目:sqlexplorer-vaadin    文件:QueryPanel.java   
protected void setSelectedTabChangeListener() {
    resultsTabs.addSelectedTabChangeListener(new SelectedTabChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            Component tab = resultsTabs.getSelectedTab();
            String st = resultStatuses.get(tab);
            if (st == null && tab instanceof VerticalLayout) {
                if (((VerticalLayout) tab).getComponentCount() > 0) {
                    st = resultStatuses.get(((VerticalLayout) tab).getComponent(0));
                }
            }
            if (st == null) {
                st = "No Results";
            }
            status.setValue(st);
        }
    });
}
项目:mycollab    文件:UserPermissionManagementViewImpl.java   
private void buildComponents() {
    userPresenter = PresenterResolver.getPresenter(UserPresenter.class);
    groupTab.addTab(userPresenter.getView(), UserUIContext.getMessage(UserI18nEnum.LIST));

    rolePresenter = PresenterResolver.getPresenter(RolePresenter.class);
    groupTab.addTab(rolePresenter.getView(), UserUIContext.getMessage(RoleI18nEnum.LIST));

    groupTab.addSelectedTabChangeListener(new SelectedTabChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            Tab tab = ((TabSheetDecorator) event.getTabSheet()).getSelectedTabInfo();
            String caption = tab.getCaption();
            if (UserUIContext.getMessage(UserI18nEnum.LIST).equals(caption)) {
                userPresenter.go(UserPermissionManagementViewImpl.this, null);
            } else if (UserUIContext.getMessage(RoleI18nEnum.LIST).equals(caption)) {
                rolePresenter.go(UserPermissionManagementViewImpl.this, null);
            }
        }
    });

}
项目:mycollab    文件:CrmSettingContainer.java   
private void buildComponents() {
    settingTab.addTab(constructNotificationSettingView(), "notification",
            "Notifications");

    settingTab.addTab(constructCustomLayoutView(), "customlayout",
            "Custom Layouts");

    settingTab.addSelectedTabChangeListener(new SelectedTabChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            Tab tab = ((VerticalTabsheet) event.getSource()).getSelectedTab();
            String tabId = ((TabImpl) tab).getTabId();

            if ("notification".equals(tabId)) {
                notificationPresenter.go(CrmSettingContainer.this, new NotificationSettingScreenData.Read());
            } else if ("customlayout".equals(tabId)) {
                customViewPresenter.go(CrmSettingContainer.this, new CustomViewScreenData.Read());
            }

        }
    });
}
项目:academ    文件:PanelOpciones.java   
/**
 * The constructor should first build the main layout, set the
 * composition root and then do any custom initialization.
 *
 * The constructor will not be automatically regenerated by the
 * visual editor.
 */
public PanelOpciones() {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    tabSheetOpciones.addSelectedTabChangeListener(new SelectedTabChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {

        }
    });
}
项目:academ    文件:PanelOpciones.java   
/**
 * The constructor should first build the main layout, set the
 * composition root and then do any custom initialization.
 *
 * The constructor will not be automatically regenerated by the
 * visual editor.
 */
public PanelOpciones() {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // User code
    tabSheetOpciones.addSelectedTabChangeListener(new SelectedTabChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {

        }
    });
}
项目:sqlexplorer-vaadin    文件:TriggerInfoPanel.java   
public TriggerInfoPanel(Trigger trigger, IDb db, Settings settings, String selectedTabCaption) {

        setSizeFull();

        tabSheet = CommonUiUtils.createTabSheet();
        tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {

            private static final long serialVersionUID = 1L;

            @Override
            public void selectedTabChange(SelectedTabChangeEvent event) {
                selectedCaption = tabSheet.getTab(tabSheet.getSelectedTab()).getCaption();
            }
        });
        addComponent(tabSheet);

        refreshSource(trigger);
        refreshDetails(trigger, db, settings);

        Iterator<Component> i = tabSheet.iterator();
        while (i.hasNext()) {
            Component component = i.next();
            Tab tab = tabSheet.getTab(component);
            if (tab.getCaption().equals(selectedTabCaption)) {
                tabSheet.setSelectedTab(component);
                break;
            }            
        }
    }
项目:primecloud-controller    文件:ServerDesc.java   
@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);
        }
    });
}
项目:primecloud-controller    文件:ServiceDesc.java   
@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);
        }
    });
}
项目:konekti    文件:CaptureView.java   
/**
 * The constructor should first build the main layout, set the
 * composition root and then do any custom initialization.
 *
 * The constructor will not be automatically regenerated by the
 * visual editor.
 */
public CaptureView( IWorkbenchContext context, IViewContainer viewContainer) {
    buildMainLayout();
    setCompositionRoot(mainLayout);

    // TODO add user code here
    this.viewContainer = viewContainer;
    this.context = context;

    this.captureMessageService = SensorViewContainer.getCaptureMessageService();
    this.captureLocationService = SensorViewContainer.getCaptureLocationService();
    this.captureTelemetryService = SensorViewContainer.getCaptureTelemetryService();

    dgCaptureMessage = new DataGridView();
    dgCaptureMessage.setSizeFull();
    dgCaptureMessage.setImmediate(true);
    tabSheetMessage.addTab(dgCaptureMessage, CAPTURE_MESSAGE_TAB_NAME);

    dgCaptureLocation = new DataGridView();
    dgCaptureLocation.setSizeFull();
    dgCaptureLocation.setImmediate(true);
    tabSheetMessage.addTab(dgCaptureLocation, CAPTURE_LOCATION_TAB_NAME);

    dgCaptureTelemetry = new DataGridView();
    dgCaptureTelemetry.setSizeFull();
    dgCaptureTelemetry.setImmediate(true);
    tabSheetMessage.addTab(dgCaptureTelemetry, CAPTURE_TELEMETRY_TAB_NAME);

    tabSheetMessage.setSelectedTab(dgCaptureMessage);

    tabSheetMessage.addListener(new SelectedTabChangeListener() {
        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            RefreshDataSource(event.getTabSheet().getTab(tabSheetMessage.getSelectedTab()).getCaption());

        }
    });

    RefreshDataSource(tabSheetMessage.getTab(tabSheetMessage.getSelectedTab()).getCaption());
}
项目:chipster    文件:StatView.java   
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();
        }
    });
}
项目:chipster    文件:ReportView.java   
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();
        }
    });
}
项目:holon-vaadin    文件:AbstractTabsBuilder.java   
@Override
public TabsBuilder<C> withSelectedTabChangeListener(SelectedTabChangeListener listener) {
    ObjectUtils.argumentNotNull(listener, "SelectedTabChangeListener must be not null");
    instance.addSelectedTabChangeListener(listener);
    return builder();
}
项目:sqlexplorer-vaadin    文件:SqlExplorer.java   
public SqlExplorer(String configDir, IDbProvider databaseProvider, ISettingsProvider settingsProvider, String user, float leftSplitSize,
        IDbMenuItem... additionalMenuItems) {
    this.databaseProvider = databaseProvider;
    this.settingsProvider = settingsProvider;
    this.savedSplitPosition = leftSplitSize;
    this.additionalMenuItems = additionalMenuItems;

    setSizeFull();
    addStyleName("sqlexplorer");

    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setMargin(false);
    leftLayout.setSpacing(false);
    leftLayout.setSizeFull();
    leftLayout.addStyleName(ValoTheme.MENU_ROOT);

    leftLayout.addComponent(buildLeftMenu());

    Panel scrollable = new Panel();
    scrollable.setSizeFull();

    dbTree = buildDbTree();
    scrollable.setContent(dbTree);

    leftLayout.addComponent(scrollable);
    leftLayout.setExpandRatio(scrollable, 1);

    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setMargin(false);
    rightLayout.setSpacing(false);
    rightLayout.setSizeFull();

    VerticalLayout rightMenuWrapper = new VerticalLayout();
    rightMenuWrapper.setMargin(false);
    rightMenuWrapper.setWidth(100, Unit.PERCENTAGE);
    rightMenuWrapper.addStyleName(ValoTheme.MENU_ROOT);
    contentMenuBar = new MenuBar();
    contentMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    contentMenuBar.setWidth(100, Unit.PERCENTAGE);
    addShowButton(contentMenuBar);

    rightMenuWrapper.addComponent(contentMenuBar);
    rightLayout.addComponent(rightMenuWrapper);

    contentTabs = new SqlExplorerTabPanel();
    contentTabs.addSelectedTabChangeListener(new SelectedTabChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            selectContentTab((IContentTab) contentTabs.getSelectedTab());
        }
    });
    rightLayout.addComponent(contentTabs);
    rightLayout.setExpandRatio(contentTabs, 1);

    addComponents(leftLayout, rightLayout);

    setSplitPosition(savedSplitPosition, Unit.PIXELS);
}
项目:mycollab    文件:AccountModuleImpl.java   
private void buildComponents() {
    tabSheet.addTab(constructUserInformationComponent(), SettingUIConstants.PROFILE,
            UserUIContext.getMessage(AdminI18nEnum.VIEW_PROFILE), SettingAssetsManager.getAsset(SettingUIConstants.PROFILE));

    if (!SiteConfiguration.isCommunityEdition()) {
        tabSheet.addTab(constructAccountSettingsComponent(), SettingUIConstants.BILLING,
                UserUIContext.getMessage(AdminI18nEnum.VIEW_BILLING), SettingAssetsManager.getAsset(SettingUIConstants.BILLING));
    }

    tabSheet.addTab(constructUserRoleComponent(), SettingUIConstants.USERS,
            UserUIContext.getMessage(AdminI18nEnum.VIEW_USERS_AND_ROLES), SettingAssetsManager.getAsset(SettingUIConstants.USERS));

    tabSheet.addTab(constructThemeComponent(), SettingUIConstants.GENERAL_SETTING,
            UserUIContext.getMessage(AdminI18nEnum.VIEW_SETTING), SettingAssetsManager.getAsset(SettingUIConstants.GENERAL_SETTING));

    if (!SiteConfiguration.isDemandEdition()) {
        tabSheet.addTab(constructSetupComponent(), SettingUIConstants.SETUP,
                UserUIContext.getMessage(AdminI18nEnum.VIEW_SETUP), SettingAssetsManager.getAsset(SettingUIConstants.SETUP));
    }

    tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            Tab tab = ((VerticalTabsheet) event.getSource()).getSelectedTab();
            String tabId = ((TabImpl) tab).getTabId();
            if (SettingUIConstants.PROFILE.equals(tabId)) {
                profilePresenter.go(AccountModuleImpl.this, null);
            } else if (SettingUIConstants.BILLING.equals(tabId)) {
                billingPresenter.go(AccountModuleImpl.this, new BillingScreenData.BillingSummary());
            } else if (SettingUIConstants.USERS.equals(tabId)) {
                userPermissionPresenter.go(AccountModuleImpl.this, null);
            } else if (SettingUIConstants.GENERAL_SETTING.equals(tabId)) {
                customizePresenter.go(AccountModuleImpl.this, null);
            } else if (SettingUIConstants.SETUP.equals(tabId)) {
                setupPresenter.go(AccountModuleImpl.this, null);
            }
        }
    });
}
项目:mycollab    文件:VerticalTabsheet.java   
public void addSelectedTabChangeListener(TabSheet.SelectedTabChangeListener listener) {
    this.addListener(SelectedTabChangeEvent.class, listener, SELECTED_TAB_CHANGE_METHOD);
}
项目:holon-vaadin    文件:TabsBuilder.java   
/**
 * Add a {@link SelectedTabChangeListener}.
 * @param listener Listener to add (not null)
 * @return this
 */
TabsBuilder<C> withSelectedTabChangeListener(SelectedTabChangeListener listener);
项目:vaadin-fluent-api    文件:FluentTabSheet.java   
/**
 * Adds a tab selection listener.
 *
 * @see Registration
 *
 * @param listener
 *            the Listener to be added, not null
 * @return this for method chaining
 * @see TabSheet#addSelectedTabChangeListener(SelectedTabChangeListener)
 */
@SuppressWarnings("unchecked")
public default THIS withSelectedTabChangeListener(SelectedTabChangeListener listener) {
    ((TabSheet) this).addSelectedTabChangeListener(listener);
    return (THIS) this;
}