Java Code Examples for ims.admin.vo.AppNavFormVo

The following are top voted examples for showing how to use ims.admin.vo.AppNavFormVo. 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
public int compare(Object obj1, Object obj2)
{
	int int1 = 0;
	int int2 = 0;
	if (obj1 instanceof AppNavSecondGroupVo)
		int1 = ((AppNavSecondGroupVo)obj1).getPositionIndex();
	else if (obj1 instanceof AppNavFormVo)
		int1 = ((AppNavFormVo)obj1).getPositionIndex();
	if (obj2 instanceof AppNavSecondGroupVo)
		int2 = ((AppNavSecondGroupVo)obj2).getPositionIndex();
	else if (obj2 instanceof AppNavFormVo)
		int2 = ((AppNavFormVo)obj2).getPositionIndex();
	
	if (int1 < int2)
		return -1;
	else if (int1 == int2)
		return 0;
	else
		return 1;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setFormMode(FormMode mode)
{
	form.setMode(mode);
	setContextMenuItems(mode);
	if (mode.equals(FormMode.VIEW))
	{
		form.btnUpdate().setVisible(true);
		form.btnUpdate().setEnabled(form.grdList().getValue() != null);
		form.treNav().setAllowDragDrop(false);
		form.grdForms().setEnabled(false);
		form.grdAssessments().setEnabled(false);
	}	
	else
	{
		form.treNav().setAllowDragDrop(true);
		form.grdForms().setEnabled(form.treNav().getValue() != null && form.treNav().getValue() instanceof AppNavFormVo);
		form.grdAssessments().setEnabled(false);
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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());
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 5
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 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object obj1, Object obj2)
{
	int int1 = 0;
	int int2 = 0;
	if (obj1 instanceof AppNavSecondGroupVo)
		int1 = ((AppNavSecondGroupVo)obj1).getPositionIndex();
	else if (obj1 instanceof AppNavFormVo)
		int1 = ((AppNavFormVo)obj1).getPositionIndex();
	if (obj2 instanceof AppNavSecondGroupVo)
		int2 = ((AppNavSecondGroupVo)obj2).getPositionIndex();
	else if (obj2 instanceof AppNavFormVo)
		int2 = ((AppNavFormVo)obj2).getPositionIndex();
	
	if (int1 < int2)
		return -1;
	else if (int1 == int2)
		return 0;
	else
		return 1;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdAssessmentsSelectionChanged() throws PresentationLogicException
{
	Object val;
	if (form.treNav().getSelectedNode() != null)
	{
		val = form.treNav().getSelectedNode().getValue();
		if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.grdAssessments().getValue();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.grdAssessments().getSelectedRow().getAssessmentName());
			populateNavigation(form.getLocalContext().getSelectedNav());
		}
	}
	form.grdAssessments().setEnabled(false);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if(formName.equals(form.getForms().Core.ReportTemplate) && result.equals(DialogResult.OK))
	{
		Object val = form.treNav().getValue();
		
		AppNavFormVo navForm = addAppNavFormVo(getReportViewerForm(), val);
		if (navForm != null)
		{
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.getGlobalContext().Core.getReportTemplateRef();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
			populateNavigation(form.getLocalContext().getSelectedNav());
			
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
		}
		populateNavigation(form.getLocalContext().getSelectedNav());
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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);
		}
	}

}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void verifyFormNameInTree(String name, 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().getName().toLowerCase().equals(name.toLowerCase()))
			{
				result.setValue(true);
				return;
			}
		}
		else
		{
			verifyFormNameInTree(name, tree.get(i).getNodes(), result);
		}
	}

}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object obj1, Object obj2)
{
	int int1 = 0;
	int int2 = 0;
	if (obj1 instanceof AppNavSecondGroupVo)
		int1 = ((AppNavSecondGroupVo)obj1).getPositionIndex();
	else if (obj1 instanceof AppNavFormVo)
		int1 = ((AppNavFormVo)obj1).getPositionIndex();
	if (obj2 instanceof AppNavSecondGroupVo)
		int2 = ((AppNavSecondGroupVo)obj2).getPositionIndex();
	else if (obj2 instanceof AppNavFormVo)
		int2 = ((AppNavFormVo)obj2).getPositionIndex();
	
	if (int1 < int2)
		return -1;
	else if (int1 == int2)
		return 0;
	else
		return 1;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setFormMode(FormMode mode)
{
	form.setMode(mode);
	setContextMenuItems(mode);
	if (mode.equals(FormMode.VIEW))
	{
		form.btnUpdate().setVisible(true);
		form.btnUpdate().setEnabled(form.grdList().getValue() != null);
		form.treNav().setAllowDragDrop(false);
		form.grdForms().setEnabled(false);
		form.grdAssessments().setEnabled(false);
	}	
	else
	{
		form.treNav().setAllowDragDrop(true);
		form.grdForms().setEnabled(form.treNav().getValue() != null && form.treNav().getValue() instanceof AppNavFormVo);
		form.grdAssessments().setEnabled(false);
	}
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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());
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 17
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 18
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object obj1, Object obj2)
{
	int int1 = 0;
	int int2 = 0;
	if (obj1 instanceof AppNavSecondGroupVo)
		int1 = ((AppNavSecondGroupVo)obj1).getPositionIndex();
	else if (obj1 instanceof AppNavFormVo)
		int1 = ((AppNavFormVo)obj1).getPositionIndex();
	if (obj2 instanceof AppNavSecondGroupVo)
		int2 = ((AppNavSecondGroupVo)obj2).getPositionIndex();
	else if (obj2 instanceof AppNavFormVo)
		int2 = ((AppNavFormVo)obj2).getPositionIndex();
	
	if (int1 < int2)
		return -1;
	else if (int1 == int2)
		return 0;
	else
		return 1;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdAssessmentsSelectionChanged() throws PresentationLogicException
{
	Object val;
	if (form.treNav().getSelectedNode() != null)
	{
		val = form.treNav().getSelectedNode().getValue();
		if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.grdAssessments().getValue();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.grdAssessments().getSelectedRow().getAssessmentName());
			populateNavigation(form.getLocalContext().getSelectedNav());
		}
	}
	form.grdAssessments().setEnabled(false);
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if(formName.equals(form.getForms().Core.ReportTemplate) && result.equals(DialogResult.OK))
	{
		Object val = form.treNav().getValue();
		
		AppNavFormVo navForm = addAppNavFormVo(getReportViewerForm(), val);
		if (navForm != null)
		{
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.getGlobalContext().Core.getReportTemplateRef();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
			populateNavigation(form.getLocalContext().getSelectedNav());
			
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
		}
		populateNavigation(form.getLocalContext().getSelectedNav());
	}
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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);
		}
	}

}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void verifyFormNameInTree(String name, 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().getName().toLowerCase().equals(name.toLowerCase()))
			{
				result.setValue(true);
				return;
			}
		}
		else
		{
			verifyFormNameInTree(name, tree.get(i).getNodes(), result);
		}
	}

}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object obj1, Object obj2)
{
	int int1 = 0;
	int int2 = 0;
	if (obj1 instanceof AppNavSecondGroupVo)
		int1 = ((AppNavSecondGroupVo)obj1).getPositionIndex();
	else if (obj1 instanceof AppNavFormVo)
		int1 = ((AppNavFormVo)obj1).getPositionIndex();
	if (obj2 instanceof AppNavSecondGroupVo)
		int2 = ((AppNavSecondGroupVo)obj2).getPositionIndex();
	else if (obj2 instanceof AppNavFormVo)
		int2 = ((AppNavFormVo)obj2).getPositionIndex();
	
	if (int1 < int2)
		return -1;
	else if (int1 == int2)
		return 0;
	else
		return 1;
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setFormMode(FormMode mode)
{
	form.setMode(mode);
	setContextMenuItems(mode);
	if (mode.equals(FormMode.VIEW))
	{
		form.btnUpdate().setVisible(true);
		form.btnUpdate().setEnabled(form.grdList().getValue() != null);
		form.treNav().setAllowDragDrop(false);
		form.grdForms().setEnabled(false);
		form.grdAssessments().setEnabled(false);
	}	
	else
	{
		form.treNav().setAllowDragDrop(true);
		form.grdForms().setEnabled(form.treNav().getValue() != null && form.treNav().getValue() instanceof AppNavFormVo);
		form.grdAssessments().setEnabled(false);
	}
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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());
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 29
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 30
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object obj1, Object obj2)
{
	int int1 = 0;
	int int2 = 0;
	if (obj1 instanceof AppNavSecondGroupVo)
		int1 = ((AppNavSecondGroupVo)obj1).getPositionIndex();
	else if (obj1 instanceof AppNavFormVo)
		int1 = ((AppNavFormVo)obj1).getPositionIndex();
	if (obj2 instanceof AppNavSecondGroupVo)
		int2 = ((AppNavSecondGroupVo)obj2).getPositionIndex();
	else if (obj2 instanceof AppNavFormVo)
		int2 = ((AppNavFormVo)obj2).getPositionIndex();
	
	if (int1 < int2)
		return -1;
	else if (int1 == int2)
		return 0;
	else
		return 1;
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdAssessmentsSelectionChanged() throws PresentationLogicException
{
	Object val;
	if (form.treNav().getSelectedNode() != null)
	{
		val = form.treNav().getSelectedNode().getValue();
		if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.grdAssessments().getValue();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.grdAssessments().getSelectedRow().getAssessmentName());
			populateNavigation(form.getLocalContext().getSelectedNav());
		}
	}
	form.grdAssessments().setEnabled(false);
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if(formName.equals(form.getForms().Core.ReportTemplate) && result.equals(DialogResult.OK))
	{
		Object val = form.treNav().getValue();
		
		AppNavFormVo navForm = addAppNavFormVo(getReportViewerForm(), val);
		if (navForm != null)
		{
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.getGlobalContext().Core.getReportTemplateRef();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
			populateNavigation(form.getLocalContext().getSelectedNav());
			
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
		}
		populateNavigation(form.getLocalContext().getSelectedNav());
	}
}
 
