protected void onQmbImageTextSubmited(String value) throws PresentationLogicException { AppImageVo filter = new AppImageVo(); filter.setImagePath(form.lyrFindings().tabView().qmbImage().getEditedText()); AppImageVoCollection voColl = domain.listImages(filter); form.lyrFindings().tabView().qmbImage().clear(); if (voColl != null) { for (int i = 0; i < voColl.size(); i++) { form.lyrFindings().tabView().qmbImage().newRow(voColl.get(i), voColl.get(i).getImagePath()); } if (voColl.size() > 1) { form.lyrFindings().tabView().qmbImage().showOpened(); } else if (voColl.size() == 1) { form.lyrFindings().tabView().qmbImage().setValue(voColl.get(0)); setSelContextImage(voColl.get(0)); onQmbImageValueChanged(); } } }
private void populateImageGrid(String imageName) { if(imageName == null) imageName = form.txtFilter().getValue(); clearDetails(); form.grdImages().getRows().clear(); AppImageVo vo = new AppImageVo(); vo.setImagePath(imageName); if (form.chkSystemOnly().getValue()) { vo.setIsSystem(Boolean.FALSE); } AppImageVoCollection images = domain.listImages(vo); if (images != null) { GenForm.grdImagesRow row = null; for (int i = 0; i < images.size(); i++) { AppImageVo image = images.get(i); row = form.grdImages().getRows().newRow(); row.setInternalID(image.getID_AppImage()); row.setImagePath(image.getImagePath()); row.setSystem(image.getIsSystem().booleanValue()); row.setTooltipForImagePath(image.getImagePath()); row.setValue(image); } } form.lblTotal().setValue("Total : " + form.grdImages().getRows().size()); }
public AppImageVoCollection listImages(String filter) { AppImageVo vo = new AppImageVo(); vo.setImagePath(filter); vo.setIsActive(Boolean.TRUE); return listImages(vo); }
public AppImageVoCollection listImages(AppImageVo filter) { ImageAdmin imageAdmin = (ImageAdmin) getDomainImpl(ImageAdminImpl.class); return imageAdmin.listImages(filter); }
private void populateImageGrid(String imageName) { if (imageName == null) imageName = form.txtFilter().getValue(); if (imageName == null && !form.chkSiteOnly().getValue()) { engine.showMessage("Search criteria must be entered."); return; } clearDetails(); form.grdImages().getRows().clear(); AppImageVo vo = new AppImageVo(); vo.setImagePath(imageName); if (form.chkSiteOnly().getValue()) { vo.setIsSystem(Boolean.FALSE); } if (form.chkActiveOnly().getValue()) { vo.setIsActive(Boolean.TRUE); } else { vo.setIsActive(Boolean.FALSE); } AppImageVoCollection images = domain.listImages(vo); GenForm.grdImagesRow row = null; for (int i = 0; i < images.size(); i++) { AppImageVo image = images.get(i); row = form.grdImages().getRows().newRow(); row.setInternalID(image.getID_AppImage()); row.setImagePath(getBaseName(image.getImagePath())); row.setSystem(image.getIsSystem().booleanValue()); row.setTooltipForImagePath(image.getImagePath()); row.setactive(image.getIsActive().booleanValue()); row.setValue(image); } if (form.grdImages().getRows().size() == 1) { form.grdImages().setValue(form.grdImages().getRows().get(0).getValue()); onGrdImagesSelectionChanged(); } form.lblTotal().setValue("Total : " + form.grdImages().getRows().size()); if (form.grdImages().getRows().size() == 0) engine.showMessage("No records match your search criteria."); }
public AppImageVoCollection listImages(AppImageVo filter) { DomainFactory factory = getDomainFactory(); StringBuffer cond = new StringBuffer(); ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); String andStr = ""; if (filter != null) { if (filter.getImagePath() != null && filter.getImagePath().length() > 0) { cond.append(andStr + " upper(i.imagePath) like :path"); names.add("path"); values.add("%" + filter.getImagePath().toUpperCase() + "%"); andStr = " and "; } if (filter.getIsSystem() != null) { cond.append(andStr + " i.isSystem = :system"); names.add("system"); values.add(filter.getIsSystem()); andStr = " and "; } if (filter.getIsActive() == null || filter.getIsActive().booleanValue()) { cond.append(andStr + " i.isActive = :isActive "); names.add("isActive"); values.add(Boolean.TRUE); andStr = " and "; } } String hql = " from AppImage i "; if (!andStr.equals("")) { hql += " where "; hql += cond.toString(); } List images = factory.find(hql,names,values); return AppImageVoAssembler.createAppImageVoCollectionFromAppImage(images).sort(); }
public AppImageVoCollection list16x16Icons(String name) { return AppImageVoAssembler.createAppImageVoCollectionFromAppImage(getDomainFactory().find("from AppImage as appImage where (appImage.height = :height and appImage.width = :width and appImage.imagePath like '%" + name + "%')", new String[]{"height", "width"}, new Object[]{16, 16}, 1000)); }