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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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);

}