本文整理汇总了Java中com.vaadin.ui.TabSheet.Tab类的典型用法代码示例。如果您正苦于以下问题:Java Tab类的具体用法?Java Tab怎么用?Java Tab使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Tab类属于com.vaadin.ui.TabSheet包,在下文中一共展示了Tab类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTabByOrganization
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
private Tab getTabByOrganization(Organization organization) {
@SuppressWarnings("rawtypes")
Iterator itr = tabSheetOrganization.getComponentIterator();
while(itr.hasNext()) {
Component cmp = (Component) itr.next();
Tree treeSelected = (Tree) cmp;
Organization organizationSelected = (Organization)treeSelected.getData();
if (organizationSelected.equals(organization))
return tabSheetOrganization.getTab(cmp);
}
return null;
}
示例2: addResultsTab
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
public void addResultsTab(Component resultComponent, String title, Resource icon, int position) {
Tab tab = resultsTabs.addTab(resultComponent, title, icon, position);
tab.setClosable(true);
resultsTabs.setSelectedTab(tab.getComponent());
if (errorTab != null) {
resultsTabs.removeTab(errorTab);
errorTab = null;
}
if (maxNumberOfResultTabs > 0 && resultsTabs.getComponentCount() > maxNumberOfResultTabs) {
resultsTabs.removeTab(resultsTabs.getTab(resultsTabs.getComponentCount() - 1));
}
if (icon == FontAwesome.STOP) {
errorTab = tab;
}
}
示例3: onClick
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
@Override
public void onClick(UIApplication<?> application) {
if (IUnoVaadinApplication.class.isAssignableFrom(application.getConcreteApplicationClass())) {
final IUnoVaadinApplication vaadinApp = (IUnoVaadinApplication) application.getConcreteApplication();
@SuppressWarnings("unchecked")
final Component windowComponent = vaadinComponentManager.getComponent(this,
(UIApplication<IUnoVaadinApplication>) application);
final Tab tab = vaadinApp.getMainTabSheet().addTab(windowComponent, "Tasks");
tab.setClosable(true);
vaadinApp.getMainTabSheet().addListener(new ComponentDetachListener() {
private static final long serialVersionUID = 703653779132116478L;
@Override
public void componentDetachedFromContainer(ComponentDetachEvent event) {
if (event.getDetachedComponent() == windowComponent) {
vaadinComponentManager.disposeComponent(UsertaskNotification.this);
vaadinApp.getMainTabSheet().removeListener(this);
}
}
});
vaadinApp.getMainTabSheet().setSelectedTab(tab);
} else {
application.showMessage(MessageType.WARNING, "User task graphical user interface not ready for actual user interface");
}
}
示例4: buildComponents
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
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);
}
}
});
}
示例5: buildComponents
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
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());
}
}
});
}
示例6: buildComponents
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
private void buildComponents() {
activityTabs.addTab(constructCalendarView(), "calendar",
UserUIContext.getMessage(ActivityI18nEnum.TAB_CALENDAR_TITLE),
new ExternalResource(StorageUtils.generateAssetRelativeLink("icons/22/crm/calendar.png")));
activityTabs.addTab(constructActivityListView(), "activities",
UserUIContext.getMessage(ActivityI18nEnum.TAB_ACTIVITY_TITLE),
new ExternalResource(StorageUtils.generateAssetRelativeLink("icons/22/crm/activitylist.png")));
activityTabs.addSelectedTabChangeListener(selectedTabChangeEvent -> {
Tab tab = ((VerticalTabsheet) selectedTabChangeEvent.getSource()).getSelectedTab();
String caption = tab.getCaption();
if (UserUIContext.getMessage(ActivityI18nEnum.TAB_CALENDAR_TITLE).equals(caption)) {
calendarPresenter.go(ActivityRootView.this, new ActivityScreenData.GotoCalendar());
} else if (UserUIContext.getMessage(ActivityI18nEnum.TAB_ACTIVITY_TITLE).equals(caption)) {
ActivitySearchCriteria criteria = new ActivitySearchCriteria();
criteria.setSaccountid(new NumberSearchField(AppUI.getAccountId()));
eventPresenter.go(ActivityRootView.this, new ActivityScreenData.GotoActivityList(criteria));
}
});
}
示例7: selectTab
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
public Component selectTab(String viewId) {
Tab tab = compMap.get(viewId);
Button btn = getButtonById(viewId);
if (btn != null) {
selectedButton = btn;
clearTabSelection(true);
selectedButton.addStyleName(TAB_SELECTED_STYLENAME);
selectedComp = tab;
tabContainer.removeAllComponents();
Component tabComponent = tab.getComponent();
tabContainer.addComponent(tabComponent);
tabContainer.setExpandRatio(tabComponent, 1.0f);
return tabComponent;
} else {
return null;
}
}
示例8: setCompositionRoot
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
@Override
protected void setCompositionRoot(Component compositionRoot) {
if (mainTab != null && mainTab.getComponent().equals(compositionRoot)) {
// Already set, just update selected tab index.
tabSheet.setSelectedTab(0);
return;
}
final Tab newTab = tabSheet.addTab(compositionRoot, this.ctx.tr(DPU_CONFIGURATION_TAB_NAME));
// Remove old one if set, and set new as a master tab (tab with DPU's configuration).
if (mainTab != null) {
tabSheet.removeTab(mainTab);
}
mainTab = newTab;
tabSheet.setTabPosition(newTab, 0);
tabSheet.setSelectedTab(0);
}
示例9: wrapByUriFragment
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
/**
* Wrap the given component into a component identified by the given uri
* fragment.
* <p>
* 'tabsheet' wraps it to Tabsheet component.
* <p>
* Returns by default the component itself.
*
* @param uriragment
* @param component
* @return
*/
public static Component wrapByUriFragment(String uriragment, Gantt gantt) {
if (uriragment == null) {
return gantt;
}
if (uriragment.contains("tabsheet")) {
TabSheet tabsheet = new TabSheet();
tabsheet.setSizeFull();
Tab tab = tabsheet.addTab(gantt);
tab.setCaption("Tabsheet test");
return tabsheet;
} else if (uriragment.startsWith("grid")) {
return new GridGanttLayout(gantt);
} else if (uriragment.startsWith("treegrid")) {
return new TreeGridGanttLayout(gantt);
}
return gantt;
}
示例10: setTabSheet
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
public void setTabSheet(TabSheet tabSheet) {
this.tabSheet = tabSheet;
// get userOrganizationCollectionField from Tab component
Tab userOrganization = tabSheet.getTab(TAB_USER_ORGANIZATION);
VerticalLayout userOrganizationLayout = (VerticalLayout)userOrganization.getComponent();
userOrganizationCollectionField = (UserOrganizationCollectionField) userOrganizationLayout.getComponent(0);
Tab userApplication = tabSheet.getTab(TAB_USER_APPLICATION);
VerticalLayout userApplicationLayout = (VerticalLayout)userApplication.getComponent();
userApplicationCollectionField = (UserApplicationCollectionField) userApplicationLayout.getComponent(0);
Tab userRole = tabSheet.getTab(TAB_USER_ROLE);
VerticalLayout userRoleLayout = (VerticalLayout)userRole.getComponent();
userRoleCollectionField = (UserRoleCollectionField) userRoleLayout.getComponent(0);
}
示例11: addModule
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
@Override
public void addModule(String id, String name, IViewContainer viewComponent, boolean closeable, Resource icon, LOCATION location) {
if (tabSheetModule.getComponentCount() == 0)
tabSheetModule.hideTabs(false);
// add module to the list
modules.put(id, viewComponent);
// create new tab for the current module
Tab tab = tabSheetModule.addTab((Component) viewComponent, name, icon);
// set closable flag
tab.setClosable(closeable);
tabSheetModule.setSelectedTab((Component) viewComponent);
}
示例12: Tabsheet
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
public Tabsheet() {
TabBarView tabBarView = new TabBarView();
tabBarView.addTab(getTable(), "First", new ThemeResource(
"../runo/icons/64/folder.png"));
tabBarView.addTab(getDateSelector(), "Other", new ThemeResource(
"../runo/icons/64/document.png"));
tabBarView.addTab(getComboBox(), "Third", new ThemeResource(
"../runo/icons/64/document-pdf.png"));
Tab tab = tabBarView.addTab(getFields(), "4th", new ThemeResource(
"../runo/icons/64/email.png"));
tabBarView.setSelectedTab(tab);
makeSmallTabletSize(tabBarView);
addComponent(tabBarView);
}
示例13: createResultTab
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
private VerticalLayout createResultTab(String caption) {
final VerticalLayout vl = new VerticalLayout();
vl.setMargin(true);
final Tab t = tabSheet.addTab(vl, caption);
t.setClosable(true);
tabSheet.setSelectedTab(t);
return vl;
}
示例14: openModuleTab
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
private void openModuleTab(ModuleLinkButton moduleLinkButton) {
Tab tab = getModuleTab(moduleLinkButton.getModule());
if (tab == null) {
switch (moduleLinkButton.getModule().getType()) {
case FORM:
tab = tabSheet.addTab(new FormEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
case CONNECTOR:
tab = tabSheet.addTab(new ConnectorEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
case DATA:
tab = tabSheet.addTab(new DataEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
case PROCESS:
tab = tabSheet.addTab(new ProcessEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
case CHART:
tab = tabSheet.addTab(new ChartEditor(moduleLinkButton.getModule()), moduleLinkButton.getCaption());
tab.setClosable(true);
break;
}
}
tabSheet.setSelectedTab(tab);
}
示例15: openTab
import com.vaadin.ui.TabSheet.Tab; //导入依赖的package包/类
public void openTab(Component component, Module Module) {
Tab tab = getTestTab(Module);
if (tab != null) {
tabSheet.removeTab(tab);
}
tab = tabSheet.addTab(component, Module.getName());
tab.setClosable(true);
tabSheet.setSelectedTab(tab);
}