Java Code Examples for ims.admin.vo.AppNavRootGroupVo

The following are top voted examples for showing how to use ims.admin.vo.AppNavRootGroupVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavRootGroupVoCollection copyRootGroupColl(AppNavRootGroupVoCollection coll)
{
	if (coll == null)
		return null;
	
	AppNavRootGroupVoCollection ret = new AppNavRootGroupVoCollection();
	for (int i = 0; i < coll.size(); i++)
	{
		AppNavRootGroupVo src = coll.get(i);
		AppNavRootGroupVo dst = new AppNavRootGroupVo();
		dst.setGroupName(src.getGroupName());
		dst.setIsRIE(Boolean.FALSE);
		dst.setForms(copyAppNavFormVoCollection(src.getForms()));
		dst.setGroups(copyAppNavSecGrpVoCollection(src.getGroups()));
		ret.add(dst);
	}
	return ret;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPosIndexes(TreeNode rootNode)
{
	Object val = rootNode.getValue();
	if (!(val instanceof AppNavRootGroupVo))
		return;
	
	for (int i = 0; i < rootNode.getNodes().size(); i++)
	{
		val = rootNode.getNodes().get(i).getValue();
		if (val instanceof AppNavSecondGroupVo)
		{
			AppNavSecondGroupVo secGrp = (AppNavSecondGroupVo)val;
			secGrp.setPosIndex(new Integer(i));
		}
		else if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;				
			navForm.setPosIndex(new Integer(i));
		}
	}
}
 
Example 3
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavRootGroupVoCollection copyRootGroupColl(AppNavRootGroupVoCollection coll)
{
	if (coll == null)
		return null;
	
	AppNavRootGroupVoCollection ret = new AppNavRootGroupVoCollection();
	for (int i = 0; i < coll.size(); i++)
	{
		AppNavRootGroupVo src = coll.get(i);
		AppNavRootGroupVo dst = new AppNavRootGroupVo();
		dst.setGroupName(src.getGroupName());
		dst.setIsRIE(Boolean.FALSE);
		dst.setForms(copyAppNavFormVoCollection(src.getForms()));
		dst.setGroups(copyAppNavSecGrpVoCollection(src.getGroups()));
		ret.add(dst);
	}
	return ret;
}
 
Example 4
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPosIndexes(TreeNode rootNode)
{
	Object val = rootNode.getValue();
	if (!(val instanceof AppNavRootGroupVo))
		return;
	
	for (int i = 0; i < rootNode.getNodes().size(); i++)
	{
		val = rootNode.getNodes().get(i).getValue();
		if (val instanceof AppNavSecondGroupVo)
		{
			AppNavSecondGroupVo secGrp = (AppNavSecondGroupVo)val;
			secGrp.setPosIndex(new Integer(i));
		}
		else if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;				
			navForm.setPosIndex(new Integer(i));
		}
	}
}
 
Example 5
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavRootGroupVoCollection copyRootGroupColl(AppNavRootGroupVoCollection coll)
{
	if (coll == null)
		return null;
	
	AppNavRootGroupVoCollection ret = new AppNavRootGroupVoCollection();
	for (int i = 0; i < coll.size(); i++)
	{
		AppNavRootGroupVo src = coll.get(i);
		AppNavRootGroupVo dst = new AppNavRootGroupVo();
		dst.setGroupName(src.getGroupName());
		dst.setIsRIE(Boolean.FALSE);
		dst.setForms(copyAppNavFormVoCollection(src.getForms()));
		dst.setGroups(copyAppNavSecGrpVoCollection(src.getGroups()));
		ret.add(dst);
	}
	return ret;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPosIndexes(TreeNode rootNode)
{
	Object val = rootNode.getValue();
	if (!(val instanceof AppNavRootGroupVo))
		return;
	
	for (int i = 0; i < rootNode.getNodes().size(); i++)
	{
		val = rootNode.getNodes().get(i).getValue();
		if (val instanceof AppNavSecondGroupVo)
		{
			AppNavSecondGroupVo secGrp = (AppNavSecondGroupVo)val;
			secGrp.setPosIndex(new Integer(i));
		}
		else if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;				
			navForm.setPosIndex(new Integer(i));
		}
	}
}
 
