本文整理匯總了Java中com.vaadin.ui.TabSheet.Tab方法的典型用法代碼示例。如果您正苦於以下問題:Java TabSheet.Tab方法的具體用法?Java TabSheet.Tab怎麽用?Java TabSheet.Tab使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.TabSheet
的用法示例。
在下文中一共展示了TabSheet.Tab方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addExitCloseTab
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
private void addExitCloseTab() {
VerticalLayout exitLayout = new VerticalLayout();
exitLayout.addComponentsAndExpand(new Label("We hope you had fun using the TinyPounder, it is now shutdown, " +
"as well as all the DatasetManagers, CacheManagers, and Terracotta servers you started with it"));
TabSheet.Tab tab = mainLayout.addTab(exitLayout, "EXIT : Close TinyPounder " + VERSION);
tab.setStyleName("tab-absolute-right");
mainLayout.addSelectedTabChangeListener(tabEvent -> {
if (tabEvent.getTabSheet().getSelectedTab().equals(tab.getComponent())) {
new Thread(() -> {
runningServers.values().forEach(RunningServer::stop);
consoleRefresher.cancel(true);
SpringApplication.exit(appContext);
}).start();
}
});
}
示例2: setDescription
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void setDescription(String description) {
this.description = description;
if (component.isAttached()) {
com.vaadin.ui.Window dialogWindow = asDialogWindow();
if (dialogWindow != null) {
dialogWindow.setDescription(description);
} else {
TabSheet.Tab tabWindow = asTabWindow();
if (tabWindow != null) {
setTabCaptionAndDescription(tabWindow);
windowManager.getBreadCrumbs((ComponentContainer) tabWindow.getComponent()).update();
}
}
}
}
示例3: setIcon
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void setIcon(String icon) {
this.icon = icon;
if (component.isAttached()) {
com.vaadin.ui.Window dialogWindow = asDialogWindow();
if (dialogWindow != null) {
dialogWindow.setIcon(WebComponentsHelper.getIcon(icon));
}
TabSheet.Tab tabWindow = asTabWindow();
if (tabWindow != null) {
tabWindow.setIcon(WebComponentsHelper.getIcon(icon));
}
}
}
示例4: isComponentVisible
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
/**
* Tests if component visible and its container visible.
*
* @param child component
* @return component visibility
*/
public static boolean isComponentVisible(Component child) {
if (child.getParent() instanceof TabSheet) {
TabSheet tabSheet = (TabSheet) child.getParent();
TabSheet.Tab tab = tabSheet.getTab(child);
if (!tab.isVisible()) {
return false;
}
}
if (child.getParent() instanceof CubaGroupBox) {
// ignore groupbox content container visibility
return isComponentVisible(child.getParent());
}
return child.isVisible() && (child.getParent() == null || isComponentVisible(child.getParent()));
}
示例5: buttonClick
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void buttonClick(final Button.ClickEvent event) {
try {
if (event.getButton().equals(btnAdd)) {
addNew();
} else if (event.getButton().equals(btnRefresh)) {
refreshTable();
HybridbpmUI.getBpmAPI().notifyTaskList();
} else if (event.getButton().getData() != null && event.getButton().getData() instanceof Task) {
Task task = (Task) event.getButton().getData();
TabSheet.Tab tab = tabSheet.addTab(new TaskLayout(task.getId().toString(), task.getProcessModelName(), task.getTaskName(), true), task.getTaskTitle());
tab.setClosable(true);
tabSheet.setSelectedTab(tab);
}
} catch (Exception ex) {
logger.log(Level.SEVERE, ex.getMessage(), ex);
Notification.show("Error", ex.getMessage(), Notification.Type.ERROR_MESSAGE);
}
}
示例6: createGroupDefinitionTabs
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
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;
}
示例7: createContent
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
protected Component createContent() {
logger.debug("Creating view content...");
initTabsheet();
final ExtaUri uri = new ExtaUri();
final TabSheet.Tab tabCandidat = getTab4Uri(uri).orElse(tabs.get(0));
// Делаем текущей нужную закладку
final SubdomainUI selectedTab = (SubdomainUI) tabsheet.getSelectedTab();
if(selectedTab.equals(tabCandidat.getComponent()))
selectedTab.show();
else
tabsheet.setSelectedTab(tabCandidat);
return contentContainer;
}
示例8: asTabWindow
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Nullable
protected TabSheet.Tab asTabWindow() {
if (component.isAttached()) {
com.vaadin.ui.Component parent = component;
while (parent != null) {
if (parent.getParent() instanceof TabSheet) {
return ((TabSheet) parent.getParent()).getTab(parent);
}
parent = parent.getParent();
}
}
return null;
}
示例9: setCaption
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void setCaption(String caption) {
this.caption = caption;
if (component.isAttached()) {
com.vaadin.ui.Window dialogWindow = asDialogWindow();
if (dialogWindow != null) {
dialogWindow.setCaption(caption);
} else {
TabSheet.Tab tabWindow = asTabWindow();
if (tabWindow != null) {
setTabCaptionAndDescription(tabWindow);
windowManager.getBreadCrumbs((ComponentContainer) tabWindow.getComponent()).update();
} else {
Layout singleModeWindow = asSingleWindow();
if (singleModeWindow != null) {
windowManager.getBreadCrumbs(singleModeWindow).update();
}
}
}
}
if (getWrapper() instanceof TopLevelWindow) {
Page.getCurrent().setTitle(caption);
}
}
示例10: setTabCaptionAndDescription
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
protected void setTabCaptionAndDescription(TabSheet.Tab tabWindow) {
String formattedCaption = formatTabCaption(caption, description);
String formattedDescription = formatTabDescription(caption, description);
tabWindow.setCaption(formattedCaption);
if (!Objects.equals(formattedCaption, formattedDescription)) {
tabWindow.setDescription(formatTabDescription(caption, description));
} else {
tabWindow.setDescription(null);
}
}
示例11: isComponentEnabled
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
/**
* Tests if component enabled and visible and its container enabled.
*
* @param child component
* @return component enabled state
*/
public static boolean isComponentEnabled(Component child) {
if (child.getParent() instanceof TabSheet) {
TabSheet tabSheet = (TabSheet) child.getParent();
TabSheet.Tab tab = tabSheet.getTab(child);
if (!tab.isEnabled()) {
return false;
}
}
return child.isEnabled() && (child.getParent() == null || isComponentEnabled(child.getParent())) &&
isComponentVisible(child);
}
示例12: createTabs
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
private void createTabs() {
tabSheet.removeAllComponents();
if (this.viewDefinition != null) {
for (TabDefinition tabDefinition : HybridbpmUI.getDashboardAPI().getTabDefinitionByView(this.viewDefinition.getId().toString())) {
TabSheet.Tab tab = tabSheet.addTab(new DashboardTab(tabDefinition, this.viewDefinition), tabDefinition.getTitle().getValue(HybridbpmUI.getCurrent().getLocale()), FontAwesome.valueOf(tabDefinition.getIcon()));
tab.setClosable(HybridbpmUI.getDeveloperMode());
}
}
}
示例13: buttonClick
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void buttonClick(final Button.ClickEvent event) {
super.buttonClick(event);
try {
if (event.getButton().getData() != null && event.getButton().getData() instanceof StartProcess) {
StartProcess spd = (StartProcess) event.getButton().getData();
TabSheet.Tab tab = tabSheet.addTab(new TaskLayout(null, spd.getProcessModel().getName(), spd.getTaskName(), true), spd.getProcessModel().getTaskModelByName(spd.getTaskName()).getTitle());
tab.setClosable(true);
tabSheet.setSelectedTab(tab);
}
} catch (Exception ex) {
logger.log(Level.SEVERE, ex.getMessage(), ex);
Notification.show("Error", ex.getMessage(), Notification.Type.ERROR_MESSAGE);
}
}
示例14: buttonClick
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void buttonClick(final Button.ClickEvent event) {
super.buttonClick(event);
try {
if (event.getButton().getData() != null && event.getButton().getData() instanceof Case) {
Case case1 = (Case) event.getButton().getData();
TabSheet.Tab tab = tabSheet.addTab(new CaseLayout(case1.getId().toString()), "Process " + case1.getId().toString());
tab.setClosable(true);
tabSheet.setSelectedTab(tab);
}
} catch (Exception ex) {
logger.log(Level.SEVERE, ex.getMessage(), ex);
Notification.show("Error", ex.getMessage(), Notification.Type.ERROR_MESSAGE);
}
}
示例15: addTab
import com.vaadin.ui.TabSheet; //導入方法依賴的package包/類
@Override
public void addTab(Component component, String tabId) {
TabSheet.Tab tab = tabSheet.addTab(component);
tabSheet.tabIds.put(tabId, tab);
}