private void populateGrid(ArrayList<ConfigFlagAndCategory> flagsandcategory) { if (flagsandcategory == null || flagsandcategory.size() == 0) { ConfigFlagListVoCollection savedFlags = domain.listSavedConfigFlags(); if (savedFlags == null) return ; flagsandcategory = new ArrayList<ConfigFlagAndCategory>(); for (int x = 0; x < savedFlags.size(); x++) { ConfigFlagListVo savedFlag = savedFlags.get(x); if (savedFlag == null) continue; ConfigFlagAndCategory configFlag = getConfigFlagFromConfig(savedFlag); if (configFlag != null && configFlag.getFlag() != null) { if ((savedFlag.getValue() == null && getDefaultValue(configFlag) != null) || (savedFlag.getValue() != null && Boolean.TRUE.equals(!savedFlag.getValue().equals(getDefaultValue(configFlag))))) { flagsandcategory.add(configFlag); } } } } if (form.getLocalContext().getCategorySortOrderIsNotNull() && flagsandcategory != null) { Collections.sort(flagsandcategory, new FlagCatComparator(form.getLocalContext().getCategorySortOrder())); } form.dyngrdFlags().getRows().clear(); for (int i=0; i< flagsandcategory.size(); i++) { addConfigFlagRow(flagsandcategory.get(i)); } }
public ConfigFlagListVoCollection listSavedConfigFlags() { String hql = "select cflag from ConfigFlag as cflag order by cflag.name asc"; DomainFactory factory = getDomainFactory(); return ConfigFlagListVoAssembler.createConfigFlagListVoCollectionFromConfigFlag(factory.find(hql)); }