Example 7
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private AppNavRootGroupVoCollection copyRootGroupColl(AppNavRootGroupVoCollection coll)
{
	if (coll == null)
		return null;
	
	AppNavRootGroupVoCollection ret = new AppNavRootGroupVoCollection();
	for (int i = 0; i < coll.size(); i++)
	{
		AppNavRootGroupVo src = coll.get(i);
		AppNavRootGroupVo dst = new AppNavRootGroupVo();
		dst.setGroupName(src.getGroupName());
		dst.setIsRIE(Boolean.FALSE);
		dst.setForms(copyAppNavFormVoCollection(src.getForms()));
		dst.setGroups(copyAppNavSecGrpVoCollection(src.getGroups()));
		ret.add(dst);
	}
	return ret;
}
 
Example 8
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setPosIndexes(TreeNode rootNode)
{
	Object val = rootNode.getValue();
	if (!(val instanceof AppNavRootGroupVo))
		return;
	
	for (int i = 0; i < rootNode.getNodes().size(); i++)
	{
		val = rootNode.getNodes().get(i).getValue();
		if (val instanceof AppNavSecondGroupVo)
		{
			AppNavSecondGroupVo secGrp = (AppNavSecondGroupVo)val;
			secGrp.setPosIndex(new Integer(i));
		}
		else if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;				
			navForm.setPosIndex(new Integer(i));
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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);

}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected TreeNode getNodeToAddTo()
{
	TreeNode toNode = form.treNav().getSelectedNode();
	if (toNode == null || toNode.getValue() == null)
		return null;
	if (toNode.getValue() instanceof AppNavRootGroupVo)
		return toNode;
	if (toNode.getValue() instanceof AppNavSecondGroupVo)
		return toNode;
	if (toNode.getValue() instanceof AppNavFormVo)
		return toNode.getParent();
	return null;
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
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);

}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected TreeNode getNodeToAddTo()
{
	TreeNode toNode = form.treNav().getSelectedNode();
	if (toNode == null || toNode.getValue() == null)
		return null;
	if (toNode.getValue() instanceof AppNavRootGroupVo)
		return toNode;
	if (toNode.getValue() instanceof AppNavSecondGroupVo)
		return toNode;
	if (toNode.getValue() instanceof AppNavFormVo)
		return toNode.getParent();
	return null;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
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);

}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected TreeNode getNodeToAddTo()
{
	TreeNode toNode = form.treNav().getSelectedNode();
	if (toNode == null || toNode.getValue() == null)
		return null;
	if (toNode.getValue() instanceof AppNavRootGroupVo)
		return toNode;
	if (toNode.getValue() instanceof AppNavSecondGroupVo)
		return toNode;
	if (toNode.getValue() instanceof AppNavFormVo)
		return toNode.getParent();
	return null;
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 18
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
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);

}
 
Example 19
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
protected TreeNode getNodeToAddTo()
{
	TreeNode toNode = form.treNav().getSelectedNode();
	if (toNode == null || toNode.getValue() == null)
		return null;
	if (toNode.getValue() instanceof AppNavRootGroupVo)
		return toNode;
	if (toNode.getValue() instanceof AppNavSecondGroupVo)
		return toNode;
	if (toNode.getValue() instanceof AppNavFormVo)
		return toNode.getParent();
	return null;
}
 
