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

The following are Jave code examples for showing how to use setExpanded() 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 populateLocationServices(TreeNode node, LocShortVo voLocation)
{
	LocationServiceMidVoCollection voLocationServices;
	voLocationServices = domain.listLocationServiceLite(voLocation);
	TreeNode childServiceNode = null;
	clearServiceNodes(node);
	for (int i = 0; i < voLocationServices.size(); i++)
	{
		if (voLocationServices.get(i).getServiceIsNotNull())
		{
			childServiceNode = node.getNodes().add(voLocationServices.get(i), (voLocationServices.get(i).getService().getServiceNameIsNotNull() ? voLocationServices.get(i).getService().getServiceName() : ""));
			childServiceNode.setTooltip(formatLocationServicevoTooltip(voLocationServices.get(i)));
			childServiceNode.setExpandedImage(voLocationServices.get(i).getIsActiveIsNotNull() ? (voLocationServices.get(i).getIsActive().booleanValue() ? form.getImages().Admin.Service : form.getImages().Admin.ServiceInactive) : form.getImages().Admin.Service);
			childServiceNode.setCollapsedImage(voLocationServices.get(i).getIsActiveIsNotNull() ? (voLocationServices.get(i).getIsActive().booleanValue() ? form.getImages().Admin.Service : form.getImages().Admin.ServiceInactive) : form.getImages().Admin.Service);
			childServiceNode.setSelectedImage(voLocationServices.get(i).getIsActiveIsNotNull() ? (voLocationServices.get(i).getIsActive().booleanValue() ? form.getImages().Admin.Service : form.getImages().Admin.ServiceInactive) : form.getImages().Admin.Service);
			childServiceNode.sortChildrenByText();
			childServiceNode.setExpanded(false);
		}
	}

	node.setExpanded(true);

	form.lyr1().Details().chkHTMLActiveOnly().setValue(true);
	form.lyr1().Details().htmDetails().setHTML(getDetailsAsTextile(node));

}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void loadClassificationTree() 
{
	QuestionClassificationCollection classColl = LookupHelper.getQuestionClassification(domain.getLookupService());
	form.lyrSearch().tabPageClassification().treClassification().clear();
	//Load top parents
	LookupInstVo[] roots = classColl.getRoots();
	for(int i=0; roots != null && i<roots.length; i++)
	{
		TreeNode nodeClass 	   = form.lyrSearch().tabPageClassification().treClassification().getNodes().add(roots[i], roots[i].toString());
		nodeClass.setExpanded(false);
		nodeClass.setCheckBoxVisible(true);
		loadChildren(nodeClass, roots[i]);
		
		TreeNode nodeTextClass = form.lyrSearch().tabPageTextClass().treTextAndClass().getNodes().add(roots[i], roots[i].toString());
		nodeTextClass.setExpanded(true);
		nodeTextClass.setCheckBoxVisible(false);
		loadChildren(nodeTextClass, roots[i]);
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void loadClassificationTree()
{
	form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().clear();
	/*if (isPrimaryQuestion() == false)
		return;*/
	QuestionClassificationCollection classColl = LookupHelper.getQuestionClassification(domain.getLookupService());
	// Load top parents
	LookupInstVo[] roots = classColl.getRoots();
	for (int i = 0; roots != null && i < roots.length; i++)
	{
		TreeNode node = form.lyrTabs().tabNewQuestion().lyrDetails().tabClasification().treClassification().getNodes().add(roots[i], roots[i].toString());
		node.setExpanded(true);
		node.setCheckBoxVisible(false);
		loadChildren(node, roots[i]);
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 5
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void populateSites(TumourSiteListVoCollection collection, TreeNode categoryNode) 
{
	if (collection == null)
		return;
	
	TreeNode siteNode = null;
	for(int i=0; i < collection.size(); i++)
	{
		TumourSiteListVo voSite = collection.get(i);
		
		if (voSite.getIsActive().booleanValue() == false && showActive())
			continue;
		
		Image img = voSite.getIsActive().booleanValue() ? form.getImages().Clinical.BlueSphere : form.getImages().Clinical.BlueSphere;			
		siteNode = categoryNode.getNodes().add(voSite, voSite.getName());
		siteNode.setCollapsedImage(img);
		siteNode.setExpandedImage(img);
		siteNode.setExpanded(true);
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 7
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void populateICPTree(ICPConfigurationDisplayVo displayICP, String filterValue)
{
	// Clear tree
	form.treICP().clear();
	
	// If the ICP is null terminate the function
	if (displayICP == null)
		return;
	
	// Create root node for the ICP (not selectable)
	TreeNode rootNode = form.treICP().getNodes().add(displayICP, displayICP.getName());
	rootNode.setCheckBoxVisible(false);

	// Set node images
	rootNode.setCollapsedImage(form.getImages().ICP.ICP);
	rootNode.setExpandedImage(form.getImages().ICP.ICP);
	rootNode.setSelectedImage(form.getImages().ICP.ICP);
	
	// Add ICP Stages
	populateICPStages(rootNode, displayICP.getStages(), filterValue);
	
	// Expand the node
	rootNode.setExpanded(true);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
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 9
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void expandNodes(TreeNodeCollection nodes)
{
	for (int i = 0; nodes != null && i < nodes.size(); i++)
	{
		TreeNode node = nodes.get(i);
		if (node.isExpanded() == false)
			node.setExpanded(true);
		if (node.getNodes() != null && node.getNodes().size() > 0)
			expandNodes(node.getNodes());
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void loadClassificationTree() 
{
	QuestionClassificationCollection classColl = LookupHelper.getQuestionClassification(domain.getLookupService());
	form.treClassification().clear();
	//Load top parents
	LookupInstVo[] roots = classColl.getRoots();
	for(int i=0; roots != null && i<roots.length; i++)
	{
		TreeNode node = form.treClassification().getNodes().add(roots[i], roots[i].toString());
		node.setExpanded(true);
		node.setCheckBoxVisible(false);
		loadChildren(node, roots[i]);
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
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 12
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void expandNodes(TreeNodeCollection nodes) 
{
	for (int i = 0; nodes != null && i < nodes.size(); i++) 
	{
		TreeNode node = nodes.get(i);
		if(node.isExpanded() == false)
			node.setExpanded(true);
		if(node.getNodes() != null && node.getNodes().size() > 0)
			expandNodes(node.getNodes());
	}
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
/**
 * Function used to populate tree with an ICP list
 * 
 * @param listICP
 */
private void populateTreeICPNodes(ICPLiteVoCollection listICP)
{
	// Clear tree
	form.treICPList().clear();

	// Check ICP list - exit function if list is null or zero length
	if (listICP == null || listICP.size() == 0)
		return;

	// Iterate the ICP list
	for (ICPLiteVo icp : listICP)
	{
		// Skip null ICPs
		if (icp == null)
			continue;

		// Add ICP value to tree
		TreeNode node = form.treICPList().getNodes().add(icp, icp.getName());

		// Set node images, gray text for inactive ICP, collapse node and
		// add mock node
		node.setCollapsedImage(form.getImages().ICP.ICP);
		node.setExpandedImage(form.getImages().ICP.ICP);

		if (PreActiveActiveInactiveStatus.INACTIVE.equals(icp.getStatus()))
		{
			node.setTextColor(Color.Gray);
		}

		node.setExpanded(false);

		node.getNodes().add(null, "Loading...");

		// Set node as not expanded
		node.setIdentifier(null);
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
/**
 * Function used to populate tree with a full ICP (Stages, Phases, Actions)
 * Used in open function
 */
private void populateTreeFullICP(ICPConfigurationDisplayVo displayICP)
{
	// Clear tree
	form.treICPList().clear();

	// Terminate the function if the ICP is null
	if (displayICP == null)
		return;

	// Add ICP value to tree
	TreeNode node = form.treICPList().getNodes().add((ICPLiteVo) displayICP, displayICP.getName());

	// Set node images, gray text for inactive ICP, collapse node and add
	// stage nodes
	node.setCollapsedImage(form.getImages().ICP.ICP);
	node.setExpandedImage(form.getImages().ICP.ICP);

	if (PreActiveActiveInactiveStatus.INACTIVE.equals(displayICP.getStatus()))
	{
		node.setTextColor(Color.Gray);
	}

	populateTreeFullICPStages(node, displayICP.getStages());

	node.setExpanded(true);
	node.setIdentifier(EXPANDED);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
/**
 * @param voCollMosOrgLoc
 * @param newNode
 */
private void showOrgForMos(MosOrgLocVoCollection voCollMosOrgLoc, TreeNode mosNode)
{
	mosNode.getNodes().clear();
	for (int i = 0; i < voCollMosOrgLoc.size(); i++)
	{
		MosOrgLocVo vo = voCollMosOrgLoc.get(i);
		TreeNode orgNode = mosNode.getNodes().add(vo.getOrganisation(), vo.getOrganisation().getName());
		orgNode.setCollapsedImage(form.getImages().Admin.Organisation);
		HCPLocationLiteVo.mixedSort(vo.getHCPLocations());
		for (int j = 0; j < vo.getHCPLocations().size(); j++)
		{
			HCPLocationLiteVo locVo = vo.getHCPLocations().get(j);

			StringBuffer sb = new StringBuffer();
			sb.append(locVo.getLocation().getName());
			sb.append(locVo.getAccreditationStatusIsNotNull() ? " ," + locVo.getAccreditationStatus().toString() : "");

			TreeNode locNode = orgNode.getNodes().add(locVo, sb.toString());
			if (j == 0)
				locNode.setExpanded(true);

			if (locVo.getLocation() instanceof LocSiteVo || locVo.getLocation() instanceof LocSiteShortVo)
			{
				locNode.setCollapsedImage(form.getImages().Admin.LocationSite);
				locNode.setExpandedImage(form.getImages().Admin.LocationSite);
			}
			else
			{
				locNode.setCollapsedImage(form.getImages().Admin.Location);
				locNode.setExpandedImage(form.getImages().Admin.Location);
			}
		}
	}

}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void populateTreeStages(TreeNode node, ICPStageDisplayVoCollection stageCollection)
{
	// Clear the nodes
	node.getNodes().clear();
	
	// Terminate function if collection is null
	if (stageCollection == null)
		return;
	
	// Sort stage collection after sequence
	stageCollection.sort(new StageComparator());
	
	for (int i = 0; i < stageCollection.size(); i++)
	{
		ICPStageDisplayVo stage = stageCollection.get(i);
		
		// Skip null stages
		if (stage == null)
			continue;
		
		// Add stage node to ICP
		TreeNode stageNode = node.getNodes().add(stage, stage.getName() + " (" + stage.getID_ICPStage().toString() + ")");
		
		// Set node images, gray text for inactive
		stageNode.setCollapsedImage(form.getImages().ICP.Stage);
		stageNode.setExpandedImage(form.getImages().ICP.Stage);
		
		if (PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()))
		{
			stageNode.setTextColor(Color.Gray);
		}
		
		// Populate node phase
		populateTreePhases(stageNode, stage.getPhases());
		
		stageNode.setExpanded(true);
	}
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private TreeNode add(TreeNode parentNode, LocSiteLiteVo locationSite)
{
	if (parentNode == null || locationSite == null || locationSite.getName() == null)
		return null;

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

	TreeNode node = parentNode.getNodes().add(locationSite, locationSite.getName());
	node.setExpandedImage(form.getImages().Admin.LocationSite);
	node.setCollapsedImage(form.getImages().Admin.LocationSite);
	addLoadingNode(node);
	node.setExpanded(false);
	return node;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private void populateICPStages(TreeNode rootNode, ICPStageDisplayVoCollection stages, String filterValue)
{
	// Terminate function if stage collection is null
	if (stages == null)
		return;
	
	// Sort stages
	stages.sort(new StageComparator());
	
	for (int i = 0; i < stages.size(); i++)
	{
		ICPStageDisplayVo stage = stages.get(i);
		
		if (stage == null)
			continue;
		
		// Add stage to root node
		TreeNode stageNode = rootNode.getNodes().add(stage, stage.getName());
		stageNode.setCheckBoxVisible(false);
		stageNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) ? Color.Gray : Color.Black);
		
		// Set node images
		stageNode.setCollapsedImage(form.getImages().ICP.Stage);
		stageNode.setExpandedImage(form.getImages().ICP.Stage);
		stageNode.setSelectedImage(form.getImages().ICP.Stage);
		
		// Add ICP Phases
		populateICPPhases(stageNode, stage.getPhases(), filterValue);
		
		// Check to see if the node has child, else remove it
		if (filterValue == null || stageNode.getNodes().size() > 0)
		{			
   			// Expand the node
   			stageNode.setExpanded(true);
		}
		else
		{
			rootNode.getNodes().remove(stageNode);
		}
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private void populateICPPhases(TreeNode stageNode, ICPPhaseDisplayVoCollection phases, String filterValue)
{
	// Terminate function if phase collection is null
	if (phases == null)
		return;
	
	// Sort phases
	phases.sort(new PhaseComparator());
	
	for (int i = 0; i < phases.size(); i++)
	{
		ICPPhaseDisplayVo phase = phases.get(i);
		
		if (phases == null)
			continue;
		
		// Add phase to stage node
		TreeNode phaseNode = stageNode.getNodes().add(phase, phase.getName());
		phaseNode.setCheckBoxVisible(false);
		phaseNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
		
		// Set node images
		phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
		phaseNode.setExpandedImage(form.getImages().ICP.Phase);
		phaseNode.setSelectedImage(form.getImages().ICP.Phase);
		
		// Add ICP Actions
		populateICPActions(phaseNode, phase.getActions(), filterValue);
		
		// Check to see if the node has child, else remove it
		if (filterValue == null || phaseNode.getNodes().size() > 0)
		{
			// Expand the node
			phaseNode.setExpanded(true);
		}
		else
		{
			stageNode.getNodes().remove(phaseNode);
		}
	}
	
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private void initialiseClinicalData()
{
	form.lyrDetails().tabRecipents().treCDI().clear();
	
	//patient problems
	PatientProblemVoCollection listProblems = domain.listProblemsByPatient(form.getGlobalContext().Core.getPatientShort());

	TreeNode parent = form.lyrDetails().tabRecipents().treCDI().getNodes().add(problemsString, problemsString);
	parent.setCollapsedImage(form.getImages().COE.BlueViolet);
	parent.setExpandedImage(form.getImages().COE.BlueViolet);
	parent.setExpanded(true);
	parent.setCheckBoxVisible(false);

	for (int i = 0; i < listProblems.size(); i++)
	{
		PatientProblemVo problem = listProblems.get(i);

		parent.getNodes().add(problem, problem.getPatientProblem());
	}
	
	//patient diagnosis
	PatientDiagnosisShortVoCollection listDiagnosis = domain.listDiagnosisComplicationsByPatient(form.getGlobalContext().Core.getPatientShort());

	parent = form.lyrDetails().tabRecipents().treCDI().getNodes().add(diagnosisString, diagnosisString);
	parent.setCollapsedImage(form.getImages().COE.Blue);
	parent.setExpandedImage(form.getImages().COE.Blue);
	parent.setExpanded(true);
	parent.setCheckBoxVisible(false);

	for (int i = 0; i < listDiagnosis.size(); i++)
	{
		PatientDiagnosisShortVo diagnosis = listDiagnosis.get(i);

		parent.getNodes().add(diagnosis, diagnosis.getDiagnosisDescription());
	}

	//patient procedures
	PatientProcedureShortVoCollection listProcedures = domain.listProceduresByPatient(form.getGlobalContext().Core.getPatientShort());

	parent = form.lyrDetails().tabServices().treProcedure().getNodes().add(proceduresString, proceduresString);
	parent.setCollapsedImage(form.getImages().COE.DarkCyan);
	parent.setExpandedImage(form.getImages().COE.DarkCyan);
	parent.setExpanded(true);
	parent.setCheckBoxVisible(false);

	for (int i = 0; i < listProcedures.size(); i++)
	{
		PatientProcedureShortVo procedure = listProcedures.get(i);

		parent.getNodes().add(procedure, procedure.getProcedureDescription());
	}
	
}