use of com.vaadin.ui.TabSheet in project cuba by cuba-platform.
the class WebComponentsHelper method isComponentVisible.
/**
* 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()));
}
use of com.vaadin.ui.TabSheet in project cuba by cuba-platform.
the class WebComponentsHelper method isComponentEnabled.
/**
* 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);
}
use of com.vaadin.ui.TabSheet in project VaadinUtils by rlsutton1.
the class DashBoardView method dashboardManagement.
private Component dashboardManagement() {
VerticalLayout layout = new VerticalLayout();
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.setWidth("100%");
Button newDashboard = new Button(FontAwesome.PLUS);
newDashboard.setDescription("New Dashboard");
newDashboard.setStyleName(ValoTheme.BUTTON_ICON_ONLY);
newDashboard.addStyleName(ValoTheme.BUTTON_FRIENDLY);
Button rename = createRenameButton();
Button copy = new Button(FontAwesome.COPY);
copy.setDescription("Copy");
copy.setStyleName(ValoTheme.BUTTON_ICON_ONLY);
Button share = new Button(FontAwesome.SHARE);
share.setDescription("Share");
share.setStyleName(ValoTheme.BUTTON_ICON_ONLY);
Button defaultButton = new Button(FontAwesome.STAR);
defaultButton.setDescription("Default");
defaultButton.setStyleName(ValoTheme.BUTTON_ICON_ONLY);
newDashboard.addClickListener(new ClickListener() {
private static final long serialVersionUID = -609738416141590613L;
@Override
public void buttonClick(ClickEvent event) {
createDashboard(null);
}
});
buttonLayout.addComponent(newDashboard);
buttonLayout.addComponent(rename);
buttonLayout.addComponent(createMakeDefaultButton());
// buttonLayout.addComponent(copy);
// buttonLayout.addComponent(share);
createDashboardSelector();
buttonLayout.addComponent(createDeleteButton());
if (canUserShareDashboards()) {
buttonLayout.addComponent(createShareButton());
}
TabSheet selectorHolder = new TabSheet();
selectorHolder.addTab(layout, "Dashboards");
layout.addComponent(dashBoardSelector);
layout.setExpandRatio(dashBoardSelector, 1);
layout.addComponent(buttonLayout);
// layout.setSizeFull();
return selectorHolder;
}
use of com.vaadin.ui.TabSheet in project cia by Hack23.
the class BallotChartsPageModContentFactoryImpl method createContent.
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
final VerticalLayout panelContent = createPanelContent();
final String pageId = getPageId(parameters);
final DataContainer<ViewRiksdagenVoteDataBallotSummary, RiksdagenVoteDataBallotEmbeddedId> dataContainer = getApplicationManager().getDataContainer(ViewRiksdagenVoteDataBallotSummary.class);
final DataContainer<ViewRiksdagenVoteDataBallotPartySummary, RiksdagenVoteDataBallotPartyEmbeddedId> dataPartyContainer = getApplicationManager().getDataContainer(ViewRiksdagenVoteDataBallotPartySummary.class);
final List<ViewRiksdagenVoteDataBallotSummary> ballots = dataContainer.findListByEmbeddedProperty(ViewRiksdagenVoteDataBallotSummary.class, ViewRiksdagenVoteDataBallotSummary_.embeddedId, RiksdagenVoteDataBallotEmbeddedId.class, RiksdagenVoteDataBallotEmbeddedId_.ballotId, pageId);
final List<ViewRiksdagenVoteDataBallotPartySummary> partyBallotList = dataPartyContainer.findListByEmbeddedProperty(ViewRiksdagenVoteDataBallotPartySummary.class, ViewRiksdagenVoteDataBallotPartySummary_.embeddedId, RiksdagenVoteDataBallotPartyEmbeddedId.class, RiksdagenVoteDataBallotPartyEmbeddedId_.ballotId, pageId);
if (!ballots.isEmpty()) {
getBallotMenuItemFactory().createBallotMenuBar(menuBar, pageId);
LabelFactory.createHeader2Label(panelContent, CHARTS);
final TabSheet tabsheet = new TabSheet();
tabsheet.setWidth(100, Unit.PERCENTAGE);
tabsheet.setHeight(100, Unit.PERCENTAGE);
panelContent.addComponent(tabsheet);
panelContent.setExpandRatio(tabsheet, ContentRatio.LARGE);
Collections.sort(ballots, (Comparator<ViewRiksdagenVoteDataBallotSummary>) (o1, o2) -> (o1.getEmbeddedId().getIssue() + o2.getEmbeddedId().getConcern()).compareTo(o1.getEmbeddedId().getIssue() + o2.getEmbeddedId().getConcern()));
for (final ViewRiksdagenVoteDataBallotSummary viewRiksdagenVoteDataBallotSummary : ballots) {
final HorizontalLayout tabContent = new HorizontalLayout();
tabContent.setWidth(100, Unit.PERCENTAGE);
tabContent.setHeight(100, Unit.PERCENTAGE);
final Tab tab = tabsheet.addTab(tabContent);
ballotChartDataManager.createChart(tab, tabContent, viewRiksdagenVoteDataBallotSummary);
}
final Map<String, List<ViewRiksdagenVoteDataBallotPartySummary>> concernIssuePartyBallotSummaryMap = createIssueConcernMap(partyBallotList);
for (final List<ViewRiksdagenVoteDataBallotPartySummary> partyBallotSummaryList : concernIssuePartyBallotSummaryMap.values()) {
final HorizontalLayout tabContent = new HorizontalLayout();
tabContent.setWidth(100, Unit.PERCENTAGE);
tabContent.setHeight(100, Unit.PERCENTAGE);
final Tab tab = tabsheet.addTab(tabContent);
ballotChartDataManager.createChart(tab, tabContent, partyBallotSummaryList);
}
panel.setCaption(new StringBuilder().append(NAME).append("::").append(BALLOT).append(pageId).toString());
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_BALLOT_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId);
}
return panelContent;
}
Aggregations