Example 20
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
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;
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@SuppressWarnings("unchecked")
private void populateNavigation(AppNavigationVo nav)
{
	form.treNavView().clear();
	if (nav == null)
		return;
	
	for (int i = 0; i < nav.getRootGroups().size(); i++)
	{
		AppNavRootGroupVo rg = nav.getRootGroups().get(i);
		TreeNode rootNode = form.treNavView().getNodes().add(rg, rg.getGroupName());
		rootNode.setExpandedImage(form.getImages().Core.CareContext);
		rootNode.setCollapsedImage(form.getImages().Core.CareContext);
		rootNode.setSelectedImage(form.getImages().Core.CareContext);
				
		ArrayList<Object> children = new ArrayList<Object>();
		for (int j = 0; rg.getGroups() != null && j < rg.getGroups().size(); j++)
		{
			children.add(rg.getGroups().get(j));
		}
		for (int k = 0; rg.getForms() != null && k < rg.getForms().size(); k++)
		{
			children.add(rg.getForms().get(k));
		}
		Collections.sort(children, new NavComparator());
		
		for (int m = 0; m < children.size(); m++)
		{
			Object child = children.get(m);
			if (child instanceof AppNavSecondGroupVo)
			{
				addSecondGroup(rootNode, (AppNavSecondGroupVo)child, nav);
			}
			else
			{
				addNavForm(rootNode, (AppNavFormVo)child, nav);
			}
		}
	}
	form.treNavView().expandAll();
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private AppNavFormVo addAppNavFormVo(AppFormVo formVo, Object parentObject)
{
	if (formVo == null)
		return null;
	

	
	AppNavFormVo navForm = new AppNavFormVo();
	navForm.setForm(formVo);
	navForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	navForm.setAccessForRip(FormReadWrite.WRITE);
	navForm.setIsReadOnly(Boolean.FALSE);
	
	if(form.treNav().getSelectedNode()!= null && form.treNav().getSelectedNode().getNodes()!= null)
	{
	
		navForm.setPosIndex(new Integer(form.treNav().getSelectedNode().getNodes().size()));

	}
	else engine.showMessage("Please select a node to add your selected form to");
	
	if (formVo.isAlias())
		navForm.setNodeText(formVo.getAliasName());
	else
		navForm.setNodeText(formVo.getName());
	
	if (parentObject instanceof AppNavRootGroupVo)
	{
		AppNavRootGroupVo rootGrp = (AppNavRootGroupVo)parentObject;
		if (rootGrp.getForms() == null)
			rootGrp.setForms(new AppNavFormVoCollection());
		
		rootGrp.getForms().add(navForm);
	}
	else if (parentObject instanceof AppNavSecondGroupVo)
	{
		AppNavSecondGroupVo secGrp = (AppNavSecondGroupVo)parentObject;
		if (secGrp.getForms() == null)
			secGrp.setForms(new AppNavFormVoCollection());
		
		secGrp.getForms().add(navForm);				
	}
	return navForm;
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
@SuppressWarnings("unchecked")
private void populateNavigation(AppNavigationVo nav)
{
	form.treNavView().clear();
	if (nav == null)
		return;
	
	for (int i = 0; i < nav.getRootGroups().size(); i++)
	{
		AppNavRootGroupVo rg = nav.getRootGroups().get(i);
		TreeNode rootNode = form.treNavView().getNodes().add(rg, rg.getGroupName());
		rootNode.setExpandedImage(form.getImages().Core.CareContext);
		rootNode.setCollapsedImage(form.getImages().Core.CareContext);
		rootNode.setSelectedImage(form.getImages().Core.CareContext);
				
		ArrayList<Object> children = new ArrayList<Object>();
		for (int j = 0; rg.getGroups() != null && j < rg.getGroups().size(); j++)
		{
			children.add(rg.getGroups().get(j));
		}
		for (int k = 0; rg.getForms() != null && k < rg.getForms().size(); k++)
		{
			children.add(rg.getForms().get(k));
		}
		Collections.sort(children, new NavComparator());
		
		for (int m = 0; m < children.size(); m++)
		{
			Object child = children.get(m);
			if (child instanceof AppNavSecondGroupVo)
			{
				addSecondGroup(rootNode, (AppNavSecondGroupVo)child, nav);
			}
			else
			{
				addNavForm(rootNode, (AppNavFormVo)child, nav);
			}
		}
	}
	form.treNavView().expandAll();
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private AppNavFormVo addAppNavFormVo(AppFormVo formVo, Object parentObject)
{
	if (formVo == null)
		return null;
	

	
	AppNavFormVo navForm = new AppNavFormVo();
	navForm.setForm(formVo);
	navForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	navForm.setAccessForRip(FormReadWrite.WRITE);
	navForm.setIsReadOnly(Boolean.FALSE);
	
	if(form.treNav().getSelectedNode()!= null && form.treNav().getSelectedNode().getNodes()!= null)
	{
	
		navForm.setPosIndex(new Integer(form.treNav().getSelectedNode().getNodes().size()));

	}
	else engine.showMessage("Please select a node to add your selected form to");
	
	if (formVo.isAlias())
		navForm.setNodeText(formVo.getAliasName());
	else
		navForm.setNodeText(formVo.getName());
	
	if (parentObject instanceof AppNavRootGroupVo)
	{
		AppNavRootGroupVo rootGrp = (AppNavRootGroupVo)parentObject;
		if (rootGrp.getForms() == null)
			rootGrp.setForms(new AppNavFormVoCollection());
		
		rootGrp.getForms().add(navForm);
	}
	else if (parentObject instanceof AppNavSecondGroupVo)
	{
		AppNavSecondGroupVo secGrp = (AppNavSecondGroupVo)parentObject;
		if (secGrp.getForms() == null)
			secGrp.setForms(new AppNavFormVoCollection());
		
		secGrp.getForms().add(navForm);				
	}
	return navForm;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
@SuppressWarnings("unchecked")
private void populateNavigation(AppNavigationVo nav)
{
	form.treNavView().clear();
	if (nav == null)
		return;
	
	for (int i = 0; i < nav.getRootGroups().size(); i++)
	{
		AppNavRootGroupVo rg = nav.getRootGroups().get(i);
		TreeNode rootNode = form.treNavView().getNodes().add(rg, rg.getGroupName());
		rootNode.setExpandedImage(form.getImages().Core.CareContext);
		rootNode.setCollapsedImage(form.getImages().Core.CareContext);
		rootNode.setSelectedImage(form.getImages().Core.CareContext);
				
		ArrayList<Object> children = new ArrayList<Object>();
		for (int j = 0; rg.getGroups() != null && j < rg.getGroups().size(); j++)
		{
			children.add(rg.getGroups().get(j));
		}
		for (int k = 0; rg.getForms() != null && k < rg.getForms().size(); k++)
		{
			children.add(rg.getForms().get(k));
		}
		Collections.sort(children, new NavComparator());
		
		for (int m = 0; m < children.size(); m++)
		{
			Object child = children.get(m);
			if (child instanceof AppNavSecondGroupVo)
			{
				addSecondGroup(rootNode, (AppNavSecondGroupVo)child, nav);
			}
			else
			{
				addNavForm(rootNode, (AppNavFormVo)child, nav);
			}
		}
	}
	form.treNavView().expandAll();
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private AppNavFormVo addAppNavFormVo(AppFormVo formVo, Object parentObject)
{
	if (formVo == null)
		return null;
	

	
	AppNavFormVo navForm = new AppNavFormVo();
	navForm.setForm(formVo);
	navForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	navForm.setAccessForRip(FormReadWrite.WRITE);
	navForm.setIsReadOnly(Boolean.FALSE);
	
	if(form.treNav().getSelectedNode()!= null && form.treNav().getSelectedNode().getNodes()!= null)
	{
	
		navForm.setPosIndex(new Integer(form.treNav().getSelectedNode().getNodes().size()));

	}
	else engine.showMessage("Please select a node to add your selected form to");
	
	if (formVo.isAlias())
		navForm.setNodeText(formVo.getAliasName());
	else
		navForm.setNodeText(formVo.getName());
	
	if (parentObject instanceof AppNavRootGroupVo)
	{
		AppNavRootGroupVo rootGrp = (AppNavRootGroupVo)parentObject;
		if (rootGrp.getForms() == null)
			rootGrp.setForms(new AppNavFormVoCollection());
		
		rootGrp.getForms().add(navForm);
	}
	else if (parentObject instanceof AppNavSecondGroupVo)
	{
		AppNavSecondGroupVo secGrp = (AppNavSecondGroupVo)parentObject;
		if (secGrp.getForms() == null)
			secGrp.setForms(new AppNavFormVoCollection());
		
		secGrp.getForms().add(navForm);				
	}
	return navForm;
}
 
Example 27
Project: openmaxims-linux   File: Logic.java   Source Code and License 4 votes vote down vote up
@SuppressWarnings("unchecked")
private void populateNavigation(AppNavigationVo nav)
{
	form.treNavView().clear();
	if (nav == null)
		return;
	
	for (int i = 0; i < nav.getRootGroups().size(); i++)
	{
		AppNavRootGroupVo rg = nav.getRootGroups().get(i);
		TreeNode rootNode = form.treNavView().getNodes().add(rg, rg.getGroupName());
		rootNode.setExpandedImage(form.getImages().Core.CareContext);
		rootNode.setCollapsedImage(form.getImages().Core.CareContext);
		rootNode.setSelectedImage(form.getImages().Core.CareContext);
				
		ArrayList<Object> children = new ArrayList<Object>();
		for (int j = 0; rg.getGroups() != null && j < rg.getGroups().size(); j++)
		{
			children.add(rg.getGroups().get(j));
		}
		for (int k = 0; rg.getForms() != null && k < rg.getForms().size(); k++)
		{
			children.add(rg.getForms().get(k));
		}
		Collections.sort(children, new NavComparator());
		
		for (int m = 0; m < children.size(); m++)
		{
			Object child = children.get(m);
			if (child instanceof AppNavSecondGroupVo)
			{
				addSecondGroup(rootNode, (AppNavSecondGroupVo)child, nav);
			}
			else
			{
				addNavForm(rootNode, (AppNavFormVo)child, nav);
			}
		}
	}
	form.treNavView().expandAll();
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   Source Code and License 4 votes vote down vote up
private AppNavFormVo addAppNavFormVo(AppFormVo formVo, Object parentObject)
{
	if (formVo == null)
		return null;
	

	
	AppNavFormVo navForm = new AppNavFormVo();
	navForm.setForm(formVo);
	navForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	navForm.setAccessForRip(FormReadWrite.WRITE);
	navForm.setIsReadOnly(Boolean.FALSE);
	
	if(form.treNav().getSelectedNode()!= null && form.treNav().getSelectedNode().getNodes()!= null)
	{
	
		navForm.setPosIndex(new Integer(form.treNav().getSelectedNode().getNodes().size()));

	}
	else engine.showMessage("Please select a node to add your selected form to");
	
	if (formVo.isAlias())
		navForm.setNodeText(formVo.getAliasName());
	else
		navForm.setNodeText(formVo.getName());
	
	if (parentObject instanceof AppNavRootGroupVo)
	{
		AppNavRootGroupVo rootGrp = (AppNavRootGroupVo)parentObject;
		if (rootGrp.getForms() == null)
			rootGrp.setForms(new AppNavFormVoCollection());
		
		rootGrp.getForms().add(navForm);
	}
	else if (parentObject instanceof AppNavSecondGroupVo)
	{
		AppNavSecondGroupVo secGrp = (AppNavSecondGroupVo)parentObject;
		if (secGrp.getForms() == null)
			secGrp.setForms(new AppNavFormVoCollection());
		
		secGrp.getForms().add(navForm);				
	}
	return navForm;
}