private void displayReport() { final String reportName = reportDashboard[currentReportIndex]; final CssLayout bodyContent = (CssLayout) this.bodyContent; bodyContent.removeAllComponents(); if ("BugsByPriority".equals(reportName)) { this.setTitle(AppContext.getMessage(BugI18nEnum.WIDGET_CHART_PRIORIY_TITLE)); IPrioritySummaryChartWidget prioritySummaryChartWidget = ViewManager.getCacheComponent(IPrioritySummaryChartWidget.class); bodyContent.addComponent(prioritySummaryChartWidget); final BugSearchCriteria prioritySearchCriteria = new Cloner().deepClone(baseSearchCriteria); prioritySummaryChartWidget.setSearchCriteria(prioritySearchCriteria); } else if ("BugsByStatus".equals(reportName)) { this.setTitle(AppContext.getMessage(BugI18nEnum.WIDGET_CHART_STATUS_TITLE)); IStatusSummaryChartWidget statusSummaryChartWidget = ViewManager.getCacheComponent(IStatusSummaryChartWidget.class); bodyContent.addComponent(statusSummaryChartWidget); final BugSearchCriteria statusSearchCriteria = new Cloner().deepClone(baseSearchCriteria); statusSummaryChartWidget.setSearchCriteria(statusSearchCriteria); } else if ("BugByResolution".equals(reportName)) { this.setTitle(AppContext.getMessage(BugI18nEnum.WIDGET_CHART_RESOLUTION_TITLE)); IBugResolutionSummaryChartWidget resolutionSummaryWdiget = ViewManager.getCacheComponent(IBugResolutionSummaryChartWidget.class); bodyContent.addComponent(resolutionSummaryWdiget); final BugSearchCriteria statusSearchCriteria = new Cloner().deepClone(baseSearchCriteria); resolutionSummaryWdiget.setSearchCriteria(statusSearchCriteria); } }
@SuppressWarnings("unchecked") public AbstractPresenter(Class<V> viewClass) { this.viewClass = viewClass; implClass = (Class<V>) ViewManager.getViewImplCls(viewClass); if (implClass == null) { throw new MyCollabException("Can not find the implementation for view " + viewClass); } }
@Override protected void onGo(ComponentContainer container, ScreenData<?> data) { if (AppContext.canRead(RolePermissionCollections.ACCOUNT_ROLE)) { RoleContainer roleContainer = (RoleContainer) container; roleContainer.removeAllComponents(); roleContainer.addComponent(view.getWidget()); searchCriteria = (RoleSearchCriteria) data.getParams(); doSearch(searchCriteria); AccountSettingBreadcrumb breadcrumb = ViewManager.getCacheComponent(AccountSettingBreadcrumb.class); breadcrumb.gotoRoleList(); } else { NotificationUtil.showMessagePermissionAlert(); } }
@Override protected void onGo(ComponentContainer container, ScreenData<?> data) { if (CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.VERSIONS)) { VersionContainer versionContainer = (VersionContainer) container; versionContainer.addComponent(view.getWidget()); Version version = (Version) data.getParams(); view.editItem(version); ProjectBreadcrumb breadcrumb = ViewManager.getCacheComponent(ProjectBreadcrumb.class); if (version.getId() == null) { breadcrumb.gotoVersionAdd(); } else { breadcrumb.gotoVersionEdit(version); } } else { NotificationUtil.showMessagePermissionAlert(); } }
@Override protected void onGo(ComponentContainer container, ScreenData<?> data) { if (AppContext.canRead(RolePermissionCollections.ACCOUNT_ROLE)) { RoleService roleService = ApplicationContextUtil.getSpringBean(RoleService.class); SimpleRole role = roleService.findById((Integer) data.getParams(), AppContext.getAccountId()); if (role != null) { RoleContainer roleContainer = (RoleContainer) container; roleContainer.removeAllComponents(); roleContainer.addComponent(view.getWidget()); view.previewItem(role); AccountSettingBreadcrumb breadcrumb = ViewManager.getCacheComponent(AccountSettingBreadcrumb.class); breadcrumb.gotoRoleRead(role); } else { NotificationUtil.showRecordNotExistNotification(); } } else { NotificationUtil.showMessagePermissionAlert(); } }
@Override protected void onGo(ComponentContainer container, ScreenData<?> data) { if (CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.MILESTONES)) { MilestoneContainer milestoneContainer = (MilestoneContainer) container; milestoneContainer.navigateToContainer(ProjectTypeConstants.MILESTONE); milestoneContainer.removeAllComponents(); milestoneContainer.addComponent(view.getWidget()); Milestone milestone = (Milestone) data.getParams(); view.editItem(milestone); ProjectBreadcrumb breadcrumb = ViewManager.getCacheComponent(ProjectBreadcrumb.class); if (milestone.getId() == null) { breadcrumb.gotoMilestoneAdd(); } else { breadcrumb.gotoMilestoneEdit(milestone); } } else { NotificationUtil.showMessagePermissionAlert(); } }