private void addMenuAction(AppFormVo appForm, MenuActionVo vo) { TreeNode treeNode = findOrCreateMenuActionFormNode(appForm); boolean exists = false; for(int x = 0; x < treeNode.getNodes().size(); x++) { if(vo.equals(treeNode.getNodes().get(x).getValue())) { exists = true; break; } } if(!exists) { TreeNode actionNode = treeNode.getNodes().add(vo, vo.getMenuActionDescription()); actionNode.setCollapsedImage(form.getImages().Core.AnswerBox_NotAvailable); actionNode.setExpandedImage(form.getImages().Core.AnswerBox_NotAvailable); } }
private void populateNavigation() { AppFormVoCollection coll = domain.listFormsWithHelpUrl(); form.grdDetails().getRows().clear(); GenForm.grdDetailsRow row; for (int i = 0; coll != null && i < coll.size(); i++) { AppFormVo vo = coll.get(i); row = form.grdDetails().getRows().newRow(); row.setValue(vo); row.setForm(vo.isAlias() ? vo.getAliasName() : vo.getName()); row.seturl(vo.getHelpLink()); } if (form.getLocalContext().getCurrentFormIsNotNull()) { form.grdDetails().setValue(form.getLocalContext().getCurrentForm()); } populateDetailsPanel(); onFormModeChanged(); }
protected void onGrdDetailsSelectionChanged() throws PresentationLogicException { if(form.getMode().equals(FormMode.VIEW)){ AppFormVo vo = form.grdDetails().getValue(); if (vo != null) { form.getLocalContext().setCurrentForm(vo); form.txtURL().setValue(vo.getHelpLink()); form.qmbForm().setValue(vo); form.qmbForm().setEditedText(vo.isAlias() ? vo.getAliasName() : vo.getName()); form.getContextMenus().getGenericGridUpdateItem().setVisible(true); } else { form.qmbForm().setValue(null); form.txtURL().setValue(""); form.getLocalContext().setCurrentForm(null); } onFormModeChanged(); } }
private boolean compareFormsName(AppFormVo vo) { for(int i = 0;i < form.grdDetails().getRows().size();i++) { String temp = form.grdDetails().getRows().get(i).getForm(); if(!vo.isAlias()) { if(vo.getName().equals(temp)) { return true; } } else { if(vo.getAliasName().equals(temp)) { return true; } } } return false; }
protected void onTreNavTreeViewSelectionChanged(ims.framework.controls.TreeNode node) throws ims.framework.exceptions.PresentationLogicException { setFormMode(form.getMode()); Object val = node.getValue(); if (val instanceof AppNavFormVo) { form.grdForms().setEnabled(false); AppNavFormVo navForm = (AppNavFormVo)val; AppFormVo formVo = navForm.getForm(); if (formVo.equals(this.getAssessmentForm()) && form.getMode().equals(FormMode.EDIT)) { form.grdAssessments().setEnabled(true); } } else { if (form.getMode().equals(FormMode.EDIT)) { form.grdForms().setEnabled(true); } } form.getLocalContext().setSelectedTreeValue(node.getValue()); }
protected void onQmbNavStartFormTextSubmited(String value) throws PresentationLogicException { form.qmbNavStartForm().clear(); if (value != null) { AppFormVoCollection formColl = form.getLocalContext().getAllForms(); for (int i = 0; i < formColl.size(); i++) { AppFormVo appform = formColl.get(i); if(appform.getName().indexOf(value) != -1) { if (appform.isAlias()) { form.qmbNavStartForm().newRow(appform,appform.getName() + " (" + appform.getAliasName() +")",Color.Gray); } else { form.qmbNavStartForm().newRow(appform,appform.getName()); } } form.qmbNavStartForm().showOpened(); } } }
protected void onBtnFormFilterClick() throws PresentationLogicException { if (form.lyr1().Forms().txtFormFilter().getValue() == null || form.lyr1().Forms().txtFormFilter().getValue().length() < 3) { engine.showMessage("To search, enter at least three characters."); return; } form.lyr1().Forms().grdForms().getRows().clear(); form.lyr1().Forms().grdFormLookups().getRows().clear(); form.lyr1().Forms().cmbDefInst().clear(); form.getLocalContext().setChosenForm(null); AppFormVoCollection coll = domain.listForms(form.lyr1().Forms().txtFormFilter().getValue()); for (int i = 0; i < coll.size(); i++) { AppFormVo formVo = coll.get(i); grdFormsRow row = form.lyr1().Forms().grdForms().getRows().newRow(); row.setValue(formVo); row.setFormName(formVo.getName()); } form.lyr1().Forms().txtFormFilter().setFocus(); }
private void verifyFormInTree(AppFormVo form, TreeNodeCollection tree, BooleanWraper result) { if (result.isValue() && tree == null) return; for (int i = 0; i < tree.size(); i++) { if (tree.get(i).getValue() instanceof AppNavFormVo) { if (((AppNavFormVo) tree.get(i).getValue()).getForm().getFormId() == form.getFormId()) { result.setValue(true); return; } } else { verifyFormInTree(form, tree.get(i).getNodes(), result); } } }
private AppNavFormVo createFormForAssessment(ValueObjectRef refVo, AppFormVo assesmentForm) { AppNavFormVo newForm = new AppNavFormVo(); newForm.setForm(assesmentForm); GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection(); GenericIdentifierVo genVo = new GenericIdentifierVo(); genVo.setInstanceId(refVo.getBoId()); genVo.setClassName(refVo.getClass().getName()); coll.add(genVo); newForm.setLinkedClasses(coll); newForm.setAccessForEpisEnd(FormReadWrite.WRITE); newForm.setAccessForRip(FormReadWrite.WRITE); newForm.setIsReadOnly(false); newForm.setNodeText((refVo instanceof GraphicAssessmentShortVo) ? ((GraphicAssessmentShortVo) refVo).getName() : (refVo instanceof UserAssessmentLiteVo) ? ((UserAssessmentLiteVo) refVo).getName() : null); return newForm; }
private AppNavFormVo createFormForReport(ReportTemplateLiteVo rep, AppFormVo reportForm) { AppNavFormVo newForm = new AppNavFormVo(); newForm.setForm(reportForm); newForm.setLinkedClasses(null); GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection(); GenericIdentifierVo genVo = new GenericIdentifierVo(); genVo.setInstanceId(rep.getBoId()); genVo.setClassName(rep.getClass().getName()); coll.add(genVo); newForm.setLinkedClasses(coll); newForm.setNodeText(rep.getName()); newForm.setAccessForEpisEnd(FormReadWrite.WRITE); newForm.setAccessForRip(FormReadWrite.WRITE); newForm.setIsReadOnly(false); return newForm; }
public void deleteForm(AppFormVo appForm) throws ForeignKeyViolationException, StaleObjectException { String errors[] = appForm.validate(); if (errors != null) { throw new DomainRuntimeException(errors.toString()); } DomainFactory factory = getDomainFactory(); AppForm domForm = (AppForm)factory.getDomainObject(appForm); domForm.setHelpLink(null); factory.save(domForm); }