com.vaadin.ui.TabSheet Java Examples

The following examples show how to use com.vaadin.ui.TabSheet. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebTabWindow.java    From cuba with Apache License 2.0 6 votes vote down vote up
protected void updateCaptionAndDescription() {
    TabSheet.Tab tabWindow = findTab();
    if (tabWindow != null) {
        String tabCaption = formatTabCaption();
        String tabDescription = formatTabDescription();

        tabWindow.setCaption(tabCaption);

        if (!Objects.equals(tabCaption, tabDescription)) {
            tabWindow.setDescription(tabDescription);
        } else {
            tabWindow.setDescription(null);
        }

        ((TabWindowContainer) tabWindow.getComponent()).getBreadCrumbs().update();
    } else {
        TabWindowContainer layout = (TabWindowContainer) asSingleWindow();
        if (layout != null) {
            layout.getBreadCrumbs().update();
        }
    }
}
 
Example #2
Source File: WebComponentsHelper.java    From cuba with Apache License 2.0 6 votes vote down vote up
/**
 * 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()));
}
 
Example #3
Source File: UriFragmentWrapperFactory.java    From gantt with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #4
Source File: PolicyWorkspace.java    From XACML with MIT License 6 votes vote down vote up
@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;
}
 
Example #5
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
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;
}
 
Example #6
Source File: CommonDialogWindow.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
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;
}
 
Example #7
Source File: WebTabWindow.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void setCloseable(boolean closeable) {
    super.setCloseable(closeable);

    if (component.isAttached()) {
        TabSheet.Tab tabWindow = findTab();
        if (tabWindow != null) {
            tabWindow.setClosable(closeable);
        }
    }
}
 
Example #8
Source File: ReportView.java    From chipster with MIT License 5 votes vote down vote up
public ReportView(ChipsterAdminUI app) {
	
	super(app, UPDATE_WAIT);
				
	this.addComponent(getToolbar());
	
	this.addComponent(super.getProggressIndicator());

	tabSheet = new TabSheet();
	
	dataSource = new ReportDataSource(app.getEndpoint());
			
	tabSheet.setSizeFull();
	
       this.addComponent(tabSheet);        
       this.setExpandRatio(tabSheet, 1);
	this.setSizeFull();
	
	filebrokerLabel = createReportLabel("waiting for status report...");
	compLabel = createReportLabel("waiting for status report...");
	jobmanagerLabel = createReportLabel("waiting for status report...");
	
	filebrokerLayout.addComponent(filebrokerLabel);
	tabSheet.addTab(filebrokerLayout, "Filebroker");
	compLayout.addComponent(compLabel);
	tabSheet.addTab(compLayout, "Comp");
	jobmanagerLayout.addComponent(jobmanagerLabel);
	tabSheet.addTab(jobmanagerLayout, "Jobmanager");
	
	tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {

		@Override
		public void selectedTabChange(SelectedTabChangeEvent e) {
			update();
		}
	});
}
 
Example #9
Source File: StatView.java    From chipster with MIT License 5 votes vote down vote up
public StatView(ChipsterAdminUI app) {
	
	super(app, TIMEOUT);
				
	this.addComponent(getToolbar());
	this.addComponent(super.getProggressIndicator());

	tabSheet = new TabSheet();
	tabSheet.setSizeFull();
	
       this.addComponent(tabSheet);        
       this.setExpandRatio(tabSheet, 1);
	this.setSizeFull();
	
       tabSheet.addTab(monthlyStats, "Monthly statistics");        
       tabSheet.addTab(yearlyStats, "Yearly statistics");
       tabSheet.addTab(toolUsage, "Tools usage (1 year)");
       tabSheet.addTab(topUsers, "Top users (1 year)");
       tabSheet.addTab(toolFails, "Tool fails (1 year)");
       tabSheet.addTab(moduleUsage, "Module job counts (beta)");
       
	tabSheet.addSelectedTabChangeListener(new SelectedTabChangeListener() {
		@Override
		public void selectedTabChange(SelectedTabChangeEvent e) {				
			update();
		}
	});
}
 
Example #10
Source File: MainView.java    From usergrid with Apache License 2.0 5 votes vote down vote up
private VerticalLayout addTabSheet() {
    VerticalLayout tabLayout = new VerticalLayout();
    TabSheet tabSheet = new TabSheet();
    tabSheet.setHeight( "100%" );

    tabSheetManager = new TabSheetManager( tabSheet );
    tabLayout.addComponent( tabSheet );

    return tabLayout;
}
 
Example #11
Source File: XacmlAdminConsole.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("100%");
	mainLayout.setHeight("100%");
	mainLayout.setMargin(true);
	
	// top-level component properties
	setWidth("100.0%");
	setHeight("100.0%");
	
	// horizontalLayout_1
	horizontalLayout_1 = buildHorizontalLayout_1();
	mainLayout.addComponent(horizontalLayout_1);
	
	// tabSheet
	tabSheet = new TabSheet();
	tabSheet.setImmediate(false);
	tabSheet.setWidth("100.0%");
	tabSheet.setHeight("100.0%");
	mainLayout.addComponent(tabSheet);
	mainLayout.setExpandRatio(tabSheet, 1.0f);
	
	// labelCopyright
	labelCopyright = new Label();
	labelCopyright.setImmediate(false);
	labelCopyright.setWidth("-1px");
	labelCopyright.setHeight("40px");
	labelCopyright
			.setValue("<center>&copy; 2013-2014 AT&T Intellectual Property. All rights reserved.</center>");
	mainLayout.addComponent(labelCopyright);
	mainLayout.setComponentAlignment(labelCopyright, new Alignment(48));
	
	return mainLayout;
}
 
Example #12
Source File: ServiceDesc.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setWidth("100%");
    setHeight("100%");
    setCaption(ViewProperties.getCaption("panel.serviceDesc"));
    addStyleName("service-desc-panel");
    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(false);
    layout.setSpacing(false);
    layout.addStyleName("service-desc-layout");

    tab = new TabSheet();
    tab.addStyleName(Reindeer.TABSHEET_BORDERLESS);
    tab.setWidth("100%");
    tab.setHeight("100%");
    addComponent(tab);

    // 基本情報タブ
    serviceDescBasic = new ServiceDescBasic(sender);
    tab.addTab(serviceDescBasic, ViewProperties.getCaption("tab.serviceDescBasic"), Icons.BASIC.resource());

    // 詳細情報タブ
    serviceDescDetail = new ServiceDescDetail();
    tab.addTab(serviceDescDetail, ViewProperties.getCaption("tab.serviceDescDetail"), Icons.DETAIL.resource());

    tab.addListener(new SelectedTabChangeListener() {
        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            ServiceDesc.this.selectedTabChange(event);
        }
    });
}
 
Example #13
Source File: ServerDesc.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setWidth("100%");
    setHeight("100%");
    setCaption(ViewProperties.getCaption("panel.serverDesc"));
    addStyleName(Reindeer.PANEL_LIGHT);
    addStyleName("server-desc-panel");

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(false);
    layout.setSpacing(false);
    layout.addStyleName("server-desc-layout");

    tab = new TabSheet();
    tab.addStyleName(Reindeer.TABSHEET_BORDERLESS);
    tab.setWidth("100%");
    tab.setHeight("100%");
    addComponent(tab);

    // 基本情報タブ
    serverDescBasic = new ServerDescBasic(sender);
    tab.addTab(serverDescBasic, ViewProperties.getCaption("tab.serverDescBasic"), Icons.BASIC.resource());

    // 詳細情報タブ
    serverDescDetail = new ServerDescDetail();
    tab.addTab(serverDescDetail, ViewProperties.getCaption("tab.serverDescDetail"), Icons.DETAIL.resource());

    tab.addListener(new SelectedTabChangeListener() {
        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            ServerDesc.this.selectedTabChange(event);
        }
    });
}
 
Example #14
Source File: LoadBalancerDesc.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setWidth("100%");
    setHeight("100%");
    setCaption(ViewProperties.getCaption("panel.loadBalancerDesc"));
    addStyleName("loadbalancer-desc-panel");
    addStyleName(Reindeer.PANEL_LIGHT);

    VerticalLayout layout = (VerticalLayout) getContent();
    layout.setWidth("100%");
    layout.setHeight("100%");
    layout.setMargin(false);
    layout.setSpacing(false);
    layout.addStyleName("loadbalancer-desc-layout");

    tab = new TabSheet();
    tab.addStyleName(Reindeer.TABSHEET_BORDERLESS);
    tab.setWidth("100%");
    tab.setHeight("100%");
    addComponent(tab);

    // 基本情報
    loadBalancerDescBasic = new LoadBalancerDescBasic(sender);
    tab.addTab(loadBalancerDescBasic, ViewProperties.getCaption("tab.loadBalancerDescBasic"),
            Icons.BASIC.resource());

    // 詳細情報
    loadBalancerDescServer = new LoadBalancerDescServer(sender);
    tab.addTab(loadBalancerDescServer, ViewProperties.getCaption("tab.loadBalancerDescServer"),
            Icons.DETAIL.resource());

    tab.addListener(TabSheet.SelectedTabChangeEvent.class, this, "selectedTabChange");
}
 
Example #15
Source File: AbstractPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the page visit history.
 *
 * @param pageName
 *            the page name
 * @param pageId
 *            the page id
 * @param panelContent
 *            the panel content
 */
