Java Code Examples for ims.framework.controls.TreeNode

The following are top voted examples for showing how to use ims.framework.controls.TreeNode. 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 void addForm(IAppForm item) 
{		
	if(item.isComponent())
		return;
	
	String formName = item.getName();
	if(item.isAlias())
		formName += " (" + item.getAliasName() + ")";
	if(item.isDialog())
		formName += " - dialog";
	
	TreeNode node = form.treFormActions().getNodes().add(item, formName);
	node.setExpandedImage(form.getImages().Core.Form);
	node.setCollapsedImage(form.getImages().Core.Form);
	node.setCheckBoxVisible(false);
	
	TreeNode loadingNode = node.getNodes().add(null, "Loading...");
	loadingNode.setExpandedImage(form.getImages().Core.Time);
	loadingNode.setCollapsedImage(form.getImages().Core.Time);
	loadingNode.setCheckBoxVisible(false);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void displayAllSpecialties() 
{
	if (form.getLocalContext().getSpecialties() == null) return;		
	SpecialtyCollection lkpCollSpecialties = form.getLocalContext().getSpecialties();
	
	TreeNode node = null;

	form.treAssociate().clear();										
	for(int i=0;i<lkpCollSpecialties.size();i++)
	{
		node = form.treAssociate().getNodes().add(lkpCollSpecialties.get(i), lkpCollSpecialties.get(i).toString());
		node.setCheckBoxVisible(form.getMode().equals(FormMode.EDIT));
		node.setCollapsedImage(form.getImages().Admin.Service);
	}

	
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void prePopulateListTypeTree()
{
	SpecimenCollectionMethodCollection collMethods = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	ims.framework.cn.data.TreeNode[] parentNodes = collMethods.getRootNodes();
	for(int i=0;i<parentNodes.length;i++)
	{
		ims.framework.cn.data.TreeNode parentNode = parentNodes[i];
		TreeNode ctrlNode = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().add(parentNode,  ((SpecimenCollectionMethod)parentNode).getText());
		for(int p=0;p<parentNode.getChildren().length;p++)
		{
			ims.framework.cn.data.TreeNode childNode = parentNode.getChildren()[p];
			ctrlNode.getNodes().add(childNode,  ((SpecimenCollectionMethod)childNode).getText());	
		}
		ctrlNode.setExpanded(true);
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void displayAllConsultants()
{
	if (form.getLocalContext().getConsultants() == null) return;		
	MedicVoCollection voCollConsultants = form.getLocalContext().getConsultants();
	
	TreeNode node = null;

	form.treAssociate().clear();										
	for(int i=0;i<voCollConsultants.size();i++)
	{
		node = form.treAssociate().getNodes().add(voCollConsultants.get(i), voCollConsultants.get(i).getMos().getName().toShortForm());
		node.setCheckBoxVisible(form.getMode().equals(FormMode.EDIT));
		node.setCollapsedImage(form.getImages().Admin.MemberOfStaff);
	}
	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadFormMenuActions(TreeNode node)
{
	if(node.getValue() instanceof IAppForm && 				
			node.getNodes().size() == 1 &&
			node.getNodes().get(0).getValue() == null)
	{
		node.getNodes().clear();
		
		MenuActionVoCollection actions = domain.getMenuActions((IAppForm)node.getValue());
		if(actions != null && actions.size() > 0)
		{
			for (MenuActionVo action : actions) 
			{
				addMenuAction(node, action);
			}
		}
		else
		{
			node.setCheckBoxVisible(false);
		}
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private TreeNode getNodeByText(TreeNode parent, String textNode)
{
	TreeNodeCollection nodes = null;
	
	if(parent == null)
	{
		nodes = form.treBOList().getNodes();
	}
	else
	{
		nodes = parent.getNodes();
	}
	
	for (int i = 0; i < nodes.size(); i++)
	{
		if(nodes.get(i).getText().equals(textNode))
			return nodes.get(i); 
	}
	
	return null;
}
 
Example 7
Project: AvoinApotti   File: DailyPatientProgressHelper.java   Source Code and License 6 votes vote down vote up
public void populateTreeScores(ims.framework.controls.TreeView tree, PatientAssessmentGroupVoCollection voColl)
{
	if(tree == null)
		return;
	
	TotalScore totalScore = getTotalScore(voColl);
	
	if(totalScore != null)
	{
		TreeNode node = tree.getNodes().add(new Integer(RED_SCORE), "(" + Integer.toString(totalScore.getRedScore()) + ") Red");
		node.setExpandedImage(redImage);
		node.setCollapsedImage(redImage);
		node = tree.getNodes().add(new Integer(YELLOW_SCORE), "(" + Integer.toString(totalScore.getYellowScore()) + ") Yellow");
		node.setExpandedImage(yellowImage);
		node.setCollapsedImage(yellowImage);
		node = tree.getNodes().add(new Integer(GREEN_SCORE), "(" + Integer.toString(totalScore.getGreenScore()) + ") Green");
		node.setExpandedImage(greenImage);
		node.setCollapsedImage(greenImage);
		node = tree.getNodes().add(null, "Total Score: " + totalScore.getTotalScore());
		node.setTextColor(Color.Blue);
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateGrid(TreeNode parentNode, IFlag[] flags) 
{
	Image expImage = form.getImages().Core.YellowFlag;
	Image collImage = form.getImages().Core.YellowFlag;		
	
	TreeNode node = null;
	for (int i = 0; i < flags.length; i++)
	{
		IFlag flag = flags[i];
		node = parentNode.getNodes().add(flag, flag.getName());
		if (flag.isSystem())
		{
			node.setCollapsedImage(form.getImages().Core.RedFlag);
			node.setExpandedImage(form.getImages().Core.RedFlag);
		}
		else
		{
			node.setCollapsedImage(collImage);
			node.setExpandedImage(expImage);				
		}
		node.setTooltip(flag.getToolTip());
		node.setValue(flag);
	}		
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateClassification(QuestionInformationVo voQInfo)
{
	if (voQInfo != null && voQInfo.getClassificationIsNotNull())
	{
		QuestionClassification qClassInfo;
		TreeNode node;
		for (int j = 0; j < voQInfo.getClassification().size(); j++)
		{
			qClassInfo = voQInfo.getClassification().get(j);
			for (int i = 0; i < form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().size(); i++)
			{
				node = form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().get(i);
				if (qClassInfo.equals(node.getValue()))
					node.setChecked(true);

				if (node.getNodes() != null && node.getNodes().size() > 0)
					setClassificationValue(qClassInfo, node);
			}
		}
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private SpecimenCollectionMethod getTreeTypesCheckBoxSelectedValue()
{
	for (int i = 0; i < form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().size(); i++)
	{
		TreeNode node = form.lyrSpecColConfig().tabSpecCollectionConfig().treTypes().getNodes().get(i);
		if (node.isChecked())
			return (SpecimenCollectionMethod) node.getValue();
		for (int p = 0; p < node.getNodes().size(); p++)
		{
			if (node.getNodes().get(p).isChecked())
				return (SpecimenCollectionMethod) node.getNodes().get(p).getValue();
		}
	}

	return null;

}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private QuestionClassificationCollection getClassification()
{
	QuestionClassificationCollection coll = new QuestionClassificationCollection();
	TreeNode parentNode, childNode;
	for (int i = 0; i < form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().size(); i++)
	{
		parentNode = form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().get(i);
		if (parentNode.isChecked())
			coll.add((QuestionClassification) parentNode.getValue());
		for (int j = 0; parentNode != null && j < parentNode.getNodes().size(); j++)
		{
			childNode = parentNode.getNodes().get(j);
			if (childNode.isChecked())
				coll.add((QuestionClassification) childNode.getValue());
		}
	}
	return coll;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onTreTypesTreeViewNodeDropped(TreeNode node, TreeNode oldParent) throws PresentationLogicException
{
	if (node.getValue() != null && node.getValue() instanceof LookupInstVo )
	{
		LookupInstVo vo = (LookupInstVo)node.getValue();
		if (node.getParent() == null)
		{
			vo.setParentInstance(null);
		}
		else
		{
			if (node.getParent().getValue() instanceof LookupTypeVo)
			{
				vo.setParentInstance(null);
			}
			else
			{
				vo.setParentInstance((LookupInstVo)node.getParent().getValue());
			}				
		}
	}
	
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private QuestionClassificationCollection getClassification() 
{
	QuestionClassificationCollection coll = new QuestionClassificationCollection();
	TreeNode parentNode, childNode;
	for(int i=0; i<form.treClassification().getNodes().size(); i++)
	{
		parentNode = form.treClassification().getNodes().get(i);
		if(parentNode.isChecked())
			coll.add((QuestionClassification)parentNode.getValue());
		for(int j=0; parentNode != null && j<parentNode.getNodes().size(); j++)
		{
			childNode = parentNode.getNodes().get(j);
			if(childNode.isChecked())
				coll.add((QuestionClassification)childNode.getValue());
		}
	}
	return coll;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnBuildClick() throws ims.framework.exceptions.PresentationLogicException
{
	TreeNode node = form.treTemplate().getSelectedNode();

	if (node == null || node.getParent() == null)
	{
		engine.showMessage("Please select at template !");
		return;
	}

	form.getGlobalContext().Core.setCurrentFormName(engine.getPreviousNonDialogFormName());

	form.getGlobalContext().Core.setReportID(((ReportVo) node.getParent().getValue()).getID_ReportBo());
	form.getGlobalContext().Core.setTemplateID(((ReportTemplateVo) node.getValue()).getID_TemplateBo());

	if (form.getGlobalContext().Core.getAutoOpenViewReportIsNotNull() && form.getGlobalContext().Core.getAutoOpenViewReport().equals(Boolean.TRUE))
		engine.open(form.getForms().Core.ViewReport);

	engine.close(DialogResult.OK);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * @param newNode
 * @param inst
 */
private void fillTypeActivites(TreeNode parentNode, LookupInstVo inst)
{
	ActivityVoCollection collActivityVo = form.getLocalContext().getActivityVoCollection();
	for (int i = 0; i < collActivityVo.size(); i++)
	{
		ActivityVo voActivity = collActivityVo.get(i);

		if (voActivity.getActivityType().equals(inst))
		{
			TreeNode newNode = parentNode.getNodes().add(voActivity, voActivity.getName());
			newNode.setExpandedImage(form.getImages().Core.BlueSquare);
			newNode.setCollapsedImage(form.getImages().Core.BlueSquare);
			newNode.setSelectedImage(form.getImages().Core.BlueSquare);
		}
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public ValueObject getRootNod()
{
	TreeNode node = form.treCategoryGroupSite().getSelectedNode();
	
	if (node == null)
		return null;
	
	while (node.getParent() != null)
		node = node.getParent();
	
	return (ValueObject) node.getValue();
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void unassignTemplate()
{
	TreeNode node = form.treBOList().getSelectedNode();
	
	if(node != null && node.getParent() != null)
		form.getLocalContext().setLastNode((String) node.getParent().getValue());
	
	ReportTemplateBoRefVo item = (ReportTemplateBoRefVo) form.treBOList().getValue();
	
	try
	{
		domain.removeLink(item);
		open();
	}
	catch (ForeignKeyViolationException e)
	{
		engine.showMessage("Error unassigning the template: " + e.toString());
		return;
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void enableSelectedNodes()
{
	if (form.treConfig().getSelectedNode() == null)
		return;

	TreeNode node = null;
	if (form.treConfig().getSelectedNode().getParent() == null)
		node = form.treConfig().getSelectedNode();
	else
		node = form.treConfig().getSelectedNode().getParent();

	for (int i = 0; i < form.treConfig().getNodes().size(); i++)
	{
		boolean bEnabled = node.equals(form.treConfig().getNodes().get(i));
		form.treConfig().getNodes().get(i).setEnabled(bEnabled);
		for (int j = 0; j < form.treConfig().getNodes().get(i).getNodes().size(); j++)
			form.treConfig().getNodes().get(i).getNodes().get(j).setEnabled(bEnabled);
	}
}
 
Example 19
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 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private TreeNode findEnabledNode()
{
	if (form.treConfig().getSelectedNode() != null)
	{
		if(form.treConfig().getSelectedNode().getValue() instanceof PresProblemChecklistConfigShortVo)
			return form.treConfig().getSelectedNode();
		
		return form.treConfig().getSelectedNode().getParent();
	}
	else
	{
		for (int i = 0; i < form.treConfig().getNodes().size(); i++)
		{
			if (form.treConfig().getNodes().get(i).isEnabled() == true)
				return form.treConfig().getNodes().get(i);
		}

	}

	return null;
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void newInstance()
{
	PresProblemChecklistConfigVo config = form.getLocalContext().getCurrentConfig();
	config.setSpecialty(form.cmbSpecialty().getValue());
	form.getLocalContext().setCurrentConfig(config);

	PresProblemChecklistConfigShortVo voPresProblemChecklistConfigShort = new PresProblemChecklistConfigShortVo();
	voPresProblemChecklistConfigShort.setSpecialty(form.cmbSpecialty().getValue());
	TreeNode node = form.treConfig().getNodes().add(voPresProblemChecklistConfigShort, voPresProblemChecklistConfigShort.getSpecialty().getText());

	node.setExpandedImage(form.getImages().Core.RedSqaure);
	node.setCollapsedImage(form.getImages().Core.RedSqaure);
	node.setSelectedImage(form.getImages().Core.RedSqaure);

	form.treConfig().setValue(voPresProblemChecklistConfigShort);
	form.treConfig().setEnabled(true);

	showSpecialtyControls(true);
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void removeMenuActionsDenied()
{		
	TreeNode selectedNode = form.lyrRights().tabActionsDenied().treActions().getSelectedNode();
	if(selectedNode != null)
	{
		if(selectedNode.getParent() == null)
		{
			form.lyrRights().tabActionsDenied().treActions().getNodes().remove(selectedNode);
		}
		else
		{
			selectedNode.getParent().getNodes().remove(selectedNode);
		}
	}
	
	updateContextMenuState(); //WDEV-15632
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean selectMosFromGlobalContext() throws PresentationLogicException
{
	// if there is a MOS id in global context populated in WorkQueue
	// then we select it and display its details
	Integer targetId = form.getGlobalContext().NTPF.getTargetObjectId();
	if (targetId == null)
		return false;

	form.getLocalContext().setShowLinkBack(Boolean.TRUE);
	form.getLocalContext().setPreviousForm(getPreviousForm());
	// MemberOfStaffShortVo filterVo = new MemberOfStaffShortVo();
	// filterVo.setID_MemberOfStaff(targetId);
	populateMosTree();

	if (form.lyrLHS().tabMos().treMemberOfStaff().getNodes().size() == 1)
	{
		TreeNode mosNode = form.lyrLHS().tabMos().treMemberOfStaff().getNodes().get(0);
		MemberOfStaffShortVo voMosShort = (MemberOfStaffShortVo) form.lyrLHS().tabMos().treMemberOfStaff().getNodes().get(0).getValue();

		onTreMemberOfStaffTreeViewSelectionChanged(mosNode);
		form.lyrLHS().tabMos().treMemberOfStaff().setValue(voMosShort);
		onContextMenuItemClick(GenForm.ContextMenus.MosOrganisation.EDIT, form.lyrLHS().tabMos().treMemberOfStaff());
	}

	return false;
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private TreeNode addChildNode(TreeNode parentNode, ContactTypesByDisciplineItemVo vo, boolean bExpand) 
{
	TreeNode childNode = null;
	if (vo.getParentIsNotNull())
	{
		if (form.treList().getNodes().getNodeByValue(vo.getParent()) != null)
			childNode = form.treList().getNodes().getNodeByValue(vo.getParent()).getNodes().add(vo, vo.getContactType());
	}
	else
		childNode = parentNode.getNodes().add(vo, vo.getContactType());
	
	if (childNode == null)
		return null;
	
	if( vo.getActive().equals(Boolean.FALSE))
		childNode.setTextColor(Color.Red);
	
	childNode.setExpanded(bExpand);

	return childNode;
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void clearMosNodes(TreeNode node)
{
	TreeNode childNode;
	ArrayList l = new ArrayList();
	for (int i = 0; i < node.getNodes().size(); i++)
	{
		childNode = node.getNodes().get(i);
		if (childNode.getValue() instanceof MemberOfStaffShortVo)
		{
			l.add(childNode);
		}
	}
	for (int i = 0; i < l.size(); i++)
	{
		node.getNodes().remove((TreeNode) l.get(i));
	}
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void setNodeImage(TreeNode node, Color color ) 
{
	if (color == Color.Red)
	{
		node.setExpandedImage(form.getImages().Core.RedSqaure);
		node.setCollapsedImage(form.getImages().Core.RedSqaure);
		node.setSelectedImage(form.getImages().Core.RedSqaure);			
	}
	else if (color == Color.Green)
	{
		node.setExpandedImage(form.getImages().Core.GreenSquare);
		node.setCollapsedImage(form.getImages().Core.GreenSquare);
		node.setSelectedImage(form.getImages().Core.GreenSquare);						
	}
	else if (color == Color.Blue)
	{
		node.setExpandedImage(form.getImages().Admin.Service);
		node.setCollapsedImage(form.getImages().Admin.Service);
		node.setSelectedImage(form.getImages().Admin.Service);						
	}		
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateTree(ICPConfigurationDisplayVo icp)
{
	// Clear tree
	form.treIcp().clear();
	
	// Terminate function if ICP is null
	if (icp == null)
		return;
	
	// Add node ICP
	TreeNode node = form.treIcp().getNodes().add(icp, icp.getName() + " (" + icp.getID_ICP().toString() + ")");
	
	// Set node images, gray text for inactive,
	node.setCollapsedImage(form.getImages().ICP.ICP);
	node.setExpandedImage(form.getImages().ICP.ICP);
	
	if (PreActiveActiveInactiveStatus.INACTIVE.equals(icp.getStatus()))
	{
		node.setTextColor(Color.Gray);
	}
	
	// Populate node stages
	populateTreeStages(node, icp.getStages());
	
	node.setExpanded(true);
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addNodeToLinkedActions(TreeNode node, ICPActionRefVoCollection linkedActions)
{
	if (linkedActions == null)
		return;
	
	if (node == null)
		return;
	
	if (node.getValue() instanceof ICPActionRefVo && node.isChecked())
		linkedActions.add((ICPActionRefVo) node.getValue());
	
	for (int i = 0; i < node.getNodes().size(); i++)
	{
		TreeNode treeNode = node.getNodes().get(i);
		
		addNodeToLinkedActions(treeNode, linkedActions);
	}
}
 
Example 29
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 30
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void menuActivityUpdatePriceClick()
{
	TreeNode node = form.lyr1().Edit().lyrLocationDetail().tabPagePricing().trePricing().getSelectedNode();
	if (node == null)
		return;

	if (node.getParent() == null)
		return;

	form.getLocalContext().setSelectedLocationServiceActivity((LocationServiceActivityVo) node.getParent().getValue());
	form.getGlobalContext().Admin.setActivityContextPricingDetail((ActivityContextPricingDetailsVo) node.getValue());

	form.getGlobalContext().Admin.setLSAPricingAction(Integer.valueOf(PRICING_UPDATE));
	form.getGlobalContext().Admin.setActivityContextPricingDetailCollection(((LocationServiceActivityVo) node.getParent().getValue()).getActivityContextPricings());

	engine.open(form.getForms().Admin.ActivityContextPricingDetails);
}
 
Example 31
Project: AvoinApotti   File: OrgTreeHelper.java   Source Code and License 6 votes vote down vote up
private void populateLocations(LocMostVoCollection locations, TreeNode parentNode)
{
	if (locations == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locations.size(); i++)
	{
		LocMostVo voLoc = locations.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		Image img = voLoc.getIsActive().booleanValue() ? locImg: locDisImg;			
		
		//WDEV-6444 - if node is inactive disable drag dropping for that node
		if(voLoc.getIsActive().booleanValue() == false)
			locNode = parentNode.getNodes().add(voLoc, voLoc.getName());
		else
			locNode = parentNode.getNodes().add(voLoc, voLoc.getName(), LOC_NODE, new int[]{LS_NODE,LOC_NODE}, true);
		
		locNode.setCollapsedImage(img);
		locNode.setExpandedImage(img);	
		locNode.setCheckBoxVisible(showCheckBoxes);
		populateLocations(voLoc.getLocations().sort(), locNode);
	}		
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isPreviewNodeSelected()
{
	TreeNode node = form.treDetails().getSelectedNode();
	if (node == null)
		return false;
	Object value = node.getValue();
	if (value == null)
		return false;

	if (node.getValue() instanceof String)
	{
		String svalue = (String) node.getValue();
		return svalue.equals(previewNodeValue);
	}

	return false;
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private TreeNode add(TreeNode parentNode, OrgLiteVo organization)
{
	if (organization == null || organization.getName() == null)
		return null;

	if (!hasAllowedLocations(organization, engine.getLoggedInUser()))
	{
		return null;
	}

	TreeNode node;

	if (parentNode == null)
		node = form.treeLocation().getNodes().add(organization, organization.getName());
	else
		node = parentNode.getNodes().add(organization, organization.getName());

	node.setExpandedImage(form.getImages().Admin.Organisation);
	node.setCollapsedImage(form.getImages().Admin.Organisation);
	addLoadingNode(node);
	node.setExpanded(false);
	return node;
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addNewFolder()
{
	String folderName = getFavouriteFolderName();
	if(folderName != null && folderName.length() > 0)
	{
		TreeNode node = null;
		node = form.lyrTabs().tabPageFavourites().treFavourites().getNodes().add(null, folderName, true, 2);
		node.setCollapsedImage(form.getImages().Core.CollapseAll);
		node.setExpandedImage(form.getImages().Core.ExpandAll);
		form.lyrTabs().tabPageFavourites().treFavourites().beginEditSelectedNode();
		enableFavouritesContextMenu(false, form.lyrTabs().tabPageFavourites().isHeaderVisible());

		if(node != null)
			node.setCheckBoxVisible(false);
		if(form.getMode().equals(FormMode.VIEW))
			form.setMode(FormMode.EDIT);
	}
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void listSpecialties()
{
	form.treLeadCons().clear();
	SpecialtyCollection lkpCollSpecialties = LookupHelper.getSpecialty(domain.getLookupService());
	if (lkpCollSpecialties == null)
		return;
	
	for (int i=0; i < lkpCollSpecialties.size(); i++)
	{
		TreeNode nodeSpecialty=form.treLeadCons().getNodes().add(lkpCollSpecialties.get(i), lkpCollSpecialties.get(i).getText());	
		
		//put images for Specialty Node
		nodeSpecialty.setExpandedImage(form.getImages().Admin.Specialty01);
		nodeSpecialty.setCollapsedImage(form.getImages().Admin.Specialty01);
	}			
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addSection(TreeNode parentNode, AppTopButtonSectionVo value, boolean autoSelect) 
{
	if(parentNode != null && value != null)
	{
		String text = value.getText();
		if(text == null)
			text = " ";
		TreeNode node = parentNode.getNodes().add(value, text, autoSelect, SECTION_DRAGDROP_TYPE, new int[] { SECTIONS_DRAGDROP_TYPE }, true);
				
		node.setSelectedImage(form.getImages().Core.Organizer);
		node.setCollapsedImage(form.getImages().Core.Organizer);
		node.setExpandedImage(form.getImages().Core.Organizer);
		
		if(value.getButtons() != null)
		{
			AppTopButtonVoCollection buttons = value.getButtons();
			if(buttons != null)
			{
				for(int x = 0; x < buttons.size(); x++)
				{
					AppTopButtonVo button = buttons.get(x);						
					if(button != null)
					{
						addButton(node, button, autoSelect);
					}
				}
			}
		}
	}
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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);
	}
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateTreeNode(ProcedureLiteVoCollection procedureListForActivity) 
{
	if (procedureListForActivity!=null)
	{
		form.tre().getSelectedNode().getNodes().clear();
		for (int i=0;i<procedureListForActivity.size();i++)
		{
			TreeNode node = form.tre().getSelectedNode().getNodes().add(procedureListForActivity.get(i), procedureListForActivity.get(i).getProcedureName());
			node.setCollapsedImage(form.getImages().Core.BlueSquare);
		}
	}
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (form.getForms().Admin.NavigationImageSelectDialog.equals(formName) && DialogResult.OK.equals(result))
	{

		INavigationNode node = form.getGlobalContext().Admin.getNavigationEditedGroup();

		node.setTextNode(form.getGlobalContext().Admin.getNavigationEditedGroup().getTextNode());
		node.setImageNode(form.getGlobalContext().Admin.getNavigationEditedGroup().getImageNode());
		TreeNode editedNode = form.treNav().getSelectedNode();
		if (editedNode == null || !node.equals(editedNode.getValue()))
		{
			createNewTreeNode(node, editedNode);

		}
		else
		{
			editedNode.setCollapsedImage(node.getImageNode());
			editedNode.setText(node.getTextNode());
		}
		// if (editedNode == null)
		// return;

		Object savedValue = editedNode == null ? null : editedNode.getValue();
		populateTree(form.getLocalContext().getSelectedNav());
		form.treNav().setValue(savedValue);
		verifyQmbSearch();
		verifyQmbStart();
		updateControlsState();

	}

}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
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);

}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private TreeNode add(TreeNode parentNode, LocationLiteVo location)
{
	if (parentNode == null || location == null || location.getName() == null)
		return null;

	if (engine.getLocationProvider() != null && !engine.getLocationProvider().locationIsAllowed(location, engine.getLoggedInUser()) && !hasAllowedLocations(location, engine.getLoggedInUser()))
		return null;

	TreeNode node = parentNode.getNodes().add(location, location.getName());
	node.setExpandedImage(form.getImages().Admin.Location);
	node.setCollapsedImage(form.getImages().Admin.Location);
	addLoadingNode(node);
	node.setExpanded(false);
	return node;
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void overlayExistingSpecialties(SpecialtyCollection lkpCollSpecialties) 
{
	// Set the current templates..
	for(int i=0; i<lkpCollSpecialties.size(); i++)
	{
		TreeNode node = form.treAssociate().getNodeByValue(lkpCollSpecialties.get(i));
		if (node != null)
			node.setChecked(true);
	}

	
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void expandNodes(TreeNodeCollection nodes) 
{
	TreeNode node;
	for (int i = 0; nodes != null && i < nodes.size(); i++) 
	{
		node = nodes.get(i);
		if(node.isExpanded() == false)
			node.setExpanded(true);
		if(node.getNodes() != null && node.getNodes().size() > 0)
			expandNodes(node.getNodes());
	}
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * Handler for Tree Selection Changed event Retrieve the Short VO for
 * selected item, populate the local context and instance controls
 */
protected void onTreICPListTreeViewSelectionChanged(ims.framework.controls.TreeNode node) throws ims.framework.exceptions.PresentationLogicException
{
	// Set local context - selected item
	form.getLocalContext().setSelectedItem(domain.getItem(form.treICPList().getValue()));

	// Set local context - selected item parent
	if (node.getParent() != null)
	{
		form.getLocalContext().setSelectedItemParrent(domain.getItem(node.getParent().getValue()));
	}
	else
	{
		form.getLocalContext().setSelectedItemParrent(null);
	}

	// Set local context - selected ICP
	do
	{
		if (node.getValue() instanceof ICPRefVo)
			form.getLocalContext().setSelectedICP((ICPRefVo) node.getValue());

		node = node.getParent();
	}
	while (node != null);

	// Populate instance controls
	populateInstanceControls(form.getLocalContext().getSelectedItem());

	// Update controls state
	updateControlsState();
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onTreOrganisationSelectionChanged(TreeNode node) throws PresentationLogicException
{
	clearDetailControls();
	clearContextVariables();

	form.getContextMenus().getMosOrganisationEDITItem().setVisible(node.getValue() instanceof MemberOfStaffShortVo);

	if (node.getValue() instanceof LocSiteVo || node.getValue() instanceof LocMostVo)
	{
		populateMosForLocation((LocMostVo) node.getValue(), node);
	}

	else if (node.getValue() instanceof MemberOfStaffShortVo)
	{
		MemberOfStaffShortVo voMos = (MemberOfStaffShortVo) node.getValue();

		populateScreenFromMosVo(setContextVariables(voMos)); //WDEV-13921
		
		if (voMos.getHcpIsNotNull())
		{
			form.imbHCPDlg().setEnabledImage(form.cmbHcpDiciplineDetails().getValue().getCollapsedImage());
			form.imbHCPDlg().setDisabledImage(form.cmbHcpDiciplineDetails().getValue().getCollapsedImage());
			form.imbHCPDlg().setVisible(true);
		}
		else
		{
			form.imbHCPDlg().setVisible(false);
		}

	}
	else
	{
		form.getContextMenus().getMosOrganisationADDItem().setVisible(false);
	}

}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void clearChildren(TreeNodeCollection parentNodes) 
{
	TreeNode childNode;
	for(int i=0; parentNodes != null && i<parentNodes.size(); i++)
	{
		childNode = parentNodes.get(i);
		if(childNode.isChecked())
			childNode.setChecked(false);
		if(childNode.getNodes() != null && childNode.getNodes().size() > 0)
			clearChildren(childNode.getNodes());
	}
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void collapseNodes(TreeNodeCollection nodes)
{
	for (int i = 0; nodes != null && i < nodes.size(); i++)
	{
		TreeNode node = nodes.get(i);
		if (node.isExpanded())
			node.setExpanded(false);
		if (node.getNodes() != null && node.getNodes().size() > 0)
			collapseNodes(node.getNodes());
	}
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createNewInstance()
{
	clearInstanceDetails();
	LookupInstVo vo = new LookupInstVo();
	TreeNode rootNode = getRootNode();
	if (rootNode == null)
	{
		engine.showMessage("Please select lookup list name or parent.");//wdev-3191
		return;
	}
	LookupInstVo inst = form.getLocalContext().getLookupInstance();

	LookupTypeVo typeVo = getTypeFromInstNode(rootNode);
	populateParentCombo(false);
	if (inst != null && typeVo.isHierarchical())
	{
		vo.setParentInstance(inst);
		form.lyr1().Instance().cmbParent().setValue(inst);
		form.lyr1().Instance().cmbParent().setVisible(true);
		form.lyr1().Instance().lblParent().setVisible(true);
	}
	vo.setOrder(rootNode.getNodes().size());
	form.getLocalContext().setLookupInstance(vo);
	form.lyr1().showInstance();
	setFormMode(FormMode.EDIT);
	form.lyr1().Instance().txtInstText().setFocus();
	form.lyr1().Instance().txtInstText().setEnabled(true);
	form.lyr1().Instance().cmbColor().setEnabled(true);
	form.lyr1().Instance().cmbParent().setEnabled(true);
	form.lyr1().Instance().qmbImage().setEnabled(true);			
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateMosForLocation(LocMostVo voLoc, TreeNode node)
{
	clearMosNodes(node);
	MemberOfStaffShortVoCollection voCollMos = domain.listMosForLocation(voLoc);

	TreeNode newNode;
	for (int i = 0; i < voCollMos.size(); i++)
	{
		MemberOfStaffShortVo mosVo = voCollMos.get(i);
		newNode = node.getNodes().add(mosVo, mosVo.getName().toString());

		if (mosVo.getHcpIsNotNull() && mosVo.getHcp().getHcpTypeIsNotNull())
		{
			if (mosVo.getHcp().getHcpType().getParent() == null)
			{
				newNode.setCollapsedImage(mosVo.getHcp().getHcpType().getImage() == null ? form.getImages().Admin.StaffBlack : mosVo.getHcp().getHcpType().getImage());
				newNode.setExpandedImage(mosVo.getHcp().getHcpType().getImage() == null ? form.getImages().Admin.StaffBlack : mosVo.getHcp().getHcpType().getImage());
			}
			else
			{
				newNode.setCollapsedImage(mosVo.getHcp().getHcpType().getParent().getImage() == null ? form.getImages().Admin.StaffBlack : mosVo.getHcp().getHcpType().getParent().getImage());
				newNode.setExpandedImage(mosVo.getHcp().getHcpType().getParent().getImage() == null ? form.getImages().Admin.StaffBlack : mosVo.getHcp().getHcpType().getParent().getImage());
			}
		}
		else
		{
			newNode.setCollapsedImage(form.getImages().Admin.StaffBlack);
			newNode.setExpandedImage(form.getImages().Admin.StaffBlack);
		}
	}
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private int getNoOfSections()
{
	TreeNode node = getSectionsNode();
	if(node == null)
		return 0;
	return node.getNodes().size();
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onTreInvApptsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
	form.getContextMenus().RefMan.getBookAppointmentREBOOK_APPTItem().setVisible(false);
	if(form.getMode().equals(FormMode.VIEW))
	{
		if(node != null)
		{
			if(node.getValue() instanceof BookingAppointmentLiteVo &&  node.getParent().equals(form.treInvAppts().getNodeByValue(REBOOK_APPT_NODE)))
				form.getContextMenus().RefMan.getBookAppointmentREBOOK_APPTItem().setVisible(true);
		}			
	}
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void collapseNodes(TreeNodeCollection nodes) 
{
	for(int i=0; nodes != null && i<nodes.size(); i++)
	{
		TreeNode node = nodes.get(i);
		if(node.isExpanded())
			node.setExpanded(false);
		if(node.getNodes() != null && node.getNodes().size() > 0)
			collapseNodes(node.getNodes());
	}
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private LocSvcProviderSysVo getSelectedProvider()
{
	TreeNode node = form.treHeader().getSelectedNode();
	if (node != null)
	{
		Object value = node.getValue();
		if (value instanceof LocSvcProviderSysVo)
			return (LocSvcProviderSysVo) value;
	}
	return null;
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isAddAllowed()
{
	//LocationServiceVo voLocationService = getSelectedLocation();

	TreeNode node = form.treHeader().getSelectedNode();
	if (node != null)
	{
		return true;
		//return node.getNodes().size() == 0 && voLocationService != null && voLocationService.getLocationIsNotNull() && voLocationService.getLocation().getTypeIsNotNull() && (voLocationService.getLocation().getType().equals(LocationType.PATHOLOGYLABORATORY) || voLocationService.getLocation().getType().equals(LocationType.CLINICALIMAGINGDEPARTMENT));
	}
	return false;
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onTreNavTreeViewNodeEdited(ims.framework.controls.TreeNode node) throws ims.framework.exceptions.PresentationLogicException
{
	// As there is no way to limit the text in the ui node we do a trim
	if (node.getText().length() > 50)
	{
		node.setText(node.getText().substring(0, 50));

	}

	((INavigationNode) node.getValue()).setTextNode(node.getText());

	setContextMenuItems(form.getMode());
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void loadData(TreeNode parentNode, LocationLiteVo location)
{
	if (parentNode == null || location == null)
		return;

	LocationLiteVoCollection locations = domain.listLocationsByLocation(location);
	if (locations != null)
	{
		for (int x = 0; x < locations.size(); x++)
		{
			if (locations.get(x).getIsActive() == true)
				add(parentNode, locations.get(x));
		}
	}
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onTreTypesTreeViewSelectionChanged(ims.framework.controls.TreeNode node) 
{
	Object obj = node.getValue();
	if (obj instanceof LookupTypeVo)
	{
		clearTypeDetails();
		populateTypeDetails((LookupTypeVo) obj);
		form.lyr1().showType();
		enableTypeItemsOnSelection(node);
		form.getLocalContext().setLookupType((LookupTypeVo) obj);
		form.getLocalContext().setLookupInstance(null);
	}
	else if (obj instanceof LookupInstVo)
	{
		clearInstanceDetails();
		LookupInstVo inst = (LookupInstVo) obj;
		form.getLocalContext().setLookupInstance(inst);
		LookupTypeVo type = this.getTypeFromInstNode(node);
		form.getLocalContext().setLookupType(type);

		populateInstanceDetails(inst);
		form.lyr1().showInstance();
		enableInstanceItemsOnSelection(node);
	}
	if (!form.lyr1().Forms().isVisible())
		form.btnSearch().setAsDefaultButton();
	updateControlsState();
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addNewFolder()
{
	String folderName = getFavouriteFolderName();
	if(form.btnSelect().isEnabled())
	{
		form.btnSelect().setEnabled(false);
		
	}
	if (folderName != null && folderName.length() > 0)
	{
		TreeNode node = null;
		node = form.lyr1().tabFavourites().treFavourites().getNodes().add(null, folderName, true, 2);
		node.setCollapsedImage(form.getImages().Core.CollapseAll);
		node.setExpandedImage(form.getImages().Core.ExpandAll);
		form.lyr1().tabFavourites().treFavourites().beginEditSelectedNode();
		enableFavouritesContextMenu(false, form.lyr1().tabFavourites().isHeaderVisible());

		if (node != null)
			node.setCheckBoxVisible(false);

		if (form.getMode().equals(FormMode.VIEW))
			form.setMode(FormMode.EDIT);

		if (form.lyr1().tabFavourites().isHeaderVisible() == false)
			form.lyr1().tabFavourites().setHeaderVisible(true);

		form.lyr1().showtabFavourites();
	}
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private TreeNode getButtonsNode()
{
	for(int x = 0; x < form.treItems().getNodes().size(); x++)
	{
		if(form.treItems().getNodes().get(x).getValue() != null && form.treItems().getNodes().get(x).getValue().equals(BUTTONS_NODE_TAG))
		{
			return form.treItems().getNodes().get(x);
		}
	}
	
	return null;
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addSegment(TreeNode parentNode, String segment)
{
	TreeNode node = parentNode.getNodes().add(segment, segment);
	node.setCollapsedImage(form.getImages().Admin.Activity);
	node.setExpandedImage(form.getImages().Admin.Activity);
	StringTokenizer st = new StringTokenizer(segment, "" + form.getLocalContext().getSepsArray()[FIELD_SEP]);
	while (st.hasMoreTokens())
	{
		String field = st.nextToken();
		addField(node, field);
	}		
}