<commit_before>package test.beans;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import net.bootsfaces.component.tree.event.TreeNodeCheckedEvent;
import net.bootsfaces.component.tree.event.TreeNodeEventListener;
import net.bootsfaces.component.tree.event.TreeNodeSelectionEvent;
import net.bootsfaces.component.tree.model.DefaultNodeImpl;
import net.bootsfaces.component.tree.model.Node;


@SessionScoped
@ManagedBean(name = "test")
public class TestBean implements TreeNodeEventListener {
	private Node selectedNode;
	private List<Node> checkedNodes = new ArrayList<Node>();
	private String selectedColor;
	
	public TestBean() {

	}
	
	public String getSelectedColor() {
		return selectedColor;
	}

	public void setSelectedColor(String selectedColor) {
		this.selectedColor = selectedColor;
	}

	public String getCheckedColumns() {
		if(checkedNodes != null && checkedNodes.size() > 0){
			StringBuilder sb = new StringBuilder();
			sb.append("CHECKED NODES: ");
			for(Node n: checkedNodes) {
				sb.append(n.getText() + " : ");
			}
			return sb.toString();
		}
		return "NO CHECKED ITEMS";
	}
	public void setCheckedColumns(String column) { }
	
	public List<Node> getJsonModel1() {
		List<Node> nodeList = new ArrayList<Node>();
		nodeList.add(new DefaultNodeImpl("Parent1", "user"));
		nodeList.add(new DefaultNodeImpl("Parent2", "envelope"));
		
		List<Node> subNodes = new ArrayList<Node>();
		subNodes.add(new DefaultNodeImpl("Child1", "user"));
		subNodes.add(new DefaultNodeImpl("Child2", "main"));
		subNodes.add(new DefaultNodeImpl("Child3", "arrow-left"));
		DefaultNodeImpl nx = new DefaultNodeImpl("Child4-Link", "arrow-right");
		nx.setHRef("http://www.google.it");
		subNodes.add(nx);
		
		DefaultNodeImpl child5 = new DefaultNodeImpl("Child5", "arrow-right");
		child5.setColor("#FF0000");
		List<Node> subSubNodes = new ArrayList<Node>();
		subSubNodes.add(new DefaultNodeImpl("GrandChild 1", "play-circle"));
		subSubNodes.add(new DefaultNodeImpl("GrandChild 2", "play-circle"));
		child5.getSubNodes().addAll(subSubNodes);
		subNodes.add(child5);
		
		DefaultNodeImpl parent3 = new DefaultNodeImpl("Parent3", "signal");
		parent3.setExpanded(false);
		parent3.getSubNodes().addAll(subNodes);
		nodeList.add(parent3);
		
		
		return nodeList;
	}
	
	public List<Node> getJsonModel2() {<commit_msg>Fix method getSubNodes() was renamed to getChilds() in DefaultNodeImpl.java<commit_after>package test.beans;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import net.bootsfaces.component.tree.event.TreeNodeCheckedEvent;
import net.bootsfaces.component.tree.event.TreeNodeEventListener;
import net.bootsfaces.component.tree.event.TreeNodeSelectionEvent;
import net.bootsfaces.component.tree.model.DefaultNodeImpl;
import net.bootsfaces.component.tree.model.Node;


@SessionScoped
@ManagedBean(name = "test")
public class TestBean implements TreeNodeEventListener {
	private Node selectedNode;
	private List<Node> checkedNodes = new ArrayList<Node>();
	private String selectedColor;
	
	public TestBean() {

	}
	
	public String getSelectedColor() {
		return selectedColor;
	}

	public void setSelectedColor(String selectedColor) {
		this.selectedColor = selectedColor;
	}

	public String getCheckedColumns() {
		if(checkedNodes != null && checkedNodes.size() > 0){
			StringBuilder sb = new StringBuilder();
			sb.append("CHECKED NODES: ");
			for(Node n: checkedNodes) {
				sb.append(n.getText() + " : ");
			}
			return sb.toString();
		}
		return "NO CHECKED ITEMS";
	}
	public void setCheckedColumns(String column) { }
	
	public List<Node> getJsonModel1() {
		List<Node> nodeList = new ArrayList<Node>();
		nodeList.add(new DefaultNodeImpl("Parent1", "user"));
		nodeList.add(new DefaultNodeImpl("Parent2", "envelope"));
		
		List<Node> subNodes = new ArrayList<Node>();
		subNodes.add(new DefaultNodeImpl("Child1", "user"));
		subNodes.add(new DefaultNodeImpl("Child2", "main"));
		subNodes.add(new DefaultNodeImpl("Child3", "arrow-left"));
		DefaultNodeImpl nx = new DefaultNodeImpl("Child4-Link", "arrow-right");
		nx.setHRef("http://www.google.it");
		subNodes.add(nx);
		
		DefaultNodeImpl child5 = new DefaultNodeImpl("Child5", "arrow-right");
		child5.setColor("#FF0000");
		List<Node> subSubNodes = new ArrayList<Node>();
		subSubNodes.add(new DefaultNodeImpl("GrandChild 1", "play-circle"));
		subSubNodes.add(new DefaultNodeImpl("GrandChild 2", "play-circle"));
		child5.getChilds().addAll(subSubNodes);
		subNodes.add(child5);
		
		DefaultNodeImpl parent3 = new DefaultNodeImpl("Parent3", "signal");
		parent3.setExpanded(false);
		parent3.getChilds().addAll(subNodes);
		nodeList.add(parent3);
		
		
		return nodeList;
	}
	
	public List<Node> getJsonModel2() {
{'fraction_non_alphanumeric': 0.1372993001235076, 'fraction_numerical': 0.01029230135858378, 'mean_word_length': 5.530913978494624, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7234472', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1504, 'n_words': 298}