Java Code Examples for ims.framework.controls.TreeNode.setEnabled()

The following are Jave code examples for showing how to use setEnabled() of the ims.framework.controls.TreeNode class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void displayAmbiguity(IAddress[] listAddressAmbiguity) 
{
	
       int i;
       int len;
       
       if (listAddressAmbiguity == null || ((len = listAddressAmbiguity.length) == 0)) {
           return;
       }        
       
       for (i = 1; i < len; i++)
       {        	
       	TreeNode treenode = form.treAmbig().getNodes().add(i, listAddressAmbiguity[i].getAddressBuildingNumber()==null?"":listAddressAmbiguity[i].getAddressBuildingNumber().toString(),false);
       	treenode.setEnabled(true);
       }
       		
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
/**
 * This will expand the node by getting the IHotlist based on the node id and current CciType.
 * It will then list the IHotlistItems below
 * @param TreeNode
 * @return void
 */
private void expandNode(TreeNode node)
{
	if (node == null) return;
	
	if ( node.isExpanded() )
	{
		IHotlistShort val = (IHotlistShort) node.getValue();
		IHotlist item = domain.getIHotlist(val.getIHotlistShortID(), form.getLocalContext().getcurrentCciType());
		
		node.setValue(item);
		form.getLocalContext().setSelectedHotlist((IHotlist) node.getValue());			
		node.getNodes().clear();
		
		for ( int i = 0; i < item.getIHotlistItems().length; i++ )
		{
			TreeNode child = node.getNodes().add(item.getIHotlistItems()[i], item.getIHotlistItems()[i].getIGenericItem().getIGenericItemInfoName());
			setNodeImage(child, Color.Blue);
			child.setEnabled(node.isEnabled());
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void populateServiceActivities(TreeNode node, LocationServiceVoCollection voLocationServices)
{
	TreeNode childActivityNode = null;
	TreeNode childFunctionNode = null;

	clearServiceNodes(node);

	for (int i = 0; i < voLocationServices.size(); i++)
	{
		if (voLocationServices.get(i).getServiceIsNotNull())
		{
			node.setValue(voLocationServices.get(i));
			for (int j = 0; j < voLocationServices.get(i).getActivities().size(); j++)
			{
				childActivityNode = node.getNodes().add(voLocationServices.get(i).getActivities().get(j), (voLocationServices.get(i).getActivities().get(j).getServiceActivityIsNotNull() ? voLocationServices.get(i).getActivities().get(j).getServiceActivity().getActivity().toString() : ""));
				childActivityNode.setExpandedImage(voLocationServices.get(i).getActivities().get(j).getIsActiveIsNotNull() ? (voLocationServices.get(i).getActivities().get(j).getIsActive().booleanValue() ? form.getImages().Admin.Activity : form.getImages().Admin.ActivityInactive) : form.getImages().Admin.Activity);
				childActivityNode.setCollapsedImage(voLocationServices.get(i).getActivities().get(j).getIsActiveIsNotNull() ? (voLocationServices.get(i).getActivities().get(j).getIsActive().booleanValue() ? form.getImages().Admin.Activity : form.getImages().Admin.ActivityInactive) : form.getImages().Admin.Activity);
				childActivityNode.setSelectedImage(voLocationServices.get(i).getActivities().get(j).getIsActiveIsNotNull() ? (voLocationServices.get(i).getActivities().get(j).getIsActive().booleanValue() ? form.getImages().Admin.Activity : form.getImages().Admin.ActivityInactive) : form.getImages().Admin.Activity);
				childActivityNode.setEnabled(false);
			}
			for (int j = 0; j < voLocationServices.get(i).getFunctions().size(); j++)
			{
				childFunctionNode = node.getNodes().add(voLocationServices.get(i).getFunctions().get(j), (voLocationServices.get(i).getFunctions().get(j).getServiceFunctionIsNotNull() ? voLocationServices.get(i).getFunctions().get(j).getServiceFunction().getFunction().getText() : ""));
				childFunctionNode.setExpandedImage(voLocationServices.get(i).getFunctions().get(j).getIsActiveIsNotNull() ? (voLocationServices.get(i).getFunctions().get(j).getIsActive().booleanValue() ? form.getImages().Admin.Activity : form.getImages().Admin.ActivityInactive) : form.getImages().Admin.Activity);
				childFunctionNode.setCollapsedImage(voLocationServices.get(i).getFunctions().get(j).getIsActiveIsNotNull() ? (voLocationServices.get(i).getFunctions().get(j).getIsActive().booleanValue() ? form.getImages().Admin.Activity : form.getImages().Admin.ActivityInactive) : form.getImages().Admin.Activity);
				childFunctionNode.setSelectedImage(voLocationServices.get(i).getFunctions().get(j).getIsActiveIsNotNull() ? (voLocationServices.get(i).getFunctions().get(j).getIsActive().booleanValue() ? form.getImages().Admin.Activity : form.getImages().Admin.ActivityInactive) : form.getImages().Admin.Activity);
				childFunctionNode.setEnabled(false);

			}
			node.sortChildrenByText();
			if (null != childActivityNode)
				childActivityNode.setExpanded(true);
			if (null != childFunctionNode)
				childFunctionNode.setExpanded(true);
		}
	}

	node.setExpanded(true);
	form.lyr1().Details().htmDetails().setHTML(getDetailsAsTextile(node.getParent()));
}
 
Example 4
Project: AvoinApotti   File: OrgTreeHelper.java   Source Code and License Vote up 5 votes
private void populateOrgs(OrganisationVoCollection voColl, TreeNode parentNode, boolean disableOrgNodes)
{
	if (voColl == null)
		return;

	for (int i = 0; i < voColl.size(); i++)
	{
		OrganisationVo voOrg = voColl.get(i);
		if (voOrg.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		TreeNode orgNode = null;
		if (parentNode == null)
		{
			//WDEV-6444 - if node is inactive disable drag dropping for that node
			if(voOrg.getIsActive().booleanValue() == false)
				orgNode = tree.getNodes().add(voOrg, voOrg.getName());
			else
				orgNode = tree.getNodes().add(voOrg, voOrg.getName(), ORG_NODE, new int[]{ROOT, ORG_NODE}, true);
		}
		else
			orgNode = parentNode.getNodes().add(voOrg, voOrg.getName(), ORG_NODE, new int[]{ROOT, ORG_NODE}, true);
		Image img = voOrg.getIsActive().booleanValue() ? orgImg : orgDisImg;			
		orgNode.setCollapsedImage(img);
		orgNode.setExpandedImage(img);
		orgNode.setEnabled(!disableOrgNodes);
		
		populateOrgs(voOrg.getRelatedOrganisations().sort(), orgNode, disableOrgNodes);
		populateLocSites(voOrg.getLocationSites().sort(), orgNode);
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private void populateGPPracticeParents(GPLiteWithPracticesVo voGp)
{
	clear();
	String gMCCode=null;
	
	if (voGp != null)
	{
		if(voGp.getCodeMappingsIsNotNull())
		{
			gMCCode=voGp.getCodeMappings().getMappingValue(TaxonomyType.NAT_GP_CODE);
		}
		if (voGp.getPractices() == null || voGp.getPractices().size() <= 0)
		{
			engine.showMessage("The GP has no associated practices.");
			return;
		}

		// populate the gp's practices on the tree
		for (int j = 0; j < voGp.getPractices().size(); j++)
		{
			GpPracticeLiteVo practice = voGp.getPractices().get(j).getPractice();
			
			if (practice != null && practice.getIsActiveIsNotNull() && practice.getIsActive().equals(Boolean.TRUE))
			{
				TreeNode node = form.trePracticesSurgeries().getNodes().add(practice, practice.getName() + displayPracticeAddress(practice.getAddress()), j + 1);
				
				if (ConfigFlag.DOM.GP_USE_SURGERIES.getValue()) // only list surgeries if config flag allows
				{
					node.setEnabled(false);
					populateSurgeryChildren(practice, node,gMCCode);
				}
				else
				{
					node.setEnabled(true);
				}
				
			}
		}
		form.trePracticesSurgeries().collapseAll();
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
protected void onBtnUpdateClick() throws PresentationLogicException
{
	form.setMode(FormMode.EDIT);
	displaySubmenus();
	hideNewUpdate();
	showSpecialtyControls(false);
	
	TreeNode selectedNode = form.treConfig().getSelectedNode();
	TreeNode nodeParentOfSelectedNode = selectedNode;
	
	if (selectedNode != null && selectedNode.getParent() != null) //If not the top level node chosen
	{
		nodeParentOfSelectedNode = selectedNode.getParent(); // See if the 
		if (nodeParentOfSelectedNode.getParent() != null)
			nodeParentOfSelectedNode = nodeParentOfSelectedNode.getParent();
	}
	
	for (int i = 0 ; i < form.treConfig().getNodes().size() ; i++)
	{
		if ( (!form.treConfig().getNodes().get(i).equals(selectedNode) )
				&& ( !form.treConfig().getNodes().get(i).equals(nodeParentOfSelectedNode)) )
		{
			TreeNode nodeSpecialtyOrTopNode = form.treConfig().getNodes().get(i); 
			nodeSpecialtyOrTopNode.setEnabled(false);
			
			if (nodeSpecialtyOrTopNode.getNodes().size() > 0)
			{
				for (int j = 0 ; j < nodeSpecialtyOrTopNode.getNodes().size() ; j++)
				{
					TreeNode nodeDiagProcOrConfigItem  =  nodeSpecialtyOrTopNode.getNodes().get(j);
					nodeDiagProcOrConfigItem.setEnabled(false);
					
					if (nodeDiagProcOrConfigItem.getNodes().size() > 0)
					{
						for (int k = 0 ; k < nodeDiagProcOrConfigItem.getNodes().size() ; k++)
							nodeDiagProcOrConfigItem.getNodes().get(k).setEnabled(false);
					}
				}
			}
		}
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
protected void onBtnAddSpecialtyClick() throws PresentationLogicException 
{
	if (form.cmbSpecialty().getValue() != null)
	{
		PMHChecklistConfigVo config = new PMHChecklistConfigVo();
		config.setSpecialty(form.cmbSpecialty().getValue());

		for(int i = 0; i < form.treConfig().getNodes().size(); i++)
		{
			Object obj = form.treConfig().getNodes().get(i).getValue();
			if ((obj != null) && (obj instanceof PMHChecklistConfigShortVo))
			{
				PMHChecklistConfigShortVo configVo = (PMHChecklistConfigShortVo) obj;
				if ( (configVo.getSpecialtyIsNotNull()) 
					&& (configVo.getSpecialty().equals(form.cmbSpecialty().getValue())) )
				{
					engine.showMessage("This Specialty is already configured.");
					return;
				}
			}
		}
	
		for(int j = 0; j < form.treConfig().getNodes().size(); j++)
		{
			TreeNode nodeSpec = form.treConfig().getNodes().get(j);
			nodeSpec.setEnabled(false);
			for(int k = 0; k < nodeSpec.getNodes().size(); k++)
			{
				TreeNode nodeCat =  nodeSpec.getNodes().get(k);
				nodeCat.setEnabled(false);

				for(int l = 0; l < nodeCat.getNodes().size(); l++)
					nodeCat.getNodes().get(l).setEnabled(false);
				
			}
		}

		TreeNode node = form.treConfig().getNodes().add(config, config.getSpecialty().getText());
		node.setExpandedImage(form.getImages().Core.RedSqaure);
		node.setCollapsedImage(form.getImages().Core.RedSqaure);
		node.setSelectedImage(form.getImages().Core.RedSqaure);

		form.treConfig().setValue(config);
		form.getLocalContext().setCurrentConfig(config);
		
		form.treConfig().setEnabled(true);

		displayRecord(config);

		showSpecialtyControls(false);
		updateContextMenuState();
	}
	else
	{
		engine.showMessage("Select a Specialty");
	}
}