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


Java TabSheet類代碼示例

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


TabSheet類屬於com.vaadin.ui包,在下文中一共展示了TabSheet類的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();
    }
  });
}
 
開發者ID:Terracotta-OSS,項目名稱:tinypounder,代碼行數:17,代碼來源:TinyPounderMainUI.java

示例2: createTabSheet

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
private TabSheet createTabSheet(boolean lightTheme, boolean captions, boolean icons) {
    TabSheet tabs = new TabSheet();
    tabs.setPrimaryStyleName(lightTheme ? "md-tabsheet-light" : "md-tabsheet-dark");
    tabs.addStyleName("card" + " " + Paddings.Horizontal.LARGE);
    if (!lightTheme) {
        tabs.addStyleName(MaterialColor.BLUE_500.getBackgroundColorStyle());
    }

    if (captions && icons) {
        tabs.addTab(new CssLayout(), "Item One", MaterialIcons.PHONE);
        tabs.addTab(new CssLayout(), "Item Two", MaterialIcons.FAVORITE);
        tabs.addTab(new CssLayout(), "Item Three", MaterialIcons.NEAR_ME);
    } else if (captions) {
        tabs.addTab(new CssLayout(), "Item One");
        tabs.addTab(new CssLayout(), "Item Two");
        tabs.addTab(new CssLayout(), "Item Three");
    } else if (icons) {
        tabs.addTab(new CssLayout(), null, MaterialIcons.PHONE);
        tabs.addTab(new CssLayout(), null, MaterialIcons.FAVORITE);
        tabs.addTab(new CssLayout(), null, MaterialIcons.NEAR_ME);
    }

    return tabs;
}
 
開發者ID:vaadin,項目名稱:material-theme-fw8,代碼行數:25,代碼來源:TabsView.java

示例3: ScheduleView

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
public ScheduleView() {
    setSizeFull();
    addStyleName("schedule");
    DashboardEventBus.register(this);

    TabSheet tabs = new TabSheet();
    tabs.setSizeFull();
    tabs.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);

    tabs.addComponent(buildCalendarView());
    tabs.addComponent(buildCatalogView());

    addComponent(tabs);

    tray = buildTray();
    addComponent(tray);

    injectMovieCoverStyles();
}
 
開發者ID:mcollovati,項目名稱:vaadin-vertx-samples,代碼行數:20,代碼來源:ScheduleView.java

示例4: createContent

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
@Override
protected Component createContent() {

    VerticalLayout layout = new VerticalLayout();

    layout.addComponent(spellSound);

    title = new Label();
    classe = new LabelField<>("Classe : ");
    classLevel = new LabelField<>("Niveau de classe : ");
    layout.addComponents(title);

    tabs = new TabSheet();

    panel = new HorizontalSplitPanel();
    panel.setSizeFull();
    panel.setCaption(Messages.getInstance().getMessage("spellStep.spell.label"));
    panel.setFirstComponent(tabs);
    layout.addComponent(panel);

    return layout;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:23,代碼來源:SpellChoiceForm.java

示例5: 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();
            }
        }
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:18,代碼來源:WebWindow.java

示例6: 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));
        }
    }
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:17,代碼來源:WebWindow.java

示例7: 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()));
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:23,代碼來源:WebComponentsHelper.java

示例8: buildVerticalLayoutRightPanel

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
@AutoGenerated
private VerticalLayout buildVerticalLayoutRightPanel() {
	// common part: create layout
	verticalLayoutRightPanel = new VerticalLayout();
	verticalLayoutRightPanel.setImmediate(false);
	verticalLayoutRightPanel.setWidth("100.0%");
	verticalLayoutRightPanel.setHeight("-1px");
	verticalLayoutRightPanel.setMargin(true);
	verticalLayoutRightPanel.setSpacing(true);
	
	// horizontalLayoutRightToolbar
	horizontalLayoutRightToolbar = buildHorizontalLayoutRightToolbar();
	verticalLayoutRightPanel.addComponent(horizontalLayoutRightToolbar);
	
	// tabSheet
	tabSheet = new TabSheet();
	tabSheet.setImmediate(true);
	tabSheet.setWidth("100.0%");
	tabSheet.setHeight("-1px");
	verticalLayoutRightPanel.addComponent(tabSheet);
	verticalLayoutRightPanel.setExpandRatio(tabSheet, 1.0f);
	
	return verticalLayoutRightPanel;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:25,代碼來源:PolicyWorkspace.java

示例9: onTabClose

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
@Override
    public void onTabClose(final TabSheet tabsheet, final Component tabContent) {
        if (tabContent instanceof DashboardTab) {
            final DashboardTab dashboardTab = (DashboardTab) tabContent;

            ConfirmDialog.show(UI.getCurrent(), Translate.getMessage("windowTitleConfirm"), "Delete tab?", Translate.getMessage("btnOK"), Translate.getMessage("btnCancel"), new ConfirmDialog.Listener() {

                @Override
                public void onClose(ConfirmDialog dialog) {
                    if (dialog.isConfirmed()) {
                        HybridbpmUI.getDashboardAPI().deleteTabDefinition(dashboardTab.getTabDefinition().getId(), true);

                        tabsheet.removeComponent(tabContent);
                        tabsheet.setSelectedTab(0);
                    } else {
//                                this.close();
                    }
                }
            });
        }
    }
 
開發者ID:hybridbpm,項目名稱:hybridbpm,代碼行數:22,代碼來源:DashboardView.java

示例10: 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);
    }
}
 