protected final void createPageVisitHistory(final String pageName, final String pageId,
		final VerticalLayout panelContent) {

	final TabSheet tabsheet = new TabSheet();
	tabsheet.setWidth(100, Unit.PERCENTAGE);
	tabsheet.setHeight(100, Unit.PERCENTAGE);

	panelContent.addComponent(tabsheet);
	panelContent.setExpandRatio(tabsheet, ContentRatio.LARGE);

	final HorizontalLayout tabContentPageItemRankHistory = new HorizontalLayout();
	tabContentPageItemRankHistory.setWidth(100, Unit.PERCENTAGE);
	tabContentPageItemRankHistory.setHeight(100, Unit.PERCENTAGE);
	final Tab tabPageItemRankHistory = tabsheet.addTab(tabContentPageItemRankHistory);

	tabPageItemRankHistory.setCaption(CURRENT_PAGE_VISIT_HISTORY);
	adminChartDataManager.createApplicationActionEventPageElementDailySummaryChart(tabContentPageItemRankHistory,
			pageName, pageId);

	final HorizontalLayout tabContentPageModeSummary = new HorizontalLayout();
	tabContentPageModeSummary.setWidth(100, Unit.PERCENTAGE);
	tabContentPageModeSummary.setHeight(100, Unit.PERCENTAGE);
	final Tab tabPageModeSummary = tabsheet.addTab(tabContentPageModeSummary);
	tabPageModeSummary.setCaption(GENERAL_PAGE_MODE_PAGE_VISIT);

	adminChartDataManager.createApplicationActionEventPageModeDailySummaryChart(tabContentPageModeSummary,
			pageName);

}
 