Example 33
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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);
		}
	}

}
 
Example 34
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void verifyFormNameInTree(String name, 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().getName().toLowerCase().equals(name.toLowerCase()))
			{
				result.setValue(true);
				return;
			}
		}
		else
		{
			verifyFormNameInTree(name, tree.get(i).getNodes(), result);
		}
	}

}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 36
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object obj1, Object obj2)
{
	int int1 = 0;
	int int2 = 0;
	if (obj1 instanceof AppNavSecondGroupVo)
		int1 = ((AppNavSecondGroupVo)obj1).getPositionIndex();
	else if (obj1 instanceof AppNavFormVo)
		int1 = ((AppNavFormVo)obj1).getPositionIndex();
	if (obj2 instanceof AppNavSecondGroupVo)
		int2 = ((AppNavSecondGroupVo)obj2).getPositionIndex();
	else if (obj2 instanceof AppNavFormVo)
		int2 = ((AppNavFormVo)obj2).getPositionIndex();
	
	if (int1 < int2)
		return -1;
	else if (int1 == int2)
		return 0;
	else
		return 1;
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setFormMode(FormMode mode)
{
	form.setMode(mode);
	setContextMenuItems(mode);
	if (mode.equals(FormMode.VIEW))
	{
		form.btnUpdate().setVisible(true);
		form.btnUpdate().setEnabled(form.grdList().getValue() != null);
		form.treNav().setAllowDragDrop(false);
		form.grdForms().setEnabled(false);
		form.grdAssessments().setEnabled(false);
	}	
	else
	{
		form.treNav().setAllowDragDrop(true);
		form.grdForms().setEnabled(form.treNav().getValue() != null && form.treNav().getValue() instanceof AppNavFormVo);
		form.grdAssessments().setEnabled(false);
	}
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
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());
}
 