開發者ID:hybridbpm,項目名稱:hybridbpm,代碼行數:20,代碼來源:TaskListLayout.java

示例11: 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;
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:20,代碼來源:AddUpdateRolloutWindowLayout.java

示例12: getAllComponents

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
private static List<AbstractField<?>> getAllComponents(final AbstractLayout abstractLayout) {
    final List<AbstractField<?>> components = new ArrayList<>();

    final Iterator<Component> iterate = abstractLayout.iterator();
    while (iterate.hasNext()) {
        final Component c = iterate.next();
        if (c instanceof AbstractLayout) {
            components.addAll(getAllComponents((AbstractLayout) c));
        }

        if (c instanceof AbstractField) {
            components.add((AbstractField<?>) c);
        }

        if (c instanceof FlexibleOptionGroupItemComponent) {
            components.add(((FlexibleOptionGroupItemComponent) c).getOwner());
        }

        if (c instanceof TabSheet) {
            final TabSheet tabSheet = (TabSheet) c;
            components.addAll(getAllComponentsFromTabSheet(tabSheet));
        }
    }
    return components;
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:26,代碼來源:CommonDialogWindow.java

示例13: startDemoApp

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
private void startDemoApp() {
    layout.setSizeFull();
    layout.setMargin(true);
    layout.setSpacing(true);
    addHeader();


    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    layout.addComponent(tabSheet);

    tabSheet.addTab(new ClassicGridTab(),"Classic Grid");
    tabSheet.addTab(new ClassicGridWithDecoratorTab(),"Classic Grid with Decorator");
    tabSheet.addTab(new ComponentGridTab(), "Typed Component Grid");
    tabSheet.addTab(new NotABeanGridWithDecoratorTab(), "Not a bean grid");
    tabSheet.addTab(new ClassicGridWithStaticContainerTab(), "Classic Grid with Static Container");

    layout.setExpandRatio(tabSheet, 1.0f);
    setContent(layout);

}
 
開發者ID:datenhahn,項目名稱:componentrenderer,代碼行數:22,代碼來源:ComponentRendererDemoUI.java

示例14: SqlExplorerTabPanel

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
public SqlExplorerTabPanel() {
	super();
	
	setSizeFull();
       addStyleName(ValoTheme.TABSHEET_FRAMED);
       addStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR);
       addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
       
       setCloseHandler(new CloseHandler() {
		
		private static final long serialVersionUID = 1L;

		@Override
		public void onTabClose(TabSheet tabsheet, Component tabContent) {
			if (tabContent instanceof QueryPanel && ((QueryPanel) tabContent).commitButtonValue) {
				NotifyDialog.show("Cannot Close Tab",
						"You must commit or rollback queries before closing this tab.",
						null, Type.WARNING_MESSAGE);
			} else {
				tabsheet.removeComponent(tabContent);
			}
		}
       });
}
 
開發者ID:JumpMind,項目名稱:sqlexplorer-vaadin,代碼行數:25,代碼來源:SqlExplorerTabPanel.java

示例15: buildHorizontalLayout_3

import com.vaadin.ui.TabSheet; //導入依賴的package包/類
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_3() {
	// common part: create layout
	horizontalLayout_3 = new HorizontalLayout();
	horizontalLayout_3.setImmediate(false);
	horizontalLayout_3.setWidth("100.0%");
	horizontalLayout_3.setHeight("100.0%");
	horizontalLayout_3.setMargin(false);
	
	// tabSheet_1
	tabSheet_1 = new TabSheet();
	tabSheet_1.setImmediate(false);
	tabSheet_1.setWidth("100.0%");
	tabSheet_1.setHeight("100.0%");
	horizontalLayout_3.addComponent(tabSheet_1);
	
	return horizontalLayout_3;
}
 
開發者ID:alenca,項目名稱:zklogtool,代碼行數:19,代碼來源:MainLayout.java


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