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

The following are Jave code examples for showing how to use setText() 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 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 2
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();

	}

}
 
Example 3
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 4
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
/**
 * 
 */
private void setBusinessRuleCategoryTree()
{
	// Clear the tree
	form.treRootEntity().getNodes().clear();
	
	// Get business rule categories
	BusinessRuleCategoryCollection ruleCategoryCollection = ims.admin.vo.lookups.LookupHelper.getBusinessRuleCategory(this.domain.getLookupService());
	
	// If the rules categories are missing - interupt
	if (ruleCategoryCollection == null)
		return;
	
	// Set the category nodes
	for (int i = 0; i < ruleCategoryCollection.size(); i++)
	{
		BusinessRuleCategory businessRuleCategory = ruleCategoryCollection.get(i);
		
		if (businessRuleCategory != null && businessRuleCategory.getParent() == null)
		{
			// Set node value
			TreeNode node = form.treRootEntity().getNodes().add(businessRuleCategory, businessRuleCategory.getText());
			node.setIdentifier(new Integer(0));
			node.setText(((BusinessRuleCategory) node.getValue()).getText() + " (" + node.getIdentifier().toString() + ")");
			
			// Add sub categories
			setTreeNodeSubCategories(node, businessRuleCategory);
		}
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
/**
 * 
 * @param nodeByValue
 * @param businessRuleCategory
 */
private void setTreeNodeSubCategories(TreeNode node, BusinessRuleCategory businessRuleCategory)
{
	if (businessRuleCategory == null)
		return;
	
	if (node == null)
		throw new CodingRuntimeException("Major Logical Error - Can not populate a null node in tree business rule category");
	
	// Add business rule childs to tree
	if (businessRuleCategory.getChildInstances() != null)
	{
		for (int i = 0; i < businessRuleCategory.getChildInstances().size(); i++)
		{
			LookupInstVo lookupInstVo = businessRuleCategory.getChildInstances().get(i);
			
			if (lookupInstVo instanceof BusinessRuleCategory)
			{
				// Set node value
				TreeNode childNode = node.getNodes().add((BusinessRuleCategory) lookupInstVo, ((BusinessRuleCategory) lookupInstVo).getText());
				childNode.setIdentifier(new Integer(0));
				childNode.setText(((BusinessRuleCategory) childNode.getValue()).getText() + " (" + childNode.getIdentifier().toString() + ")");
				
				// Add sub categories
				setTreeNodeSubCategories(childNode, (BusinessRuleCategory) lookupInstVo);
			}
		}
	}
	
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 4 votes
/**
 * 
 * @param listRules
 */
private void setRulesList(BusinessRuleVoCollection listRules, Integer categoryID)
{
	// Clear the rule list
	form.dyngrdRules().getRows().clear();
			
	// If the collection is null - interrupt
	if (listRules == null || listRules.size() == 0)
	{	
		engine.showMessage("No rules matching the entered search criteria were found. ");//WDEV-18211 
		return;
	}
	// Iterate through the collection
	for (int i = 0; i < listRules.size(); i++)
	{
		BusinessRuleVo rule = listRules.get(i);
		
		// Add non nulls elements to the grid
		if (rule != null)
		{
			// Increment number on tree business rule category node
			TreeNode node = form.treRootEntity().getNodeByValue(rule.getCategory());
			node.setIdentifier(((Integer) node.getIdentifier()) + 1);
			node.setText(((BusinessRuleCategory) node.getValue()).getText() + " (" + node.getIdentifier().toString() + ")");

			if (categoryID != null)
			{
				if (categoryID.equals(rule.getCategory().getID()))
				{
					setRuleListRow(form.dyngrdRules().getRows().newRow(), rule);
				}
			}
			else
			{
				setRuleListRow(form.dyngrdRules().getRows().newRow(), rule);
			}
		}
	}
			
	form.dyngrdRules().setFooterValue("Total: " + String.valueOf(form.dyngrdRules().getRows().size()));//18211
}