Example 40
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 41
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 42
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object obj1, Object obj2)
{
	int int1 = 0;
	int int2 = 0;
	if (obj1 instanceof AppNavSecondGroupVo)
		int1 = ((AppNavSecondGroupVo)obj1).getPositionIndex();
	else if (obj1 instanceof AppNavFormVo)
		int1 = ((AppNavFormVo)obj1).getPositionIndex();
	if (obj2 instanceof AppNavSecondGroupVo)
		int2 = ((AppNavSecondGroupVo)obj2).getPositionIndex();
	else if (obj2 instanceof AppNavFormVo)
		int2 = ((AppNavFormVo)obj2).getPositionIndex();
	
	if (int1 < int2)
		return -1;
	else if (int1 == int2)
		return 0;
	else
		return 1;
}
 
Example 43
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdAssessmentsSelectionChanged() throws PresentationLogicException
{
	Object val;
	if (form.treNav().getSelectedNode() != null)
	{
		val = form.treNav().getSelectedNode().getValue();
		if (val instanceof AppNavFormVo)
		{
			AppNavFormVo navForm = (AppNavFormVo)val;
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.grdAssessments().getValue();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.grdAssessments().getSelectedRow().getAssessmentName());
			populateNavigation(form.getLocalContext().getSelectedNav());
		}
	}
	form.grdAssessments().setEnabled(false);
}
 
