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

The following are Jave code examples for showing how to use setCheckBoxVisible() 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 displayAllClinics()
{			 				
	if (form.getLocalContext().getClinics() == null) return;		
	ClinicLiteVoCollection voCollClinics = form.getLocalContext().getClinics();
	
	TreeNode node = null;

	form.treAssociate().clear();										
	for(int i=0;i<voCollClinics.size();i++)
	{
		node = form.treAssociate().getNodes().add(voCollClinics.get(i), voCollClinics.get(i).getClinicName());
		node.setCheckBoxVisible(form.getMode().equals(FormMode.EDIT));
		node.setCollapsedImage(form.getImages().Admin.Location);
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 3
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 4
Project: AvoinApotti   File: OrgTreeHelper.java   Source Code and License Vote up 6 votes
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 5
Project: AvoinApotti   File: OrgTreeHelper.java   Source Code and License Vote up 6 votes
private void populateLocSites(LocSiteVoCollection locationSites, TreeNode orgNode)
{
	if (locationSites == null)
		return;
	
	TreeNode locNode = null;
	for(int i=0; i < locationSites.size(); i++)
	{
		LocSiteVo voLoc = locationSites.get(i);	
		if (voLoc.getIsActive().booleanValue() == false && !showInactive)
			continue;
		
		Image img = voLoc.getIsActive().booleanValue() ? locSiteImg : locSiteDisImg;		
		
		//WDEV-6444 - if node is inactive disable drag dropping for that node
		if(voLoc.getIsActive().booleanValue() == false)
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName());
		else
			locNode = orgNode.getNodes().add(voLoc, voLoc.getName(), LS_NODE, ORG_NODE, true);
		
		locNode.setCollapsedImage(img);
		locNode.setExpandedImage(img);
		locNode.setCheckBoxVisible(showCheckBoxes);
		populateLocations(voLoc.getLocations().sort(), locNode);
	}		
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
/**
 * Function used to populate a Patient ICP record to tree (with stages & phases)
 * This will only populate stages and phases that are out of scope - as these are the only stages and phases retrieved from domain
 * Currently only stages and phases that are out of scope have check-boxes - if this changes be sure to update logic around this
 */
private void populateTree(PatientICP_DisplayVo patientICP)
{
	// Clear tree
	form.treItems().clear();
	
	// Check for values to populate
	if (patientICP == null)
		return;
	
	// Add ICP Node
	TreeNode nodeICP = form.treItems().getNodes().add(patientICP, patientICP.getICP().getName());
	// Do not show a check-box for ICP node
	nodeICP.setCheckBoxVisible(false);
	// Add stages to patient ICP Node
	populateStagesToPatientICPNode(nodeICP, patientICP.getStages().sort(new StageComparator()));
	
	// Expand root node
	nodeICP.setExpanded(true);
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
/**
 *	Function used to populate a stage phases to a Stage Node
 *	Currently only stages and phases that are out of scope have check-boxes - if this changes be sure to update logic around this
 */
private boolean populatePhasesToStageNode(TreeNode stageNode, PatientICPPhase_DisplayVoCollection phases)
{
	// If the phases collection is null then move on to next phase
	if (phases == null)
		return false;
	
	boolean stageHasLinkedActions = false;
	
	// Iterate phases
	for (PatientICPPhase_DisplayVo phase : phases)
	{
		// Add each phase to tree
		TreeNode phaseNode = stageNode.getNodes().add(phase, phase.getPhase().getName());
		
		// On current logic a displayed phase will always have NOT IN SCOPE status
		// Set it as selectable only if it has actions
		phaseNode.setCheckBoxVisible(Boolean.TRUE.equals(phase.getHasActions()));
		
		// If any phase has linked actions -> stage has linked actions
		stageHasLinkedActions = Boolean.TRUE.equals(phase.getHasActions()) || stageHasLinkedActions; 
	}
	
	return stageHasLinkedActions;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 9
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
/**
 *	Function used to populate nodes with ICP Action
 */
private boolean populateICPAction(ICPAction_StatusChangeVo action, TreeNode phaseNode)
{
	// Check action parameter
	if (action == null)
		return false;
	
	// Create node for action
	TreeNode actionNode = phaseNode.getNodes().add((ICPActionRefVo) action, action.getName());
	
	// Set node attributes
	actionNode.setCollapsedImage(form.getImages().ICP.Action);
	actionNode.setExpandedImage(form.getImages().ICP.Action);
	actionNode.setSelectedImage(form.getImages().ICP.Action);
	
	actionNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(action.getStatus()) ? Color.Gray : Color.Black);
	
	actionNode.setCheckBoxVisible(false);
	
	// Set node value (ICPActionRef) & node identifier
	actionNode.setValue((ICPActionRefVo) action);
	actionNode.setIdentifier(action);
	
	return PreActiveActiveInactiveStatus.ACTIVE.equals(action.getStatus());
}
 
Example 10
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 11
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private TreeNode addChildNode(ContactTypesByDisciplineItemVo vo, ContactTypesByDisciplineItemRefVoCollection voColl) 
{
	boolean bTick = false;
	if (voColl != null)
	{
		for (int i = 0 ;i < voColl.size() ; i++)
		{
			if (vo.equals(voColl.get(i)))
				bTick = true;
		}
	}
	
	TreeNode childNode = null;
	TreeNode parentNode = null;
	
	if( vo.getActive()
		|| (vo.getActive().equals(Boolean.FALSE)
				&& bTick))
	{
		if (vo.getParentIsNotNull()
			&& form.lyr1().tabPageDetails().treContactTypes().getNodes().getNodeByValue(vo.getParent()) != null)
		{
			childNode = form.lyr1().tabPageDetails().treContactTypes().getNodes().getNodeByValue(vo.getParent()).getNodes().add(vo, vo.getContactType());
			parentNode = form.lyr1().tabPageDetails().treContactTypes().getNodes().getNodeByValue(vo.getParent());
		}
		else
			childNode = form.lyr1().tabPageDetails().treContactTypes().getNodes().add(vo, vo.getContactType());
			
		childNode.setExpanded(true);
		childNode.setChecked(bTick);
		if (parentNode != null)
			parentNode.setCheckBoxVisible(false);
	}

	return childNode;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void populateICPActions(TreeNode phaseNode, ICPActionLiteVoCollection actions, String filterValue)
{
	// Terminate function if action collection is  null
	if (actions == null)
		return;
	
	// Sort actions
	actions.sort(new ActionComparator());
	
	for (int i = 0; i < actions.size(); i++)
	{
		ICPActionLiteVo action = actions.get(i);
		
		if (action == null)
			continue;
		
		if (filterValue != null && action.getNameIsNotNull() && !action.getName().toUpperCase().contains(filterValue.toUpperCase()))
			continue;
		
		// Add action to phase node
		TreeNode actionNode = phaseNode.getNodes().add(action, action.getName());
		actionNode.setCheckBoxVisible(!PreActiveActiveInactiveStatus.INACTIVE.equals(action.getStatus()) && !action.equals(form.getLocalContext().getSelectedICPAction()));
		actionNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(action.getStatus()) ? Color.Gray : Color.Black);
		
		if (form.getGlobalContext().ICP.getLinkedActionsIsNotNull() && form.getGlobalContext().ICP.getLinkedActions().contains(action))
			actionNode.setChecked(true);
		
		// Set node images
		actionNode.setCollapsedImage(form.getImages().ICP.Action);
		actionNode.setExpandedImage(form.getImages().ICP.Action);
		actionNode.setSelectedImage(form.getImages().ICP.Action);
	}
}
 
Example 13
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 14
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
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 15
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void populatePatientICPStage(PatientICPStage_StatusChangeVo stage)
{
	// Check stage parameter
	if (stage == null)
		return;
	
	// Get node from tree
	TreeNode stageNode = form.treICP().getNodeByValue(stage.getStage());
	
	if (stageNode == null)
		throw new CodingRuntimeException("Error");
	
	// Update node identifier
	stageNode.setIdentifier(stage);
	
	
	// Determine if the node should still be selectable
	if (engine.getFormName().equals(form.getForms().ICP.BringStageIntoScope))
	{
		if (ICPStageStatus.OUTSTANDING.equals(stage.getCurrentStatus().getStatus()))
		{
			stageNode.setCheckBoxVisible(false);
		}
	}

	
	// Populate Patient ICP Phases
	for (PatientICPPhase_StatusChangeVo phase : stage.getStagePhases())
	{
		populatePatientICPPhase(phase);
	}
}
 
Example 16
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());
	}
	
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
/**
 * Function used to populate node with ICP Stage 
 */
private void populateICPStage(ICPStage_StatusChangeVo stage)
{
	// Check stage parameter
	if (stage == null)
		return;
	
	// Create node for stage
	TreeNode stageNode = form.treICP().getNodes().add((ICPStageRefVo) stage, stage.getName());
	
	// Set node attributes
	stageNode.setCollapsedImage(form.getImages().ICP.Stage);
	stageNode.setExpandedImage(form.getImages().ICP.Stage);
	stageNode.setSelectedImage(form.getImages().ICP.Stage);
	
	stageNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(stage.getStatus()) ? Color.Gray : Color.Black);

	// Set node value (ICPStageRef) & node identifier
	stageNode.setValue((ICPStageRefVo) stage);
	stageNode.setIdentifier(stage);
	
	
	// Sort stage phase
	stage.getPhases().sort();

	boolean hasActivePhasesWithActiveActions = false;
	
	// Populate ICP Phases for stage
	for (ICPPhase_StatusChangeVo phase : stage.getPhases())
	{
		hasActivePhasesWithActiveActions = populateICPPhase(phase, stageNode) || hasActivePhasesWithActiveActions;
	}
	
	
	// Determine if stage node should be selectable
	boolean isActive = PreActiveActiveInactiveStatus.ACTIVE.equals(stage.getStatus());
	boolean selectStages = engine.getFormName().equals(form.getForms().ICP.BringStageIntoScope);
	
	stageNode.setCheckBoxVisible(selectStages && isActive && hasActivePhasesWithActiveActions);
	stageNode.setExpanded(true); 
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
/**
 *	Function used to populate nodes with ICP Phase 
 */
private boolean populateICPPhase(ICPPhase_StatusChangeVo phase, TreeNode stageNode)
{
	// Check phase parameter
	if (phase == null)
		return false;

	// Create node for phase
	TreeNode phaseNode = stageNode.getNodes().add((ICPPhaseRefVo) phase, phase.getName());
	
	// Set node attributes
	phaseNode.setCollapsedImage(form.getImages().ICP.Phase);
	phaseNode.setExpandedImage(form.getImages().ICP.Phase);
	phaseNode.setSelectedImage(form.getImages().ICP.Phase);
	
	phaseNode.setTextColor(PreActiveActiveInactiveStatus.INACTIVE.equals(phase.getStatus()) ? Color.Gray : Color.Black);
	
	// Set node value (ICPPhaseRef) & node identifier
	phaseNode.setValue((ICPPhaseRefVo) phase);
	phaseNode.setIdentifier(phase);
	
	
	// Sort phase actions
	phase.getActions().sort();
	
	
	boolean hasActiveActions = false;
	
	// Populate ICP Actions for phase
	for (ICPAction_StatusChangeVo action : phase.getActions())
	{
		hasActiveActions = populateICPAction(action, phaseNode) || hasActiveActions;
	}
	
	
	// Determine if the phase can be brought into scope
	boolean isActive = PreActiveActiveInactiveStatus.ACTIVE.equals(phase.getStatus());
	boolean selectPhases = engine.getFormName().equals(form.getForms().ICP.BringPhaseIntoScope);
	
	phaseNode.setCheckBoxVisible(selectPhases && isActive && hasActiveActions);
		
	return isActive && hasActiveActions;
}
 
Example 19
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 20
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);
		}
	}
	
}