当前位置: 首页>>代码示例>>Java>>正文


Java Tab类代码示例

本文整理汇总了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;
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:17,代码来源:OrganizationView.java

示例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;
    }
}
 
开发者ID:JumpMind,项目名称:sqlexplorer-vaadin,代码行数:21,代码来源:QueryPanel.java

示例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");
	}
}
 
开发者ID:frincon,项目名称:openeos,代码行数:27,代码来源:UsertaskNotification.java

示例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);
            }
        }
    });

}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:24,代码来源:UserPermissionManagementViewImpl.java

示例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());
            }

        }
    });
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:25,代码来源:CrmSettingContainer.java

示例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));
        }
    });
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:23,代码来源:ActivityRootView.java

示例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;
    }
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:18,代码来源:VerticalTabsheet.java

示例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);
}
 
开发者ID:UnifiedViews,项目名称:Plugin-DevEnv,代码行数:17,代码来源:AbstractDialog.java

示例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;
}
 
开发者ID:tltv,项目名称:gantt,代码行数:33,代码来源:UriFragmentWrapperFactory.java

示例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);	
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:17,代码来源:UserField.java

示例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);
			
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:18,代码来源:WorkbenchPanel.java

示例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);

}
 
开发者ID:vaadin,项目名称:touchkit,代码行数:18,代码来源:Tabsheet.java

示例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;
}
 
开发者ID:KeDevServices,项目名称:vaadin-with-rxjava,代码行数:11,代码来源:ProjectUI.java

示例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);
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:30,代码来源:DevelopmentView.java

示例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);
}
 
开发者ID:hybridbpm,项目名称:hybridbpm,代码行数:10,代码来源:DevelopmentView.java


注:本文中的com.vaadin.ui.TabSheet.Tab类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。