Java Code Examples for ims.oncology.vo.ContactTypesByDisciplineVo

The following are top voted examples for showing how to use ims.oncology.vo.ContactTypesByDisciplineVo. 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: CancerContactImpl.java   Source Code and License 6 votes vote down vote up
public ContactTypesByDisciplineVo loadDisciplineContacts(LookupInstVo hcpDisp) 
{
	ArrayList names = new ArrayList();
	ArrayList values = new ArrayList();
	
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer("from ContactTypesByDiscipline cd where cd.discipline = :disp ");
	names.add("disp");
	values.add(getDomLookup(hcpDisp));
	
	List list = factory.find(hql.toString(), names,values);
	if (list.size() == 1)
		return ContactTypesByDisciplineVoAssembler.create((ContactTypesByDiscipline)list.get(0));
	
	return null;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void updateContextMenuState()
{
	boolean bView = form.getMode().equals(FormMode.VIEW);
	boolean bRootNode = false;
	boolean bChildNode = false;
	
	if (form.treList().getSelectedNode() == null)
	{
		form.getContextMenus().Oncology.hideAllOncologyContactTypesMenuItems();

		form.getContextMenus().Oncology.getOncologyContactTypesNEW_DISCP_TYPESItem().setVisible(bView);
		return;
	}
	if (form.treList().getSelectedNode().getValue() instanceof ContactTypesByDisciplineVo)
		bRootNode = true;
	
	if (form.treList().getSelectedNode().getValue() instanceof ContactTypesByDisciplineItemVo)
		bChildNode = true;
	
	form.getContextMenus().Oncology.getOncologyContactTypesEDIT_CONTACTItem().setVisible(bView && form.treList().getSelectedNode() != null && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesNEW_CHILD_CONTACTItem().setVisible(bView && form.treList().getSelectedNode() != null && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesNEW_CHILDItem().setVisible(bView && form.treList().getSelectedNode() != null && !bChildNode);
	form.getContextMenus().Oncology.getOncologyContactTypesMOVE_UPItem().setVisible(bView && form.treList().canMoveCurrentUp() && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesMOVE_DOWNItem().setVisible(bView && form.treList().canMoveCurrentDown() && !bRootNode);
}
 
Example 3
Project: openMAXIMS   File: CancerContactImpl.java   Source Code and License 6 votes vote down vote up
public ContactTypesByDisciplineVo loadDisciplineContacts(LookupInstVo hcpDisp) 
{
	ArrayList names = new ArrayList();
	ArrayList values = new ArrayList();
	
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer("from ContactTypesByDiscipline cd where cd.discipline = :disp ");
	names.add("disp");
	values.add(getDomLookup(hcpDisp));
	
	List list = factory.find(hql.toString(), names,values);
	if (list.size() == 1)
		return ContactTypesByDisciplineVoAssembler.create((ContactTypesByDiscipline)list.get(0));
	
	return null;
}
 
Example 4
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void updateContextMenuState()
{
	boolean bView = form.getMode().equals(FormMode.VIEW);
	boolean bRootNode = false;
	boolean bChildNode = false;
	
	if (form.treList().getSelectedNode() == null)
	{
		form.getContextMenus().Oncology.hideAllOncologyContactTypesMenuItems();

		form.getContextMenus().Oncology.getOncologyContactTypesNEW_DISCP_TYPESItem().setVisible(bView);
		return;
	}
	if (form.treList().getSelectedNode().getValue() instanceof ContactTypesByDisciplineVo)
		bRootNode = true;
	
	if (form.treList().getSelectedNode().getValue() instanceof ContactTypesByDisciplineItemVo)
		bChildNode = true;
	
	form.getContextMenus().Oncology.getOncologyContactTypesEDIT_CONTACTItem().setVisible(bView && form.treList().getSelectedNode() != null && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesNEW_CHILD_CONTACTItem().setVisible(bView && form.treList().getSelectedNode() != null && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesNEW_CHILDItem().setVisible(bView && form.treList().getSelectedNode() != null && !bChildNode);
	form.getContextMenus().Oncology.getOncologyContactTypesMOVE_UPItem().setVisible(bView && form.treList().canMoveCurrentUp() && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesMOVE_DOWNItem().setVisible(bView && form.treList().canMoveCurrentDown() && !bRootNode);
	
}
 
Example 5
Project: openMAXIMS   File: CancerContactImpl.java   Source Code and License 6 votes vote down vote up
public ContactTypesByDisciplineVo loadDisciplineContacts(LookupInstVo hcpDisp) 
{
	ArrayList names = new ArrayList();
	ArrayList values = new ArrayList();
	
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer("from ContactTypesByDiscipline cd where cd.discipline = :disp ");
	names.add("disp");
	values.add(getDomLookup(hcpDisp));
	
	List list = factory.find(hql.toString(), names,values);
	if (list.size() == 1)
		return ContactTypesByDisciplineVoAssembler.create((ContactTypesByDiscipline)list.get(0));
	
	return null;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void updateContextMenuState()
{
	boolean bView = form.getMode().equals(FormMode.VIEW);
	boolean bRootNode = false;
	boolean bChildNode = false;
	
	if (form.treList().getSelectedNode() == null)
	{
		form.getContextMenus().Oncology.hideAllOncologyContactTypesMenuItems();

		form.getContextMenus().Oncology.getOncologyContactTypesNEW_DISCP_TYPESItem().setVisible(bView);
		return;
	}
	if (form.treList().getSelectedNode().getValue() instanceof ContactTypesByDisciplineVo)
		bRootNode = true;
	
	if (form.treList().getSelectedNode().getValue() instanceof ContactTypesByDisciplineItemVo)
		bChildNode = true;
	
	form.getContextMenus().Oncology.getOncologyContactTypesEDIT_CONTACTItem().setVisible(bView && form.treList().getSelectedNode() != null && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesNEW_CHILD_CONTACTItem().setVisible(bView && form.treList().getSelectedNode() != null && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesNEW_CHILDItem().setVisible(bView && form.treList().getSelectedNode() != null && !bChildNode);
	form.getContextMenus().Oncology.getOncologyContactTypesMOVE_UPItem().setVisible(bView && form.treList().canMoveCurrentUp() && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesMOVE_DOWNItem().setVisible(bView && form.treList().canMoveCurrentDown() && !bRootNode);
}
 
Example 7
Project: openmaxims-linux   File: CancerContactImpl.java   Source Code and License 6 votes vote down vote up
public ContactTypesByDisciplineVo loadDisciplineContacts(LookupInstVo hcpDisp) 
{
	ArrayList names = new ArrayList();
	ArrayList values = new ArrayList();
	
	DomainFactory factory = getDomainFactory();
	StringBuffer hql = new StringBuffer("from ContactTypesByDiscipline cd where cd.discipline = :disp ");
	names.add("disp");
	values.add(getDomLookup(hcpDisp));
	
	List list = factory.find(hql.toString(), names,values);
	if (list.size() == 1)
		return ContactTypesByDisciplineVoAssembler.create((ContactTypesByDiscipline)list.get(0));
	
	return null;
}
 
Example 8
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void updateContextMenuState()
{
	boolean bView = form.getMode().equals(FormMode.VIEW);
	boolean bRootNode = false;
	boolean bChildNode = false;
	
	if (form.treList().getSelectedNode() == null)
	{
		form.getContextMenus().Oncology.hideAllOncologyContactTypesMenuItems();

		form.getContextMenus().Oncology.getOncologyContactTypesNEW_DISCP_TYPESItem().setVisible(bView);
		return;
	}
	if (form.treList().getSelectedNode().getValue() instanceof ContactTypesByDisciplineVo)
		bRootNode = true;
	
	if (form.treList().getSelectedNode().getValue() instanceof ContactTypesByDisciplineItemVo)
		bChildNode = true;
	
	form.getContextMenus().Oncology.getOncologyContactTypesEDIT_CONTACTItem().setVisible(bView && form.treList().getSelectedNode() != null && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesNEW_CHILD_CONTACTItem().setVisible(bView && form.treList().getSelectedNode() != null && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesNEW_CHILDItem().setVisible(bView && form.treList().getSelectedNode() != null && !bChildNode);
	form.getContextMenus().Oncology.getOncologyContactTypesMOVE_UPItem().setVisible(bView && form.treList().canMoveCurrentUp() && !bRootNode);
	form.getContextMenus().Oncology.getOncologyContactTypesMOVE_DOWNItem().setVisible(bView && form.treList().canMoveCurrentDown() && !bRootNode);
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateDisciplineTree(ContactTypesByDisciplineVo vo, ContactTypesByDisciplineItemRefVoCollection voColl) 
{
	form.lyr1().tabPageDetails().treContactTypes().clear();

	for (int j = 0 ; vo != null && vo.getContactTypesIsNotNull() && j < vo.getContactTypes().size() ; j++)
		addChildNode(vo.getContactTypes().get(j), voColl);
	
	if (form.getMode().equals(FormMode.VIEW)) 
		removeUntickedNodes();

	if (form.getMode().equals(FormMode.EDIT)) 
		removeUnusedParentNodes(vo);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeUnusedParentNodes(ContactTypesByDisciplineVo voDisp) 
{
	for (int i = 0 ; i < form.lyr1().tabPageDetails().treContactTypes().getNodes().size() ; i++)
	{
		if(removeUnusedParentNodes(form.lyr1().tabPageDetails().treContactTypes().getNodes().get(i), voDisp))// If true decrement counter
			i--;
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean removeUnusedParentNodes(TreeNode node, ContactTypesByDisciplineVo voDisp)
{
	if (node.getNodes().size() > 0 )
	{
		for (int i = 0 ; i < node.getNodes().size() ; i++)
		{
			if(removeUnusedParentNodes(node.getNodes().get(i),voDisp)) // If true decrement counter 
				i--;
		}
	}

	boolean bRemoved = false;
	if (!node.isChecked())
	{
		if (node.getNodes().size() == 0)
		{
			boolean bIsAConfiguredParentNode = false;
			
			for (int i = 0 ; i < voDisp.getContactTypes().size() ; i++)
			{
				if (node.getValue() instanceof ContactTypesByDisciplineItemVo
					&& ((ContactTypesByDisciplineItemVo)node.getValue()).equals(voDisp.getContactTypes().get(i).getParent()))
					bIsAConfiguredParentNode = true;
			}
			
			if (bIsAConfiguredParentNode) 
			{
				form.lyr1().tabPageDetails().treContactTypes().getNodes().remove(node);
				bRemoved = true;
			}
		}
	}
	
	return bRemoved;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void findRootNode()
{
	TreeNode treeNode = null;
	treeNode = form.treList().getSelectedNode(); 
	if (treeNode != null)
	{
		while ( treeNode.getValue() instanceof ContactTypesByDisciplineItemVo)
		{
			treeNode = treeNode.getParent();
		}
	}

	form.getLocalContext().setSelectedRecord(treeNode != null ? ((ContactTypesByDisciplineVo)treeNode.getValue()) : null);
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newDisciplineAndContactType() 
{
	form.setMode(FormMode.EDIT);
	form.ctnDetails().setCollapsed(false);

	form.ctnDetails().Group1().setValue(Group1Enumeration.rdoActive);
	ContactTypesByDisciplineVo voContact = new ContactTypesByDisciplineVo();
	form.getLocalContext().setSelectedRecord(voContact);
	form.getLocalContext().setSelectedItem(null);
	form.getLocalContext().setParentNode(null);
	clearInstanceControls();
	form.ctnDetails().Group1().setValue(Group1Enumeration.rdoActive);
	loadHcpDisciplines();
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateDisciplineTree(ContactTypesByDisciplineVo vo, ContactTypesByDisciplineItemRefVoCollection voColl) 
{
	form.lyr1().tabPageDetails().treContactTypes().clear();

	for (int j = 0 ; vo != null && vo.getContactTypesIsNotNull() && j < vo.getContactTypes().size() ; j++)
		addChildNode(vo.getContactTypes().get(j), voColl);
	
	if (form.getMode().equals(FormMode.VIEW)) 
		removeUntickedNodes();

	if (form.getMode().equals(FormMode.EDIT)) 
		removeUnusedParentNodes(vo);
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeUnusedParentNodes(ContactTypesByDisciplineVo voDisp) 
{
	for (int i = 0 ; i < form.lyr1().tabPageDetails().treContactTypes().getNodes().size() ; i++)
	{
		if(removeUnusedParentNodes(form.lyr1().tabPageDetails().treContactTypes().getNodes().get(i), voDisp))// If true decrement counter
			i--;
	}
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean removeUnusedParentNodes(TreeNode node, ContactTypesByDisciplineVo voDisp)
{
	if (node.getNodes().size() > 0 )
	{
		for (int i = 0 ; i < node.getNodes().size() ; i++)
		{
			if(removeUnusedParentNodes(node.getNodes().get(i),voDisp)) // If true decrement counter 
				i--;
		}
	}

	boolean bRemoved = false;
	if (!node.isChecked())
	{
		if (node.getNodes().size() == 0)
		{
			boolean bIsAConfiguredParentNode = false;
			
			for (int i = 0 ; i < voDisp.getContactTypes().size() ; i++)
			{
				if (node.getValue() instanceof ContactTypesByDisciplineItemVo
					&& ((ContactTypesByDisciplineItemVo)node.getValue()).equals(voDisp.getContactTypes().get(i).getParent()))
					bIsAConfiguredParentNode = true;
			}
			
			if (bIsAConfiguredParentNode) 
			{
				form.lyr1().tabPageDetails().treContactTypes().getNodes().remove(node);
				bRemoved = true;
			}
		}
	}
	
	return bRemoved;
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void findRootNode()
{
	TreeNode treeNode = null;
	treeNode = form.treList().getSelectedNode(); 
	if (treeNode != null)
	{
		while ( treeNode.getValue() instanceof ContactTypesByDisciplineItemVo)
		{
			treeNode = treeNode.getParent();
		}
	}

	form.getLocalContext().setSelectedRecord(treeNode != null ? ((ContactTypesByDisciplineVo)treeNode.getValue()) : null);
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newDisciplineAndContactType() 
{
	form.setMode(FormMode.EDIT);
	form.ctnDetails().setCollapsed(false);

	form.ctnDetails().Group1().setValue(Group1Enumeration.rdoActive);
	ContactTypesByDisciplineVo voContact = new ContactTypesByDisciplineVo();
	form.getLocalContext().setSelectedRecord(voContact);
	form.getLocalContext().setSelectedItem(null);
	form.getLocalContext().setParentNode(null);
	clearInstanceControls();
	form.ctnDetails().Group1().setValue(Group1Enumeration.rdoActive);
	loadHcpDisciplines();
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateDisciplineTree(ContactTypesByDisciplineVo vo, ContactTypesByDisciplineItemRefVoCollection voColl) 
{
	form.lyrContact().tabContactDetails().treContactTypes().clear();

	for (int j = 0 ; vo != null && vo.getContactTypes() != null && j < vo.getContactTypes().size() ; j++)
		addChildNode(vo.getContactTypes().get(j), voColl);
	
	if (form.getMode().equals(FormMode.VIEW) && !Boolean.TRUE.equals(form.lyrContact().tabContactDetails().chkNoActivity().getValue())) 
		removeUntickedNodes();

	if (form.getMode().equals(FormMode.EDIT)) 
		removeUnusedParentNodes(vo);
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeUnusedParentNodes(ContactTypesByDisciplineVo voDisp) 
{
	for (int i = 0 ; i < form.lyrContact().tabContactDetails().treContactTypes().getNodes().size() ; i++)
	{
		if(removeUnusedParentNodes(form.lyrContact().tabContactDetails().treContactTypes().getNodes().get(i), voDisp))
			i--;
	}
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean removeUnusedParentNodes(TreeNode node, ContactTypesByDisciplineVo voDisp)
{
	if (node.getNodes().size() > 0 )
	{
		for (int i = 0 ; i < node.getNodes().size() ; i++)
		{
			if(removeUnusedParentNodes(node.getNodes().get(i),voDisp)) // If true decrement counter 
				i--;
		}
	}

	boolean bRemoved = false;
	
	if (!node.isChecked())
	{
		if (node.getNodes().size() == 0)
		{
			boolean bIsAConfiguredParentNode = false;
			
			for (int i = 0 ; i < voDisp.getContactTypes().size() ; i++)
			{
				if (node.getValue() instanceof ContactTypesByDisciplineItemVo
					&& ((ContactTypesByDisciplineItemVo)node.getValue()).equals(voDisp.getContactTypes().get(i).getParent()))
					bIsAConfiguredParentNode = true;
			}
			
			if (bIsAConfiguredParentNode) 
			{
				form.lyrContact().tabContactDetails().treContactTypes().getNodes().remove(node);
				bRemoved = true;
			}
		}
	}
	
	return bRemoved;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateDisciplineTree(ContactTypesByDisciplineVo vo, ContactTypesByDisciplineItemRefVoCollection voColl) 
{
	form.lyr1().tabPageDetails().treContactTypes().clear();

	for (int j = 0 ; vo != null && vo.getContactTypesIsNotNull() && j < vo.getContactTypes().size() ; j++)
		addChildNode(vo.getContactTypes().get(j), voColl);
	
	if (form.getMode().equals(FormMode.VIEW)) 
		removeUntickedNodes();

	if (form.getMode().equals(FormMode.EDIT)) 
		removeUnusedParentNodes(vo);
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeUnusedParentNodes(ContactTypesByDisciplineVo voDisp) 
{
	for (int i = 0 ; i < form.lyr1().tabPageDetails().treContactTypes().getNodes().size() ; i++)
	{
		if(removeUnusedParentNodes(form.lyr1().tabPageDetails().treContactTypes().getNodes().get(i), voDisp))// If true decrement counter
			i--;
	}
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean removeUnusedParentNodes(TreeNode node, ContactTypesByDisciplineVo voDisp)
{
	if (node.getNodes().size() > 0 )
	{
		for (int i = 0 ; i < node.getNodes().size() ; i++)
		{
			if(removeUnusedParentNodes(node.getNodes().get(i),voDisp)) // If true decrement counter 
				i--;
		}
	}

	boolean bRemoved = false;
	if (!node.isChecked())
	{
		if (node.getNodes().size() == 0)
		{
			boolean bIsAConfiguredParentNode = false;
			
			for (int i = 0 ; i < voDisp.getContactTypes().size() ; i++)
			{
				if (node.getValue() instanceof ContactTypesByDisciplineItemVo
					&& ((ContactTypesByDisciplineItemVo)node.getValue()).equals(voDisp.getContactTypes().get(i).getParent()))
					bIsAConfiguredParentNode = true;
			}
			
			if (bIsAConfiguredParentNode) 
			{
				form.lyr1().tabPageDetails().treContactTypes().getNodes().remove(node);
				bRemoved = true;
			}
		}
	}
	
	return bRemoved;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void findRootNode()
{
	TreeNode treeNode = null;
	treeNode = form.treList().getSelectedNode(); 
	if (treeNode != null)
	{
		while ( treeNode.getValue() instanceof ContactTypesByDisciplineItemVo)
		{
			treeNode = treeNode.getParent();
		}
	}

	form.getLocalContext().setSelectedRecord(treeNode != null ? ((ContactTypesByDisciplineVo)treeNode.getValue()) : null);
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newDisciplineAndContactType() 
{
	form.setMode(FormMode.EDIT);
	form.ctnDetails().setCollapsed(false);

	form.ctnDetails().Group1().setValue(Group1Enumeration.rdoActive);
	ContactTypesByDisciplineVo voContact = new ContactTypesByDisciplineVo();
	form.getLocalContext().setSelectedRecord(voContact);
	form.getLocalContext().setSelectedItem(null);
	form.getLocalContext().setParentNode(null);
	clearInstanceControls();
	form.ctnDetails().Group1().setValue(Group1Enumeration.rdoActive);
	loadHcpDisciplines();
}
 
Example 27
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateDisciplineTree(ContactTypesByDisciplineVo vo, ContactTypesByDisciplineItemRefVoCollection voColl) 
{
	form.lyr1().tabPageDetails().treContactTypes().clear();

	for (int j = 0 ; vo != null && vo.getContactTypesIsNotNull() && j < vo.getContactTypes().size() ; j++)
		addChildNode(vo.getContactTypes().get(j), voColl);
	
	if (form.getMode().equals(FormMode.VIEW)) 
		removeUntickedNodes();

	if (form.getMode().equals(FormMode.EDIT)) 
		removeUnusedParentNodes(vo);
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void removeUnusedParentNodes(ContactTypesByDisciplineVo voDisp) 
{
	for (int i = 0 ; i < form.lyr1().tabPageDetails().treContactTypes().getNodes().size() ; i++)
	{
		if(removeUnusedParentNodes(form.lyr1().tabPageDetails().treContactTypes().getNodes().get(i), voDisp))// If true decrement counter
			i--;
	}
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean removeUnusedParentNodes(TreeNode node, ContactTypesByDisciplineVo voDisp)
{
	if (node.getNodes().size() > 0 )
	{
		for (int i = 0 ; i < node.getNodes().size() ; i++)
		{
			if(removeUnusedParentNodes(node.getNodes().get(i),voDisp)) // If true decrement counter 
				i--;
		}
	}

	boolean bRemoved = false;
	if (!node.isChecked())
	{
		if (node.getNodes().size() == 0)
		{
			boolean bIsAConfiguredParentNode = false;
			
			for (int i = 0 ; i < voDisp.getContactTypes().size() ; i++)
			{
				if (node.getValue() instanceof ContactTypesByDisciplineItemVo
					&& ((ContactTypesByDisciplineItemVo)node.getValue()).equals(voDisp.getContactTypes().get(i).getParent()))
					bIsAConfiguredParentNode = true;
			}
			
			if (bIsAConfiguredParentNode) 
			{
				form.lyr1().tabPageDetails().treContactTypes().getNodes().remove(node);
				bRemoved = true;
			}
		}
	}
	
	return bRemoved;
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void findRootNode()
{
	TreeNode treeNode = null;
	treeNode = form.treList().getSelectedNode(); 
	if (treeNode != null)
	{
		while ( treeNode.getValue() instanceof ContactTypesByDisciplineItemVo)
		{
			treeNode = treeNode.getParent();
		}
	}

	form.getLocalContext().setSelectedRecord(treeNode != null ? ((ContactTypesByDisciplineVo)treeNode.getValue()) : null);
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newDisciplineAndContactType() 
{
	form.setMode(FormMode.EDIT);
	form.ctnDetails().setCollapsed(false);

	form.ctnDetails().Group1().setValue(Group1Enumeration.rdoActive);
	ContactTypesByDisciplineVo voContact = new ContactTypesByDisciplineVo();
	form.getLocalContext().setSelectedRecord(voContact);
	form.getLocalContext().setSelectedItem(null);
	form.getLocalContext().setParentNode(null);
	clearInstanceControls();
	form.ctnDetails().Group1().setValue(Group1Enumeration.rdoActive);
	loadHcpDisciplines();
}