List of usage examples for com.vaadin.ui Panel setCaption
@Override public void setCaption(String caption)
From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingCurrentMinistriesChartsPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override//from ww w.j av a 2 s . c om public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); final String pageId = getPageId(parameters); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); chartDataManager.createChartPanel(chartLayout, dataSeriesFactory.createMinistryChartTimeSeriesCurrent(), "Current Ministies, by headcount"); panelContent.addComponent(chartLayout); panel.setCaption(CHARTS + parameters); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingCurrentPartiesChartsPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override//from ww w .j a va 2 s. c om public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); final String pageId = getPageId(parameters); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); chartDataManager.createChartPanel(chartLayout, dataSeriesFactory.createChartTimeSeriesCurrentGovernmentByParty(), "Current Parties, headcount"); panelContent.addComponent(chartLayout); panel.setCaption(CHARTS + parameters); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingDataGridPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override//from www . java2 s.c o m public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); final String pageId = getPageId(parameters); final DataContainer<ViewRiksdagenMinistry, String> dataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenMinistry.class); final BeanItemContainer<ViewRiksdagenMinistry> dataSource = new BeanItemContainer<>( ViewRiksdagenMinistry.class, dataContainer.getAllOrderBy(ViewRiksdagenMinistry_.currentMemberSize)); getGridFactory().createBasicBeanItemGrid(panelContent, dataSource, "Ministries", new String[] { "nameId", "totalDaysServed", "currentMemberSize", "totalAssignments", "firstAssignmentDate", "lastAssignmentDate", "active" }, new String[] { "active" }, new PageItemPropertyClickListener(UserViews.MINISTRY_VIEW_NAME, "nameId"), null, null); panel.setCaption(DATAGRID + parameters); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingGovernmentBodiesPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override//from ww w.j av a 2 s . c o m public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); final String pageId = getPageId(parameters); panel.setCaption(GOVERNMENT_BODIES + parameters); governmentBodyChartDataManager.createMinistryGovernmentBodyHeadcountSummaryChart(panelContent); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingOverviewPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override/*from w w w.j a v a 2s. com*/ public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); final String pageId = getPageId(parameters); panelContent.addComponent(createDescription()); getMinistryRankingMenuItemFactory().createOverviewPage(panelContent); panel.setCaption(OVERVIEW + parameters); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRankingPageVisitHistoryPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override// ww w . j a v a 2 s.c o m public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); getMinistryRankingMenuItemFactory().createMinistryRankingMenuBar(menuBar); final String pageId = getPageId(parameters); adminChartDataManager.createApplicationActionEventPageModeDailySummaryChart(panelContent, NAME); panel.setCaption(PAGE_VISIT_HISTORY + parameters); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_RANKING_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.goverment.pagemode.MinistryRoleGhantPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override// w w w. ja v a 2 s . co m public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); final String pageId = getPageId(parameters); final DataContainer<ViewRiksdagenMinistry, String> dataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenMinistry.class); final ViewRiksdagenMinistry viewRiksdagenMinistry = dataContainer.load(pageId); if (viewRiksdagenMinistry != null) { getMinistryMenuItemFactory().createMinistryMenuBar(menuBar, pageId); LabelFactory.createHeader2Label(panelContent, ROLE_GHANT); final DataContainer<ViewRiksdagenGovermentRoleMember, String> govermentRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenGovermentRoleMember.class); final List<ViewRiksdagenGovermentRoleMember> allMembers = govermentRoleMemberDataContainer .getAllBy(ViewRiksdagenGovermentRoleMember_.detail, viewRiksdagenMinistry.getNameId()); ministryGhantChartManager.createRoleGhant(panelContent, allMembers); panel.setCaption(MINISTRY + viewRiksdagenMinistry.getNameId()); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MINISTRY_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); } return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.home.pagemode.UserHomeOverviewPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_USER", "ROLE_ADMIN" }) @Override/* w ww . j a v a 2 s .c o m*/ public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); final String pageId = getPageId(parameters); userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId); LabelFactory.createHeader2Label(panelContent, OVERVIEW); final Button logoutButton = new Button(LOGOUT, FontAwesome.SIGN_OUT); final LogoutRequest logoutRequest = new LogoutRequest(); logoutRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId()); logoutButton.addClickListener(new LogoutClickListener(logoutRequest, getApplicationManager())); panelContent.addComponent(logoutButton); final DataContainer<UserAccount, Long> dataContainer = getApplicationManager() .getDataContainer(UserAccount.class); final Long userIdFromSecurityContext = UserContextUtil.getUserInternalIdFromSecurityContext(); if (userIdFromSecurityContext == null) { UI.getCurrent().getNavigator().navigateTo(CommonsViews.MAIN_VIEW_NAME); } else { final UserAccount userAccount = dataContainer.load(userIdFromSecurityContext); getFormFactory().addFormPanelTextFields(panelContent, new BeanItem<>(userAccount), UserAccount.class, Arrays.asList( new String[] { "username", "createdDate", "email", "country", "numberOfVisits" })); final DataContainer<ApplicationActionEvent, Long> eventDataContainer = getApplicationManager() .getDataContainer(ApplicationActionEvent.class); final BeanItemContainer<ApplicationActionEvent> politicianDocumentDataSource = new BeanItemContainer<>( ApplicationActionEvent.class, eventDataContainer.findOrderedListByProperty(ApplicationActionEvent_.userId, userAccount.getUserId(), ApplicationActionEvent_.createdDate)); getGridFactory().createBasicBeanItemGrid(panelContent, politicianDocumentDataSource, "ApplicationActionEvent", new String[] { "hjid", "createdDate", "eventGroup", "applicationOperation", "actionName", "page", "pageMode", "elementId", "applicationMessage", "errorMessage", "modelObjectVersion" }, new String[] { "hjid", "userId", "sessionId", "modelObjectId", "modelObjectVersion" }, new PageItemPropertyClickListener(AdminViews.ADMIN_APPLICATIONS_EVENTS_VIEW_NAME, "hjid"), null, null); panelContent.setExpandRatio(logoutButton, ContentRatio.SMALL); } panel.setCaption(USERHOME); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_USER_HOME_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.home.pagemode.UserHomeSecuritySettingsPageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_USER", "ROLE_ADMIN" }) @Override//from w w w .j a va2 s .co m public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); final String pageId = getPageId(parameters); userHomeMenuItemFactory.createUserHomeMenuBar(menuBar, pageId); LabelFactory.createHeader2Label(panelContent, SECURITY_SETTINGS); final Long userIdFromSecurityContext = UserContextUtil.getUserInternalIdFromSecurityContext(); if (userIdFromSecurityContext == null) { UI.getCurrent().getNavigator().navigateTo(CommonsViews.MAIN_VIEW_NAME); } else { final Button googleAuthButton = new Button(ENABLE_GOOGLE_AUTHENTICATOR, FontAwesome.USER_SECRET); googleAuthButton.setId(ENABLE_GOOGLE_AUTHENTICATOR); final SetGoogleAuthenticatorCredentialRequest googleAuthRequest = new SetGoogleAuthenticatorCredentialRequest(); googleAuthRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId()); googleAuthButton.addClickListener( new SetGoogleAuthenticatorCredentialClickListener(googleAuthRequest, getApplicationManager())); panelContent.addComponent(googleAuthButton); } panel.setCaption(USERHOME + SECURITY_SETTINGS); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_USER_HOME_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); return panelContent; }
From source file:com.hack23.cia.web.impl.ui.application.views.user.parliament.pagemode.ParliamentChartsDecisionActivityByTypePageModContentFactoryImpl.java
License:Apache License
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" }) @Override//from w ww.ja v a 2 s . co m public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) { final VerticalLayout panelContent = createPanelContent(); final String pageId = getPageId(parameters); getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar); decisionChartDataManager.createDecisionTypeChart(panelContent); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_TEST_CHART_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); panel.setCaption(PARTY_WINNER_DAILY_AVERAGE_FOR_ALL_BALLOTS); return panelContent; }