本文整理汇总了Java中org.primefaces.model.DefaultTreeNode类的典型用法代码示例。如果您正苦于以下问题:Java DefaultTreeNode类的具体用法?Java DefaultTreeNode怎么用?Java DefaultTreeNode使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultTreeNode类属于org.primefaces.model包,在下文中一共展示了DefaultTreeNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
@PostConstruct
public void init() {
root = new DefaultTreeNode("Root", null);
TreeNode all = new DefaultTreeNode("Car pool", root);
List<String> brands = staticOptions.getBrands();
for (String brand : brands) {
if (brand != null && brand.length() > 0) {
TreeNode b = new DefaultTreeNode(brand, all);
List<String> types = dynamicOptions.getTypesToBrand(brand);
for (String type : types) {
if (type != null && type.length() > 0) {
TreeNode t = new DefaultTreeNode(type, b);
}
}
}
}
}
示例2: loadTree
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
/**
* Load tree structure from entities (need to have parent -> children relationship)
*/
public void loadTree() {
try {
this.root = new DefaultTreeNode();
List<CurriculumVitaeItemType> entitiesWithoutParent = new ArrayList<CurriculumVitaeItemType>();
for (CurriculumVitaeItemType cvit : getRepository().find()) {
if (cvit.getParent() == null) {
entitiesWithoutParent.add(cvit);
}
}
this.buildChildrenNodes(root, entitiesWithoutParent);
}
catch (Exception err) {
this.messageUtil.error(err);
}
}
示例3: recursiveTreeInitialization
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
private void recursiveTreeInitialization(File parentFolder, TreeNode parentNode) {
for (File i : parentFolder.listFiles()) {
TreeNode node = new DefaultTreeNode(new FileNode(i.isDirectory(), i.getName(), getFileSize(i), i), parentNode);
if (i.isDirectory()) {
//recursive call
recursiveTreeInitialization(i, node);
}
}
TreeUtils.sortNode(parentNode, new Comparator<TreeNode>() {
@Override
public int compare(TreeNode o1, TreeNode o2) {
return ((FileNode) o1.getData()).compareTo((FileNode) o2.getData());
}
});
}
示例4: armarRama
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
private TreeNode armarRama(TreeNode padre, List<CuentaContable> datos) {
for (int i = 0; i < datos.size(); i++) {
CuentaContable cuenta = new CuentaContable();
cuenta = datos.get(i);
TreeNode nodo = new DefaultTreeNode(cuenta.getCuenta() + " " + cuenta.getDescripcion(), padre);
CuentaContableDAO cuentaContableDAO = new CuentaContableDAOImplement();
List<CuentaContable> lstHijos = new ArrayList<CuentaContable>();
try {
lstHijos = cuentaContableDAO.listaCuentaContableXPadre(cuenta.getId());
} catch (Exception e) {
e.printStackTrace();
}
if (lstHijos.size() > 0) {
armarRama(nodo, lstHijos);
}
}
return padre;
}
示例5: crearArbolReporteImputacion
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
private TreeNode crearArbolReporteImputacion() {
TreeNode rootX = new DefaultTreeNode(new NuevoArbol("PADRE", 0F, 0F, 0F, 0F), null);
AsientoContableDAO asientoContableDAO = new AsientoContableDAOImplement();
PeriodoContableDAO periodoContableDAO = new PeriodoContableDAOImplement();
CuentaContableDAO cuentaContableDAO = new CuentaContableDAOImplement();
PeriodoContable periodoContable = null;
List<CuentaContable> listaCuentas = new ArrayList<CuentaContable>();
try {
periodoContable = periodoContableDAO.buscarPeriodoXId(asientoContableBean.getPeridoContableID());
List<AsientoContable> listaAsientos = asientoContableDAO
.listaAsientoContableXPeriodo(periodoContable.getFechaInicio(), periodoContable.getFechaFin());
//CAMBIAR POR PLAN DE CUENTA
listaCuentas = cuentaContableDAO.listaCuentaContableXPlnCuenta(1L);
rootX = armarRamaReporte(rootX, listaCuentas, listaAsientos, periodoContable);
} catch (Exception e) {
e.printStackTrace();
}
return rootX;
}
示例6: createTree
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
public void createTree() {
this.dataCenter = this.dataCenterController.getDataCenter();
root = new DefaultTreeNode("Root", null);
if (this.dataCenter != null) {
for (HostMachine hostMachine : this.dataCenter.getHostMachineList()) {
TreeNode nodeHostMachine = new DefaultTreeNode(
new DataForMenuTreeNode(hostMachine.getHasName(),
hostMachine.getUri()), root);
nodeHostMachine.setExpanded(true);
for (VirtualMachine virtualMachine : hostMachine
.getVirtualMachineList()) {
TreeNode nodeVirtualMachine = new DefaultTreeNode(
new DataForMenuTreeNode(
virtualMachine.getHasName(),
virtualMachine.getUri()), nodeHostMachine);
nodeVirtualMachine.setExpanded(true);
}
}
}
}
示例7: createAuthorizationsTree
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
/**
* Cria o model para arvore de permissoes
*/
private void createAuthorizationsTree() {
// instancia o node principal, root
this.treeRoot = new DefaultTreeNode("roles");
// pega todas as authorities da lista de authorities do sistema
final HashMap<String, List<String>> roles = this.authorization.listGroupedAuthorizations();
for (String key : roles.keySet()) {
// criamos o agrupador para a permissao com base na key
final TreeNode rootNode = new DefaultTreeNode(key, this.treeRoot);
// pegamos todas as permissoes vinculadas a key e setamos no root dela
roles.get(key).stream().forEach((authority) -> {
rootNode.getChildren().add(new DefaultTreeNode(authority, rootNode));
});
// setamos tudo no root de todos
this.treeRoot.getChildren().add(rootNode);
}
}
示例8: getMenuTree
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
public static TreeNode getMenuTree() {
TreeNode root = new DefaultTreeNode(new WikiMenuItem(null, null), null);
List<String> categories = WikiUtils.getCategories();
// Logger.getLogger(WikiUtils.class.getName()).log(Level.SEVERE, "DRZEWO MENU");
for(String category : categories) {
// Logger.getLogger(WikiUtils.class.getName()).log(Level.SEVERE, (" " + category));
List<String> pages = WikiUtils.getPages( humanToUrl( category ) );
TreeNode tnCategory = new DefaultTreeNode(new WikiMenuItem( urlToHuman( category ), null), root );
for(String page : pages) {
// Logger.getLogger(WikiUtils.class.getName()).log(Level.SEVERE, (" " + page));
DefaultTreeNode tnPage = new DefaultTreeNode(new WikiMenuItem( urlToHuman( category ), urlToHuman( page ) ), tnCategory);
}
}
return root;
}
示例9: FileSystemController
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
public FileSystemController() {
root = new DefaultTreeNode("Root", null);
TreeNode node0 = new DefaultTreeNode("Folder 0", root);
TreeNode node1 = new DefaultTreeNode("Folder 1", root);
TreeNode node2 = new DefaultTreeNode("Folder 2", root);
TreeNode node00 = new DefaultTreeNode("Folder 0.0", node0);
TreeNode node01 = new DefaultTreeNode("Folder 0.1", node0);
TreeNode node10 = new DefaultTreeNode("Folder 1.0", node1);
new DefaultTreeNode("File 1.1", node1);
new DefaultTreeNode("File 2.0", node2);
new DefaultTreeNode("File 0.0.0", node00);
new DefaultTreeNode("File 0.0.1", node00);
new DefaultTreeNode("File 0.1.0", node01);
new DefaultTreeNode("File 1.0.0", node10);
}
示例10: TreeBean
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
public TreeBean() {
root = new DefaultTreeNode("Root", null);
TreeNode node0 = new DefaultTreeNode("Node 0", root);
TreeNode node1 = new DefaultTreeNode("Node 1", root);
TreeNode node2 = new DefaultTreeNode("Node 2", root);
TreeNode node00 = new DefaultTreeNode("Node 0.0", node0);
TreeNode node01 = new DefaultTreeNode("Node 0.1", node0);
TreeNode node10 = new DefaultTreeNode("Node 1.0", node1);
TreeNode node11 = new DefaultTreeNode("Node 1.1", node1);
TreeNode node000 = new DefaultTreeNode("Node 0.0.0", node00);
TreeNode node001 = new DefaultTreeNode("Node 0.0.1", node00);
TreeNode node010 = new DefaultTreeNode("Node 0.1.0", node01);
TreeNode node100 = new DefaultTreeNode("Node 1.0.0", node10);
root2 = new DefaultTreeNode("Root2", null);
TreeNode item0 = new DefaultTreeNode("Item 0", root2);
TreeNode item1 = new DefaultTreeNode("Item 1", root2);
TreeNode item2 = new DefaultTreeNode("Item 2", root2);
TreeNode item00 = new DefaultTreeNode("Item 0.0", item0);
}
示例11: init
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
@PostConstruct
public void init() {
mailboxes = new DefaultTreeNode("root", null);
TreeNode inbox = new DefaultTreeNode("i","Inbox", mailboxes);
TreeNode sent = new DefaultTreeNode("s", "Sent", mailboxes);
TreeNode trash = new DefaultTreeNode("t", "Trash", mailboxes);
TreeNode junk = new DefaultTreeNode("j", "Junk", mailboxes);
TreeNode gmail = new DefaultTreeNode("Gmail", inbox);
TreeNode hotmail = new DefaultTreeNode("Hotmail", inbox);
mails = new ArrayList<Mail>();
mails.add(new Mail("[email protected]", "Visca el Barca", "BARCAAAAA!!!", new Date()));
mails.add(new Mail("[email protected]", "You've won Lottery", "Send me your credit card info to claim", new Date()));
mails.add(new Mail("[email protected]", "Your email has won", "Send me your credit card info to claim", new Date()));
mails.add(new Mail("primefaces-commits", "[primefaces] r4491 - Layout mailbox sample", "Revision:4490 Author:cagatay.civici" ,new Date()));
}
示例12: getRoot
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
public TreeNode getRoot() {
if (this.root != null) {
return this.root;
}
PortletRequest portletRequest = (PortletRequest) LiferayFacesContext.getCurrentInstance().getExternalContext().getRequest();
ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
Long groupId = themeDisplay.getScopeGroupId();
Long folderId = new Long(0);
TreeNode treeNode = new DefaultTreeNode("root", null);
buildTree(groupId, folderId, treeNode);
this.root = treeNode;
return root;
}
示例13: loadDebitRootCategories
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
private void loadDebitRootCategories() {
if(this.debitRoot == null) {
this.debitRoot = new DefaultTreeNode("root", null);
List<CategoryOperation> rootCategories = categoryOperationBean.findRootCategoriesOperation(TransactionType.DEBIT,
operationFilterMBean.getSelectedYear(),
operationFilterMBean.getSelectedMonth());
for(CategoryOperation rootCategory: rootCategories) {
totalAllocatedBudget = totalAllocatedBudget.add(rootCategory.getAllocatedBudget());
totalBudgetLimit = totalBudgetLimit.add(rootCategory.getBudgetLimit());
totalSpent = totalSpent.add(rootCategory.getTotalOperations());
}
loadCategoriesTree(this.debitRoot, rootCategories);
}
}
示例14: addFullNode
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
private void addFullNode(Structure node_data, TreeNode root,
final List<Integer> selected, Set<Integer> classNodes) {
if(node_data==null)
return;
DefaultTreeNode node = new DefaultTreeNode(node_data.isLeaf()?"leaf":"parent",node_data, root);
node.setExpanded(false);
if(selected.contains(node_data.getId())) {
classNodes.add(node_data.getId());
}
if(!node_data.isLeaf()) {
List<Structure> children = node_data.getChildren();
for(Structure s : children) {
addFullNode(s,node,selected,classNodes);
}
}else{
if(selected.contains(node_data.getId())) {
node.setSelected(true);
}
}
}
示例15: consultar
import org.primefaces.model.DefaultTreeNode; //导入依赖的package包/类
@PostConstruct
public void consultar() {
List<Diretorio> diretorioRaizes = diretoriosService.raizesComNos();
raiz = new DefaultTreeNode("Raiz", null);
adicionarNos(diretorioRaizes, raiz);
}