private void filterByPredicate(TaskGroupPredicate predicate) { // Recalculate predicate model.setConfigurationToPlanner(planner, additional, doubleClickCommand, predicate); planner.updateSelectedZoomLevel(); planner.invalidate(); }
private void initializeListboxProgressTypes() { if (cbProgressTypes == null) { cbProgressTypes = (Combobox) planner.getFellow("cbProgressTypes"); } if (btnShowAdvances == null) { btnShowAdvances = (Button) planner.getFellow("showAdvances"); } cbProgressTypes.setModel(new ListModelList(ProgressType.getAll())); cbProgressTypes.setItemRenderer(new ProgressTypeRenderer()); // Update completion of tasks on selecting new progress type cbProgressTypes.addEventListener(Events.ON_SELECT, new EventListener() { @Override public void onEvent(Event event) { planner.forcedShowAdvances(); planner.updateCompletion(getSelectedProgressType().toString()); } private ProgressType getSelectedProgressType() { return (ProgressType) cbProgressTypes.getSelectedItem().getValue(); } }); cbProgressTypes.setVisible(true); ProgressType progressType = getProgressTypeFromConfiguration(); if (progressType != null) { planner.updateCompletion(progressType.toString()); } }
public void setConfigurationForPlanner() { // Added predicate model .setConfigurationToPlanner(planner, additional, doubleClickCommand, createPredicate()); model.setTabsController(tabsController); planner.updateSelectedZoomLevel(); planner.invalidate(); }
@Override public void doAfterCompose(org.zkoss.zk.ui.Component comp) { planner = (Planner) comp; String zoomLevelParameter = null; if ((parameters != null) && (parameters.get("zoom") != null) && !(parameters.isEmpty())) { zoomLevelParameter = parameters.get("zoom")[0]; } if (zoomLevelParameter != null) { planner.setInitialZoomLevel(ZoomLevel .getFromString(zoomLevelParameter)); } planner.setAreContainersExpandedByDefault(Planner .guessContainersExpandedByDefault(parameters)); initializeListboxProgressTypes(); planner.setAreShownAdvancesByDefault(Planner .guessShowAdvancesByDefault(parameters)); planner.setAreShownReportedHoursByDefault(Planner .guessShowReportedHoursByDefault(parameters)); planner.setAreShownMoneyCostBarByDefault(Planner .guessShowMoneyCostBarByDefault(parameters)); orderFilter = (Vbox) planner.getFellow("orderFilter"); // Configuration of the order filter Component filterComponent = Executions.createComponents( "/orders/_orderFilter.zul", orderFilter, new HashMap<String, String>()); filterComponent.setVariable("orderFilterController", this, true); filterStartDate = (Datebox) filterComponent .getFellow("filterStartDate"); filterFinishDate = (Datebox) filterComponent .getFellow("filterFinishDate"); bdFilters = (BandboxMultipleSearch) filterComponent .getFellow("bdFilters"); bdFilters.setFinder("taskGroupsMultipleFiltersFinder"); loadPredefinedBandboxFilter(); checkIncludeOrderElements = (Checkbox) filterComponent .getFellow("checkIncludeOrderElements"); filterComponent.setVisible(true); checkCreationPermissions(); }
/** * Checks the creation permissions of the current user and enables/disables * the create buttons accordingly. */ private void checkCreationPermissions() { if (!SecurityUtils .isSuperuserOrUserInRoles(UserRole.ROLE_CREATE_PROJECTS)) { Button createOrderButton = (Button) planner.getPage().getFellow( "createOrderButton"); if (createOrderButton != null) { createOrderButton.setDisabled(true); } } }