Example 44
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if(formName.equals(form.getForms().Core.ReportTemplate) && result.equals(DialogResult.OK))
	{
		Object val = form.treNav().getValue();
		
		AppNavFormVo navForm = addAppNavFormVo(getReportViewerForm(), val);
		if (navForm != null)
		{
			GenericIdentifierVoCollection coll = new GenericIdentifierVoCollection();
			ValueObjectRef refVo = form.getGlobalContext().Core.getReportTemplateRef();
			GenericIdentifierVo genVo = new GenericIdentifierVo();
			genVo.setInstanceId(refVo.getBoId());
			genVo.setClassName(refVo.getClass().getName());
			coll.add(genVo);
			navForm.setLinkedClasses(coll);
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
			populateNavigation(form.getLocalContext().getSelectedNav());
			
			navForm.setNodeText(form.getGlobalContext().Core.getTemplate());
		}
		populateNavigation(form.getLocalContext().getSelectedNav());
	}
}
 
Example 45
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
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);
		}
	}

}
 
Example 46
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void verifyFormNameInTree(String name, 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().getName().toLowerCase().equals(name.toLowerCase()))
			{
				result.setValue(true);
				return;
			}
		}
		else
		{
			verifyFormNameInTree(name, tree.get(i).getNodes(), result);
		}
	}

}
 
