private AppNavFormVoCollection copyAppNavFormVoCollection(AppNavFormVoCollection coll) { if (coll == null) return null; AppNavFormVoCollection ret = new AppNavFormVoCollection(); for (int i = 0; i < coll.size(); i++) { AppNavFormVo src = coll.get(i); AppNavFormVo dst = new AppNavFormVo(); dst.setAccessForEpisEnd(src.getAccessForEpisEnd()); dst.setAccessForRip(src.getAccessForRip()); dst.setForm(src.getForm()); dst.setIsReadOnly(src.getIsReadOnly()); dst.setIsRIE(Boolean.FALSE); dst.setNodeText(src.getNodeText()); dst.setPosIndex(src.getPosIndex()); dst.setLinkedClasses(copyGenericVoCollection(src.getLinkedClasses())); ret.add(dst); } return ret; }
private AppNavSecondGroupVo getClone(AppNavSecondGroupVo appGroupVo) { if (appGroupVo == null) return null; AppNavSecondGroupVo result = (AppNavSecondGroupVo) appGroupVo.clone(); result.clearIDAndVersion(); AppNavFormVoCollection forms = appGroupVo.getForms(); if (forms != null) { result.setForms(new AppNavFormVoCollection()); for (int i = 0; i < forms.size(); i++) { result.getForms().add(getClone(forms.get(i))); } } return result; }
private AppNavSecondGroupVo getSecGrpClone(AppNavSecondGroupVo secGrp) { AppNavSecondGroupVo ret = new AppNavSecondGroupVo(); ret.setForms(new AppNavFormVoCollection()); for (int i = 0; i < secGrp.getForms().size(); i++) { ret.getForms().add(this.getNavFormClone(secGrp.getForms().get(i))); } ret.setGroupName(secGrp.getGroupName()); ret.setPosIndex(secGrp.getPosIndex()); return ret; }
@Override protected void onQmbNavSearchFormTextSubmited(String value) throws PresentationLogicException { form.qmbNavSearchForm().clear(); form.qmbNavSearchForm().getValues().clear(); if (value == null || value.length() < 2) return; AppNavFormVoCollection availableForms = getAllFormsWithName(value); if (availableForms == null || availableForms.size() == 0) { String message = null; if (value.replace("%", "").trim().length() == 0) { message = "Navigation doesn't contain\nany valid forms.\nPlease add some"; } else { message = "No form in the navigation\nmeets your criteria"; } form.qmbNavSearchForm().newRow(null, message); } else { for (int i = 0; i < availableForms.size(); i++) { AppFormVo newForm = availableForms.get(i).getForm(); form.qmbNavSearchForm().newRow(newForm, newForm.isAlias() ? newForm.getAliasName() : newForm.getName()); } } form.qmbNavSearchForm().showOpened(); }
@Override protected void onQmbNavStartFormTextSubmited(String value) throws PresentationLogicException { form.qmbNavStartForm().clear(); form.qmbNavStartForm().getValues().clear(); if (value == null || value.length() < 2) return; AppNavFormVoCollection availableForms = getAllFormsWithName(value); if (availableForms == null || availableForms.size() == 0) { String message = null; if (value.replace("%", "").trim().length() == 0) { message = "Navigation doesn't contain\nany valid forms.\nPlease add some"; } else { message = "No form in the navigation\nmeets your criteria"; } form.qmbNavStartForm().newRow(null, message); } else { for (int i = 0; i < availableForms.size(); i++) { AppFormVo newForm = availableForms.get(i).getForm(); form.qmbNavStartForm().newRow(newForm, newForm.isAlias() ? newForm.getAliasName() : newForm.getName()); } } form.qmbNavStartForm().showOpened(); }
private void addNewRootGroup() { String rootText = "New Top Group " + (form.treNav().getNodes().size() + 1); form.chkShowImages().setValue(Boolean.TRUE); AppNavRootGroupVo rootGrp = new AppNavRootGroupVo(); rootGrp.setGroupName(rootText); rootGrp.setGroups(new AppNavSecondGroupVoCollection()); rootGrp.setForms(new AppNavFormVoCollection()); form.getGlobalContext().Admin.setNavigationEditedGroup(rootGrp); engine.open(form.getForms().Admin.NavigationImageSelectDialog); }
private void addNewSecondGroup() { TreeNode rootNode = form.treNav().getSelectedNode(); form.chkShowImages().setValue(Boolean.TRUE); String secText = "New Second Group " + String.valueOf(rootNode.getNodes().size() + 1); AppNavSecondGroupVo secGrp = new AppNavSecondGroupVo(); secGrp.setTextNode(secText); secGrp.setForms(new AppNavFormVoCollection()); secGrp.setPosIndex(new Integer(form.treNav().getSelectedNode().getNodes().size())); form.getGlobalContext().Admin.setNavigationEditedGroup(secGrp); engine.open(form.getForms().Admin.NavigationImageSelectDialog); }
private AppNavRootGroupVo getClone(AppNavRootGroupVo appNavRootGroupVo) { if (appNavRootGroupVo == null) return null; AppNavRootGroupVo result = (AppNavRootGroupVo) appNavRootGroupVo.clone(); result.clearIDAndVersion(); AppNavSecondGroupVoCollection secondGroupVoCollection = appNavRootGroupVo.getGroups(); if (secondGroupVoCollection != null) { result.setGroups(new AppNavSecondGroupVoCollection()); for (int i = 0; i < secondGroupVoCollection.size(); i++) { result.getGroups().add(getClone(secondGroupVoCollection.get(i))); } } AppNavFormVoCollection appNavFormVoCollection = appNavRootGroupVo.getForms(); if (appNavFormVoCollection != null) { result.setForms(new AppNavFormVoCollection()); for (int i = 0; i < appNavFormVoCollection.size(); i++) { result.getForms().add(getClone(appNavFormVoCollection.get(i))); } } return result; }
private void createTree(INavigationNode element, TreeNode parent) { TreeNode newNode = createNewTreeNode(element, parent); // we prepare the childs for the Navigation Node as we need to sort them ArrayList<INavigationNode> childs = new ArrayList<INavigationNode>(); // first we take the second groups if any AppNavSecondGroupVoCollection secGroups = element.getGroupsChildsNode(); if (secGroups != null) { childs.addAll(getAsList(secGroups)); } // secondly we take the forms if any AppNavFormVoCollection forms = element.getFormChildsNode(); if (forms != null) { childs.addAll(getAsList(forms)); } if (childs.size() == 0) return; // now we sort the list using the Nav Collections.sort(childs, new NavPosIndexComparator()); // after this we add recursively all childs for (int i = 0; i < childs.size(); i++) { createTree(childs.get(i), newNode); } }
private ArrayList<INavigationNode> getAsList(AppNavFormVoCollection group) { if (group == null) return null; ArrayList<INavigationNode> result = new ArrayList<INavigationNode>(); for (int i = 0; i < group.size(); i++) { result.add(group.get(i)); } return result; }
private void addNewRootGroup()//WDEV-19366 { String rootText = "New Top Group " + (form.treNav().getNodes().size() + 1); AppNavRootGroupVo rootGrp = new AppNavRootGroupVo(); rootGrp.setGroupName(rootText); rootGrp.setGroups(new AppNavSecondGroupVoCollection()); rootGrp.setForms(new AppNavFormVoCollection()); form.getGlobalContext().Admin.setNavigationEditedGroup(rootGrp); engine.open(form.getForms().Admin.NavigationImageSelectDialog); }
private void addNewSecondGroup()//WDEV-19366 { TreeNode rootNode = form.treNav().getSelectedNode(); String secText = "New Second Group " + String.valueOf(rootNode.getNodes().size() + 1); AppNavSecondGroupVo secGrp = new AppNavSecondGroupVo(); secGrp.setTextNode(secText); secGrp.setForms(new AppNavFormVoCollection()); secGrp.setPosIndex(new Integer(form.treNav().getSelectedNode().getNodes().size())); form.getGlobalContext().Admin.setNavigationEditedGroup(secGrp); engine.open(form.getForms().Admin.NavigationImageSelectDialog); }