Example #16
Source File: DemoUI.java    From GridExtensionPack with Apache License 2.0 5 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
    TabSheet tabSheet = new TabSheet();
    tabSheet.addTab(new DemoContentLayout(), "main demo");
    tabSheet.addTab(new SidebarMenuExtensionLayout(), "sidebar extension demo");
    tabSheet.addTab(new HeaderWrapExtensionLayout(), "header wrap demo");
    tabSheet.setSizeFull();
    setContent(tabSheet);
}
 
Example #17
Source File: CommonDialogWindow.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private static List<AbstractField<?>> getAllComponentsFromTabSheet(final TabSheet tabSheet) {
    final List<AbstractField<?>> components = new ArrayList<>();
    for (final Iterator<Component> i = tabSheet.iterator(); i.hasNext();) {
        final Component component = i.next();
        if (component instanceof AbstractLayout) {
            components.addAll(getAllComponents((AbstractLayout) component));
        }
    }
    return components;
}
 
Example #18
Source File: WebComponentsHelper.java    From cuba with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #19
Source File: WebTabWindow.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Nullable
protected TabSheet.Tab findTab() {
    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;
}
 
Example #20
Source File: WebTabWindow.java    From cuba with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #21
Source File: WebTabWindow.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void setIcon(String icon) {
    super.setIcon(icon);

    if (component.isAttached()) {
        TabSheet.Tab tabWindow = findTab();
        if (tabWindow != null) {
            IconResolver iconResolver = beanLocator.get(IconResolver.NAME);
            tabWindow.setIcon(iconResolver.getIconResource(icon));
        }
    }
}
 
Example #22
Source File: AbstractTableDetailsLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
protected TabSheet getDetailsTab() {
    return detailsTab;
}
 
Example #23
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private static int getPositionOfSelectedTab(final TabSheet tabSheet) {
    return tabSheet.getTabPosition(tabSheet.getTab(tabSheet.getSelectedTab()));
}
 
Example #24
Source File: DefaultTabSheetDropHandler.java    From cuba with Apache License 2.0 4 votes vote down vote up
@Override
public Class<TabSheet> getTargetLayoutType() {
    return TabSheet.class;
}
 
Example #25
Source File: CubaColorPickerPopup.java    From cuba with Apache License 2.0 4 votes vote down vote up
public void setSwatchesTabCaption(String caption) {
    ((TabSheet) swatchesTab.getParent()).getTab(swatchesTab).setCaption(caption);
}
 
Example #26
Source File: TabSheetManager.java    From usergrid with Apache License 2.0 4 votes vote down vote up
TabSheetManager( TabSheet tabSheet ) {
    this.tabSheet = tabSheet;
}
 
Example #27
Source File: SPUIComponentProvider.java    From hawkbit with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Get Tabsheet.
 *
 * @return SPUITabSheet
 */
public static TabSheet getDetailsTabSheet() {
    return new SPUITabSheet();
}
 
Example #28
Source File: XacmlAdminConsole.java    From XACML with MIT License votes vote down vote up
public TabSheet getTabSheet() { return tabSheet;}