Example 47
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 48
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
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;
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppNavFormVo getNavFormClone(AppNavFormVo navForm)
{
	AppNavFormVo ret = new AppNavFormVo();
	ret.setNodeText(navForm.getNodeText());
	ret.setAccessForEpisEnd(navForm.getAccessForEpisEnd());
	ret.setAccessForRip(navForm.getAccessForRip());
	ret.setForm(navForm.getForm());
	ret.setIsReadOnly(navForm.getIsReadOnly());
	ret.setPosIndex(navForm.getPosIndex());
	
	return ret;
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getNavFormTooltip(AppNavFormVo af)
{
	StringBuffer sb = new StringBuffer();
	
	if(af.getAppForm().isAlias())
	{
		sb.append("<b>Form : </b>"+af.getForm().getName()+" ("+af.getAppForm().getAliasName()+")");
	}
	else
	{
		sb.append("<b>Form : </b>" + af.getForm().getName());
	}
	sb.append("<br><b>RIP : </b>" + af.getFormAccessForRip().toString());
	sb.append("<br><b>EPIS : </b>" + af.getFormAccessForEpisEnd().toString());
	if (af.getLinkedClasses() != null && af.getLinkedClasses().size() > 0)
	{
		GenericIdentifierVo genId = af.getLinkedClasses().get(0);
		ValueObjectRef voRef = (ValueObjectRef)GenericIdentifierFactory.instantiate(genId);
		ValueObject assess = domain.getAssessment(voRef);
		if (assess instanceof UserAssessmentLiteVo)
		{
			genId.setClassType(STRUCTURED_ASSESSMENT);
			UserAssessmentLiteVo userAssess = (UserAssessmentLiteVo)assess;
			sb.append("<br><b>Structured Assessment : </b>" + userAssess.getName());				
		}
		else if (assess instanceof GraphicAssessmentShortVo)
		{
			genId.setClassType(GRAPHIC_ASSESSMENT);
			GraphicAssessmentShortVo graphicAssess = (GraphicAssessmentShortVo)assess;
			sb.append("<br><b>Graphic Assessment : </b>" + graphicAssess.getName());
		}
	}		
	return sb.toString();
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isFormInColl(TreeNodeCollection coll,final int formID)
{
	if (coll == null)
		return false;
	boolean result = false;
	for (int i=0 ; i<coll.size() ; i++)
	{
		TreeNode node = coll.get(i);
		
		if (node == null || node.getValue() == null)
			break;
		if (node.getValue() instanceof AppNavFormVo)
		{
			if (((AppNavFormVo)node.getValue()).getAppForm().getFormId() == formID)
				return true;
		}
		else
		{
			 result = isFormInColl(node.getNodes(),formID);
			if (result == true)
				return true;
		}
	
		
	}
	return false;
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setNavStartForm(AppNavFormVo navform)
{
	AppNavigationVo nav = form.getLocalContext().getSelectedNav();
	if (nav == null)
		return;
	nav.setStartForm(navform.getForm());
	populateNavigation(nav);
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setNavSearchForm(AppNavFormVo navform)
{
	AppNavigationVo nav = form.getLocalContext().getSelectedNav();
	if (nav == null)
		return;
	nav.setPatientSearchForm(navform.getForm());
	populateNavigation(nav);		
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setInaccessibleForEpisEnd()
{
	AppNavFormVo navForm = (AppNavFormVo) form.treNav().getValue();
	if (navForm.getFormAccessForEpisEnd().equals(FormAccess.NO_ACCESS))
		navForm.setAccessForEpisEnd(FormReadWrite.WRITE);
	else
		navForm.setAccessForEpisEnd(FormReadWrite.DENIED);
	populateScreenFromData(form.getLocalContext().getSelectedNav());
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setInaccessibleForRIP()
{
	AppNavFormVo navForm = (AppNavFormVo) form.treNav().getValue();
	if (navForm.getFormAccessForRip().equals(FormAccess.NO_ACCESS))
		navForm.setAccessForRip(FormReadWrite.WRITE);
	else
		navForm.setAccessForRip(FormReadWrite.DENIED);
	populateScreenFromData(form.getLocalContext().getSelectedNav());
}
 
Example 56
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 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private AppNavFormVo getClone(AppNavFormVo appForm)
{
	if (appForm == null)
		return null;
	AppNavFormVo result = (AppNavFormVo) appForm.clone();
	result.clearIDAndVersion();
	return result;
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setNavSearchForm(AppNavFormVo navform)
{
	AppNavigationVo nav = populateDataFromScreen(form.getLocalContext().getSelectedNav());
	if (nav == null)
		return;
	nav.setPatientSearchForm(navform.getForm());
	populateScreenFromData(nav);
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setNavStartForm(AppNavFormVo navform)
{
	AppNavigationVo nav = populateDataFromScreen(form.getLocalContext().getSelectedNav());
	if (nav == null)
		return;
	nav.setStartForm(navform.getForm());
	populateScreenFromData(nav);
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(Object o1, Object o2)
{
	if (o1 == null || o2 == null)
		return 1;
	int indexO1 = 0;
	int indexO2 = 0;
	if (o1 instanceof AppNavSecondGroupVo)
	{
		indexO1 = ((AppNavSecondGroupVo) o1).getPosIndexIsNotNull() ? ((AppNavSecondGroupVo) o1).getPosIndex() : 0;
	}
	else
	{
		if (o1 instanceof AppNavFormVo)
		{
			indexO1 = ((AppNavFormVo) o1).getPosIndexIsNotNull() ? ((AppNavFormVo) o1).getPosIndex() : 0;
		}
		else
		{
			return 0;
		}
	}
	if (o2 instanceof AppNavSecondGroupVo)
	{
		indexO2 = ((AppNavSecondGroupVo) o2).getPosIndexIsNotNull() ? ((AppNavSecondGroupVo) o2).getPosIndex() : 0;
	}
	else
	{
		if (o2 instanceof AppNavFormVo)
		{
			indexO2 = ((AppNavFormVo) o2).getPosIndexIsNotNull() ? ((AppNavFormVo) o2).getPosIndex() : 0;
		}
		else
		{
			return 0;
		}
	}
	return indexO1 - indexO2;
}