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

The following are Jave code examples for showing how to use setCollapsedImage() 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 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 Vote up 6 votes
private void addUrl(TreeNode parentNode, AppTopButtonVo value, boolean autoSelect) 
{
	if(parentNode != null && value != null)
	{
		String nodeText = value.getText();
		if(nodeText == null)
			nodeText = " ";
		
		TreeNode node = parentNode.getNodes().add(value, nodeText, autoSelect, BUTTON_DRAGDROP_TYPE, new int[] { BUTTONS_DRAGDROP_TYPE, SECTION_DRAGDROP_TYPE });
		
		node.setSelectedImage(form.getImages().Core.Web);
		node.setCollapsedImage(form.getImages().Core.Web);
		node.setExpandedImage(form.getImages().Core.Web);
		node.setTooltip(value.getURL());	
	}
}
 
Example 3
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 4
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 5
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void populatePricing(TreeNode rootNode, ActivityContextPricingDetailsVoCollection voCollActivityContextPricing)
{
	voCollActivityContextPricing.sort();

	if (rootNode.getNodes().size() > 0)
		rootNode.getNodes().clear();

	setHospitalSpecialtyProcedure();

	TreeNode pricingNode;
	for (int j = 0; j < voCollActivityContextPricing.size(); j++)
	{
		if ((voCollActivityContextPricing.get(j).getIsActiveIsNotNull() && voCollActivityContextPricing.get(j).getIsActive().booleanValue() && voCollActivityContextPricing.get(j).getEffectiveTo() == null && form.lyr1().Edit().lyrLocationDetail().tabPagePricing().chkActivePricing().getValue()) || form.lyr1().Edit().lyrLocationDetail().tabPagePricing().chkActivePricing().getValue() == false)
		{
			StringBuffer sb = createPricingString(voCollActivityContextPricing.get(j));
			pricingNode = rootNode.getNodes().add(voCollActivityContextPricing.get(j), sb.toString());
			pricingNode.setCollapsedImage(voCollActivityContextPricing.get(j).getCurrency().getImage() == null ? form.getImages().Core.help1 : voCollActivityContextPricing.get(j).getCurrency().getImage());
			pricingNode.setExpandedImage(voCollActivityContextPricing.get(j).getCurrency().getImage() == null ? form.getImages().Core.help1 : voCollActivityContextPricing.get(j).getCurrency().getImage());
			if (voCollActivityContextPricing.get(j).getEffectiveToIsNotNull())
				pricingNode.setTextColor(Color.Gray);

			pricingNode.setTooltip(createPricingTooltip(voCollActivityContextPricing.get(j)));
		}
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private MyOrderComponentVo addComponentToTree(TreeNode node, SelectedComponentFromSelectOrderVo component, Image image)
{
	node.setTooltip(escapeAmpersandInTooltip(component.getTooltip()));
	node.setCollapsedImage(image);

	MyOrderComponentVo orderComponent = new MyOrderComponentVo();
	orderComponent.setID(component.getID());
	orderComponent.setComponentType(component.getComponentType());
	orderComponent.setText(component.getText());
	orderComponent.setCategory(component.getCategory());
	orderComponent.setTooltip(escapeAmpersandInTooltip(component.getTooltip()));
	orderComponent.setParentInvestigationId(component.getParentInvestigationId());
	orderComponent.setIsAddon(component.getIsAddon());
	orderComponent.setRequiresSite(component.getRequiresSite());
	orderComponent.setServiceID(component.getServiceID());
	orderComponent.setMinReOrderPeriod(component.getMinReOrderPeriod());
	orderComponent.setMinReOrderVal(component.getMinReOrderVal());
	orderComponent.setMinReOrderFemalePeriod(component.getMinReOrderFemalePeriod());
	orderComponent.setMinReOrderFemaleVal(component.getMinReOrderFemaleVal());
	orderComponent.setPhlebMayCollect(component.getPhlebMayCollect());
	orderComponent.setGenderSpecific(component.getGenderSpecific());
	orderComponent.setReOrderReason(component.getReOrderReason());//WDEV-16624

	return orderComponent;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void fillLookupHierarchy(TreeNode rootNode, LookupInstVo inst, int nodeType, boolean isHierarchical)
{
	int instNodeType = form.treTypes().getNodes().size() + 1;
	ArrayList children = inst.getChildInstances();
	for (int i = 0; i < children.size(); i++)
	{
		LookupInstVo child = (LookupInstVo) children.get(i);
		if (child.isActive() == false && form.chkActiveOnly().getValue() == true)
			continue;
		TreeNode newNode = null;
		if (inst.getId() < 0 || !isHierarchical)
		{
			newNode = rootNode.getNodes().add(child, getDisplayString(child), instNodeType, true);
		}
		else
		{
			newNode = rootNode.getNodes().add(child, getDisplayString(child), instNodeType, new int[]{nodeType,instNodeType}, true);
		}				 
		Image img = getCorrectImage(child);
		newNode.setExpandedImage(img);
		newNode.setCollapsedImage(img);
		newNode.setSelectedImage(img);
		fillLookupHierarchy(newNode, child, nodeType, isHierarchical);
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 9
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void open()
{
	loadActiveOrderEntryTemplates();

	if (engine.hasRight(AppRight.OCS_ALLOW_INV_SEARCH))
	{
		TreeNode searchNode = form.treDetails().getNodes().add(searchNodeValue, "Search");
		searchNode.setCollapsedImage(form.getImages().Core.FindEnabled16);
		searchNode.setExpandedImage(form.getImages().Core.FindEnabled16);
	}

	TreeNode previewNode = form.treDetails().getNodes().add(previewNodeValue, "My Order Preview");
	previewNode.setCollapsedImage(form.getImages().OCRR.MyOrderPreview);
	previewNode.setExpandedImage(form.getImages().OCRR.MyOrderPreview);

	form.treDetails().setValue(searchNodeValue);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void populateTreeAction(TreeNode node, ICPActionLiteVoCollection actionCollection)
{
	// Clear nodes
	node.getNodes().clear();
	
	// Terminate function if collection is null
	if (actionCollection == null)
		return;
	
	// Sort action collection after sequence
	actionCollection.sort(new ActionComparator());
	
	// Iterate action collection
	for (int i = 0; i < actionCollection.size(); i++)
	{
		ICPActionLiteVo action = actionCollection.get(i);
	
		// Skip null actions
		if (action == null)
			continue;
	
		// Add action node to ICP
		TreeNode actionNode = node.getNodes().add(action, action.getName() + " (" + action.getID_ICPAction().toString() + ")");
	
		// Set node images, gray text for inactive ones
		actionNode.setCollapsedImage(form.getImages().ICP.Action);
		actionNode.setExpandedImage(form.getImages().ICP.Action);
		
		if (PreActiveActiveInactiveStatus.INACTIVE.equals(action.getStatus()))
		{
			actionNode.setTextColor(Color.Gray);
		}
	}
}
 
Example 11
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 12
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 13
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void addPredefinedButton(TreeNode parentNode, AppTopButtonVo value, boolean autoSelect) 
{
	if(parentNode != null && value != null)
	{
		String nodeText = value.getText();
		if(nodeText == null)
			nodeText = " ";
		
		TreeNode node = parentNode.getNodes().add(value, nodeText, autoSelect, BUTTON_DRAGDROP_TYPE, new int[] { BUTTONS_DRAGDROP_TYPE, SECTION_DRAGDROP_TYPE });
		
		node.setSelectedImage(form.getImages().Core.HelpButton);
		node.setCollapsedImage(form.getImages().Core.HelpButton);
		node.setExpandedImage(form.getImages().Core.HelpButton);
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void setNodeImage(LookupInstVo children, TreeNode newNode) 
{
	if(newNode == null || children == null)
		return;
	
	Image img = getCorrectImage(children);
	newNode.setExpandedImage(img);
	newNode.setCollapsedImage(img);
	newNode.setSelectedImage(img);
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private TreeNode findOrCreateMenuActionFormNode(AppFormVo appForm)
{
	TreeNode formNode = null;
	
	for(int x = 0; x < form.lyrRights().tabActionsDenied().treActions().getNodes().size(); x++)
	{
		if(appForm.equals(form.lyrRights().tabActionsDenied().treActions().getNodes().get(x).getValue()))
		{
			formNode = form.lyrRights().tabActionsDenied().treActions().getNodes().get(x);
			break;
		}
	}
	
	if(formNode == null)
	{
		String formName = appForm.getName();
		if(appForm.isAlias())
			formName += " (" + appForm.getAliasName() + ")";
		if(appForm.isDialog())
			formName += " - dialog";
		
		formNode = form.lyrRights().tabActionsDenied().treActions().getNodes().add(appForm, formName);
		formNode.setCollapsedImage(form.getImages().Core.Form);
		formNode.setExpandedImage(form.getImages().Core.Form);
	}
	
	return formNode;
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
@Override
protected void onTreFavouritesTreeViewNodeDropped(TreeNode node, TreeNode previousParentNode) throws PresentationLogicException
{
	if (form.getMode().equals(FormMode.VIEW))
		form.setMode(FormMode.EDIT);

	TreeNode parent = node.getParent();
	if (parent != null)
	{
		parent.setCollapsedImage(form.getImages().Core.CollapseAll);
		parent.setExpandedImage(form.getImages().Core.ExpandAll);
	}
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
/**
 * Function used to populate ICP Phase Node with ICP Actions
 * 
 * @param node
 * @param listActions
 */
private void populateTreeICPActionNodes(TreeNode node, ICPActionLiteVoCollection listActions)
{
	// Clear node
	node.getNodes().clear();

	// Set node as expanded
	node.setIdentifier(EXPANDED);

	// Check actions list - exit the function if it is null or zero length
	if (listActions == null || listActions.size() == 0)
		return;

	// Sort ICP Action list by sequence
	listActions.sort(new ActionComparator());

	// Iterate ICP Actions list
	for (ICPActionLiteVo icpAction : listActions)
	{
		// Skip null ICP Actions
		if (icpAction == null)
			continue;
		
		// Build ICP Action text
		StringBuilder nodeText = new StringBuilder();
		
		// Add ICP Action name
		nodeText.append(icpAction.getName());
		// Add ICP Action disciplines
		if (icpAction.getDisciplineIsNotNull())
		{
			nodeText.append(" (");
			
			// Add the name of each discipline 
			for (int i = 0; i < icpAction.getDiscipline().size(); i++)
			{
				HcpDisType discipline = icpAction.getDiscipline().get(i);
				
				// Skip null disciplines
				if (discipline == null)
					continue;
				
				nodeText.append(discipline.getText());
				
				if (i < icpAction.getDiscipline().size() - 1)
					nodeText.append(", ");
			}
			
			nodeText.append(")");
		}

		// Add ICP Action to ICP Phase node
		TreeNode actionNode = node.getNodes().add(icpAction, nodeText.toString());

		// Set node image, gray text to inactive actions
		actionNode.setCollapsedImage(form.getImages().ICP.Action);
		actionNode.setExpandedImage(form.getImages().ICP.Action);

		if (PreActiveActiveInactiveStatus.INACTIVE.equals(icpAction.getStatus()))
		{
			actionNode.setTextColor(Color.Gray);
		}
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
private void addRootRow(FlagCategoryVo cat) 
{
	TreeNode node = form.treFlags().getNodes().add(cat, cat.getName());		
	node.setExpandedImage(form.getImages().Core.OpenFolder);
	node.setCollapsedImage(form.getImages().Core.ClosedFolder);		
}
 
Example 19
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");
	}
}
 
Example 20
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;
}