com.vaadin.ui.TabSheet.Tab Java Examples

The following examples show how to use com.vaadin.ui.TabSheet.Tab. 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: 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 #2
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 #3
Source File: BallotChartDataManagerImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Override
public void createChart(final Tab tab,final AbstractOrderedLayout content,final List<ViewRiksdagenVoteDataBallotPartySummary> partyList) {
	final DataSeries dataSeries = new DataSeries();

	final Series series = new Series();

	series.addSeries(new XYseries().setLabel("Yes"));
	series.addSeries(new XYseries().setLabel("No"));
	series.addSeries(new XYseries().setLabel("Abstain"));
	series.addSeries(new XYseries().setLabel("Absent"));

	String caption=null;
	for (final ViewRiksdagenVoteDataBallotPartySummary viewRiksdagenVoteDataBallotPartySummary : partyList) {
		if (caption == null) {
			caption = "Party Summary : " + viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getIssue() + " " + viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getConcern();
			content.setCaption(caption);
			tab.setCaption(caption);
		}

		dataSeries.newSeries()
		.add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()), viewRiksdagenVoteDataBallotPartySummary.getPartyYesVotes())
		.add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()),viewRiksdagenVoteDataBallotPartySummary.getPartyNoVotes())
		.add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()),viewRiksdagenVoteDataBallotPartySummary.getPartyAbstainVotes())
		.add(getPartyName(viewRiksdagenVoteDataBallotPartySummary.getEmbeddedId().getParty()),viewRiksdagenVoteDataBallotPartySummary.getPartyAbsentVotes());
	}


	addChart(content,caption + " ( 4 circles Yes/No/Abstain/Absent votes by party )", new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsDonoutChartWithSeries(series)).show(), true);
}
 
Example #4
Source File: BallotChartDataManagerImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Override
public void createChart(final Tab tab,final AbstractOrderedLayout content,final ViewRiksdagenVoteDataBallotSummary viewRiksdagenVoteDataBallotSummary) {
	final DataSeries dataSeries = new DataSeries();

	dataSeries.newSeries().add("Yes", viewRiksdagenVoteDataBallotSummary.getYesVotes());
	dataSeries.newSeries().add("No", viewRiksdagenVoteDataBallotSummary.getNoVotes());
	dataSeries.newSeries().add("Abstain", viewRiksdagenVoteDataBallotSummary.getAbstainVotes());
	dataSeries.newSeries().add("Absent", viewRiksdagenVoteDataBallotSummary.getAbsentVotes());

	final String caption = "Summary : " +viewRiksdagenVoteDataBallotSummary.getEmbeddedId().getIssue() + " " + viewRiksdagenVoteDataBallotSummary.getEmbeddedId().getConcern();
	tab.setCaption(caption);

	addChart(content,caption, new DCharts().setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsDonoutChart()).show(), true);
}
 
Example #5
Source File: PolicyEditor.java    From XACML with MIT License 4 votes vote down vote up
public void setTab(Tab tab) {
	this.tab = tab;
	this.setupCaption();
}
 
Example #6
Source File: BallotChartDataManager.java    From cia with Apache License 2.0 2 votes vote down vote up
/**
 * Creates the chart.
 *
 * @param tab
 *            the tab
 * @param content
 *            the content
 * @param partyList
 *            the party list
 */
void createChart(Tab tab,AbstractOrderedLayout content,List<ViewRiksdagenVoteDataBallotPartySummary> partyList);
 
Example #7
Source File: BallotChartDataManager.java    From cia with Apache License 2.0 2 votes vote down vote up
/**
 * Creates the chart.
 *
 * @param tab
 *            the tab
 * @param content
 *            the content
 * @param viewRiksdagenVoteDataBallotSummary
 *            the view riksdagen vote data ballot summary
 */
void createChart(Tab tab,AbstractOrderedLayout content,ViewRiksdagenVoteDataBallotSummary viewRiksdagenVoteDataBallotSummary);