當前位置: 首頁>>代碼示例>>Java>>正文


Java TabSheet.setSelectedTab方法代碼示例

本文整理匯總了Java中com.vaadin.ui.TabSheet.setSelectedTab方法的典型用法代碼示例。如果您正苦於以下問題:Java TabSheet.setSelectedTab方法的具體用法?Java TabSheet.setSelectedTab怎麽用?Java TabSheet.setSelectedTab使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.TabSheet的用法示例。


在下文中一共展示了TabSheet.setSelectedTab方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ProfilePreferencesWindow

import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
private ProfilePreferencesWindow(final User user,
        final boolean preferencesTabOpen) {
    addStyleName("profile-window");
    setId(ID);
    Responsive.makeResponsive(this);

    setModal(true);
    setCloseShortcut(KeyCode.ESCAPE, null);
    setResizable(false);
    setClosable(false);
    setHeight(90.0f, Unit.PERCENTAGE);

    VerticalLayout content = new VerticalLayout();
    content.setSizeFull();
    content.setMargin(new MarginInfo(true, false, false, false));
    setContent(content);

    TabSheet detailsWrapper = new TabSheet();
    detailsWrapper.setSizeFull();
    detailsWrapper.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
    detailsWrapper.addStyleName(ValoTheme.TABSHEET_ICONS_ON_TOP);
    detailsWrapper.addStyleName(ValoTheme.TABSHEET_CENTERED_TABS);
    content.addComponent(detailsWrapper);
    content.setExpandRatio(detailsWrapper, 1f);

    detailsWrapper.addComponent(buildProfileTab());
    detailsWrapper.addComponent(buildPreferencesTab());

    if (preferencesTabOpen) {
        detailsWrapper.setSelectedTab(1);
    }

    content.addComponent(buildFooter());

    fieldGroup = new BeanFieldGroup<User>(User.class);
    fieldGroup.bindMemberFields(this);
    fieldGroup.setItemDataSource(user);
}
 
開發者ID:mcollovati,項目名稱:vaadin-vertx-samples,代碼行數:39,代碼來源:ProfilePreferencesWindow.java

示例2: close

import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
private void close() {
    if (getParent() instanceof TabSheet) {
        TabSheet parent = (TabSheet) getParent();
        parent.removeTab(parent.getTab(this));
        parent.setSelectedTab(2);
    }
}
 
開發者ID:hybridbpm,項目名稱:hybridbpm,代碼行數:8,代碼來源:CaseLayout.java

示例3: close

import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
private void close() {
    if (getParent() instanceof TabSheet) {
        TabSheet parent = (TabSheet) getParent();
        parent.removeTab(parent.getTab(this));
        parent.setSelectedTab(0);
    } else if (getParent() != null && getParent() instanceof VerticalLayout && getParent().getParent() instanceof AdaptiveTaskPanel) {
        AdaptiveTaskPanel adaptiveTaskPanel = (AdaptiveTaskPanel) getParent().getParent();
        adaptiveTaskPanel.close();
    } else if (getParent() != null && getParent() instanceof VerticalLayout && getParent().getParent() instanceof AdaptiveTaskEditor) {
        AdaptiveTaskEditor adaptiveTaskEditor = (AdaptiveTaskEditor) getParent().getParent();
        adaptiveTaskEditor.close();
    }
}
 
開發者ID:hybridbpm,項目名稱:hybridbpm,代碼行數:14,代碼來源:TaskLayout.java

示例4: menuSelected

import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void menuSelected(MenuItem selectedItem) {
	if (windowComponent == null)
		windowComponent = windowFactory.createWindowComponent(window, application);
	final TabSheet tabSheet = application.getConcreteApplication().getMainTabSheet();
	tabSheet.addListener(new ComponentContainer.ComponentDetachListener() {

		private static final long serialVersionUID = 1L;

		@Override
		public void componentDetachedFromContainer(ComponentDetachEvent event) {
			if (event.getDetachedComponent() == windowComponent) {
				windowComponent = null;
				tabSheet.removeListener(this);
			}
		}
	});
	Tab tab = tabSheet.addTab(windowComponent, window.getName());
	tab.setClosable(true);
	tab.setDescription(window.getDescription());
	tabSheet.setSelectedTab(tab);
}
 
開發者ID:frincon,項目名稱:openeos,代碼行數:23,代碼來源:OpenWindowCommand.java

示例5: onTabClose

import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void onTabClose(TabSheet tabsheet, Component tabContent) {
    tabsheet.removeComponent(tabContent);
    tabsheet.setSelectedTab(0);
}
 
開發者ID:hybridbpm,項目名稱:hybridbpm,代碼行數:6,代碼來源:TaskListView.java

示例6: PluginsPanelAddDialog

import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
public PluginsPanelAddDialog(ApplicationContext context, PluginsPanel pluginsPanel) {
    super("Add Plugins");
    this.context = context;
    this.pluginsPanel = pluginsPanel;
    this.pluginRepositories = context.getPluginService().findPluginRepositories();

    TabSheet tabSheet = new TabSheet();

    AbstractLayout searchLayout = buildSearchLayout();
    tabSheet.addTab(searchLayout, "Search For New Versions");

    AbstractLayout uploadLayout = buildUploadLayout();
    tabSheet.addTab(uploadLayout, "Upload");

    searchButton = new Button("Search", e -> search());
    searchButton.setEnabled(false);

    uploadHandler = new UploadHandler();
    uploadButton = new Upload(null, uploadHandler);
    uploadButton.setImmediate(true);
    uploadButton.setVisible(false);
    uploadButton.setButtonCaption("Upload");
    uploadButton.addFinishedListener(e -> finishedUpload());

    tabSheet.addSelectedTabChangeListener(e -> {
        boolean searchSelected = tabSheet.getSelectedTab().equals(searchLayout);
        searchButton.setVisible(searchSelected);
        uploadButton.setVisible(!searchSelected);
    });

    addComponent(tabSheet, 1);
    tabSheet.setSelectedTab(0);

    cancelButton = new Button("Cancel");
    cancelButton.addClickListener(new CloseButtonListener());

    addButton = new Button("Add");
    addButton.setEnabled(false);
    addButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
    addButton.addClickListener(e -> addPlugin());

    addComponent(buildButtonFooter(uploadButton, searchButton, cancelButton, addButton));

    cancelButton.focus();

    setWidth(550, Unit.PIXELS);
    setHeight(300, Unit.PIXELS);
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:49,代碼來源:PluginsPanelAddDialog.java


注:本文中的com.vaadin.ui.TabSheet.setSelectedTab方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。