本文整理匯總了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);
}
示例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);
}
}
示例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();
}
}
示例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);
}
示例5: onTabClose
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void onTabClose(TabSheet tabsheet, Component tabContent) {
tabsheet.removeComponent(tabContent);
tabsheet.setSelectedTab(0);
}
示例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);
}