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

The following are Jave code examples for showing how to use getValue() 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 deactivateInstance()
{
	TreeNode node = form.treTypes().getSelectedNode();
	if (node == null || !(node.getValue() instanceof LookupInstVo))
		return;

	LookupTypeVo type = form.getLocalContext().getLookupType();
	if (type == null)
	{
		engine.showMessage("Can't find Lookup Type for the instance being changed");
		return;
	}
	try
	{
		domain.deactivateInstance(type, form.getLocalContext().getLookupInstance());
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
	}
	this.onBtnSearchClick();
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 3
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void saveOrder()
{
	LookupInstanceCollection instColl = new LookupInstanceCollection();
	TreeNode rootNode = getRootNode();

	if (rootNode == null)
		return;

	LookupTypeVo type = (LookupTypeVo) rootNode.getValue();
	TreeNodeCollection coll = rootNode.getNodes();
	if (coll == null)
		return;
	
	addToOrderedColl(coll, instColl);		
	try
	{
		domain.saveInstanceOrder(type, instColl);
	}
	catch (StaleObjectException ex)
	{
		engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
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 5
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 6
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void enableFavouritesContextMenu(boolean isChecked, boolean isTabFavourite)
{
	if (getCurrentHcpId() == null)
	{
		form.getContextMenus().hideAllFavouritesMenuItems();
	}
	else
	{
		form.getContextMenus().getFavouritesAddNewFolderItem().setVisible(isTabFavourite);
		form.getContextMenus().getFavouritesAddItem().setVisible(isChecked && !isTabFavourite);

		TreeNode node = form.lyr1().tabFavourites().treFavourites().getSelectedNode();

		boolean isNodeRemovable = node != null && node.getNodes().size() == 0;
		boolean isFolderNodeEditable = node != null && node.getValue() == null;
		form.getContextMenus().getFavouritesRemoveFolderItem().setVisible(isTabFavourite && isNodeRemovable);
		form.getContextMenus().getFavouritesEditFolderItem().setVisible(isTabFavourite && isFolderNodeEditable);
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void removeOtherClassification()
{
	TreeNode selectedNode = form.lyrConfig().tabTGroup().lyrGroupDetails().tabClassification().treOtherClassification().getSelectedNode();

	for (int i = 0; form.getLocalContext().getOtherClassificationSavedCollectionIsNotNull() && i < form.getLocalContext().getOtherClassificationSavedCollection().size(); i++)
	{
		TumourGroupClassificationVo voClass = form.getLocalContext().getOtherClassificationSavedCollection().get(i);

		if (voClass.getID_TumourGroupClassificationIsNotNull() // Is a saved record
				&& selectedNode.getValue() != null // Is a saved record in the tree too
				&& voClass.getID_TumourGroupClassification().equals(((TumourGroupClassificationVo) selectedNode.getValue()).getID_TumourGroupClassification()))// Same record
		{
			voClass.setIsActive(false);

			form.getLocalContext().getOtherClassificationSavedCollection().set(i, voClass);
		}
	}

	form.lyrConfig().tabTGroup().lyrGroupDetails().tabClassification().treOtherClassification().getNodes().remove(selectedNode);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void removeSpecialty()
{
	TreeNode selectedNode = form.lyrConfig().tabSpecialties().treSpecialty().getSelectedNode();

	for (int i = 0; form.getLocalContext().getSpecialtiesSavedCollectionIsNotNull() && i < form.getLocalContext().getSpecialtiesSavedCollection().size(); i++)
	{
		TumourGroupSpecialtyVo voSpec = form.getLocalContext().getSpecialtiesSavedCollection().get(i);

		if (voSpec.getID_TumourGroupSpecialtyIsNotNull() // Is a saved record
				&& selectedNode.getValue() != null // Is a saved record in the tree too
				&& voSpec.getID_TumourGroupSpecialty().equals(((TumourGroupSpecialtyVo) selectedNode.getValue()).getID_TumourGroupSpecialty()))// Same record
		{
			voSpec.setIsActive(false);

			form.getLocalContext().getSpecialtiesSavedCollection().set(i, voSpec);
		}
	}

	form.lyrConfig().tabSpecialties().treSpecialty().getNodes().remove(selectedNode);

}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private void enableFavouritesContextMenu(boolean isChecked, boolean isTabFavourite)
{
	if(getCurrentHcpId() == null)
	{
		form.getContextMenus().hideAllFavouritesMenuItems();
	}
	else
	{
		form.getContextMenus().getFavouritesAddNewFolderItem().setVisible(isTabFavourite);
		form.getContextMenus().getFavouritesAddItem().setVisible(isChecked && !isTabFavourite);
		TreeNode node = form.lyrTabs().tabPageFavourites().treFavourites().getSelectedNode();
		boolean isNodeRemovable = node != null && node.getNodes().size() == 0;
		boolean isFolderNodeEditable = node != null && node.getValue() == null;
		form.getContextMenus().getFavouritesRemoveFolderItem().setVisible(isTabFavourite && isNodeRemovable);
		form.getContextMenus().getFavouritesEditFolderItem().setVisible(isTabFavourite && isFolderNodeEditable);
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 6 votes
private String getFavouriteFolderName()
{
	String name = "Favourite";
	int newIndex = 0;
	for (int i = 0; i < form.lyrTabs().tabPageFavourites().treFavourites().getNodes().size(); i++)
	{
		TreeNode node = form.lyrTabs().tabPageFavourites().treFavourites().getNodes().get(i);
		if(node.getValue() == null && node.getText() != null)
		{
			int textLength = node.getText().length();
			if(textLength > 0)
			{
				char chIndex = node.getText().charAt(textLength - 1);
				if(Character.isDigit(chIndex))
				{
					int currentIndex = Integer.valueOf(Character.toString(chIndex)).intValue();
					if(currentIndex > newIndex)
						newIndex = currentIndex;
				}
			}
		}
	}		
	name = name + (newIndex + 1);
	return name;
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private boolean removeUnusedParentNodes(TreeNode node, ContactTypesByDisciplineVo voDisp)
{
	if (node.getNodes().size() > 0 )
	{
		for (int i = 0 ; i < node.getNodes().size() ; i++)
		{
			if(removeUnusedParentNodes(node.getNodes().get(i),voDisp)) // If true decrement counter 
				i--;
		}
	}

	boolean bRemoved = false;
	if (!node.isChecked())
	{
		if (node.getNodes().size() == 0)
		{
			boolean bIsAConfiguredParentNode = false;
			
			for (int i = 0 ; i < voDisp.getContactTypes().size() ; i++)
			{
				if (node.getValue() instanceof ContactTypesByDisciplineItemVo
					&& ((ContactTypesByDisciplineItemVo)node.getValue()).equals(voDisp.getContactTypes().get(i).getParent()))
					bIsAConfiguredParentNode = true;
			}
			
			if (bIsAConfiguredParentNode) 
			{
				form.lyr1().tabPageDetails().treContactTypes().getNodes().remove(node);
				bRemoved = true;
			}
		}
	}
	
	return bRemoved;
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
protected void onTreInvApptsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
	form.getContextMenus().RefMan.getBookAppointmentREBOOK_APPTItem().setVisible(false);
	if(form.getMode().equals(FormMode.VIEW))
	{
		if(node != null)
		{
			if(node.getValue() instanceof BookingAppointmentLiteVo &&  node.getParent().equals(form.treInvAppts().getNodeByValue(REBOOK_APPT_NODE)))
				form.getContextMenus().RefMan.getBookAppointmentREBOOK_APPTItem().setVisible(true);
		}			
	}
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private TreeNode getPreviewNode()
{
	for (int x = 0; x < form.treDetails().getNodes().size(); x++)
	{
		TreeNode analyzedNode = form.treDetails().getNodes().get(x);
		if (analyzedNode.getValue() != null && analyzedNode.getValue().equals(this.previewNodeValue))
			return analyzedNode;
	}
	
	return null;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void processNodeRename(TreeNode node)
{
	if(node != null)
	{
		String nodeText = node.getText();
		
		Object value = node.getValue();
		if(value != null)
		{
			if(value instanceof AppTopButtonSectionVo)
			{
				if(nodeText == null || nodeText.length() == 0)
					nodeText = " ";
				((AppTopButtonSectionVo)value).setText(nodeText);
			}				
			else if(value instanceof AppTopButtonVo)
			{
				if(nodeText == null || nodeText.length() == 0)
				{
					nodeText = "Untitled";
					node.setText(nodeText);						
				}
				
				((AppTopButtonVo)value).setText(nodeText);					
			}
		}
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void setSelectedNodeData(LocSvcProviderSysVo voLocSvcProviderSys)
{
	TreeNode node = form.treHeader().getSelectedNode();
	if (voLocSvcProviderSys != null && node != null)
	{
		Object value = node.getValue();
		if (value instanceof LocSvcProviderSysVo)
		{
			node.setValue(voLocSvcProviderSys);
			node.setText(getProviderSystemName(voLocSvcProviderSys));
		}
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void treeCategoryGroupSiteSelectionChanged(TreeNode node) 
{
	if (node == null)
		return;
	
	if (node.getValue() instanceof TumourCategoryListVo)
	{
		node.getNodes().clear();
		populateVersions(domain.listVersions((TumourCategoryRefVo) node.getValue()), node);
		node.setExpanded(true);
	}
	else if (node.getValue() instanceof TumourCategoryVersionGroupsLiteVo)
	{
		node.getParent().setExpanded(true);
		node.getNodes().clear();
		populateGroups(domain.listGroups((TumourCategoryVersionGroupsRefVo) node.getValue()), node);
		node.setExpanded(true);
	}
	
	else if (node.getValue() instanceof TumourGroupListVo)
	{
		node.getParent().setExpanded(true);
		node.getNodes().clear();
		populateSites(domain.listSites((TumourGroupRefVo)node.getValue()), node);
		node.setExpanded(true);
	}
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private void addToOrderedColl(TreeNodeCollection nodes, LookupInstanceCollection instColl)
{
	if (nodes == null) return;
	for (int i = 0; i < nodes.size(); i++)
	{
		TreeNode node = nodes.get(i);
		LookupInstVo val = (LookupInstVo) node.getValue();			
		if (val != null)
			instColl.add(val);
		addToOrderedColl(node.getNodes(), instColl);
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
protected void onTreInvApptsTreeViewSelectionChanged(TreeNode node)
		throws PresentationLogicException {
	form.getContextMenus().RefMan.getBookAppointmentREBOOK_APPTItem()
			.setVisible(false);
	if (form.getMode().equals(FormMode.VIEW)) {
		if (node != null) {
			removeAllRadiologyServices();
			if (node.getValue() instanceof BookingAppointmentLiteVo
					&& node.getParent().equals(
							form.treInvAppts().getNodeByValue(
									REBOOK_APPT_NODE)))
				form.getContextMenus().RefMan
						.getBookAppointmentREBOOK_APPTItem().setVisible(
								true);
			if (node.getValue() instanceof OrderInvestigationBookingVo) {
				ServiceLiteVo voService = getService(((OrderInvestigationBookingVo) node
						.getValue()));
				if (!form.cmbService().getValues().contains(voService))
					form.cmbService().newRow(voService,
							voService.getServiceName());

				form.cmbService().setValue(voService);
				form.getLocalContext().setisLinkingOrderInv(true);
			}
		}
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private boolean isNodeChecked(TreeNode nodeParent, TreeNode currenNode)
{
	if(currenNode == null || currenNode == null)
		return false;
	
	if(nodeParent.isChecked())
	{
		Object value = nodeParent.getValue();
		if(value != null && !value.equals(currenNode.getValue()))
			return true;
	}
	
	return false;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
@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();

	}

}