From 5e1637dbff7552252409d5c5ae3d5bed58433377 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 7 Aug 2013 21:14:06 +0800 Subject: [PATCH] IDEMPIERE-1199 No color on trees. Base on patch from Nicolas Micoud. --- .../org/adempiere/webui/component/SimpleTreeModel.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleTreeModel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleTreeModel.java index fcf0857c53..6c27f640fe 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleTreeModel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/SimpleTreeModel.java @@ -12,6 +12,7 @@ *****************************************************************************/ package org.adempiere.webui.component; +import java.awt.Color; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; @@ -156,6 +157,15 @@ public class SimpleTreeModel extends org.zkoss.zul.DefaultTreeModel impl tr.setDroppable("true"); tr.addEventListener(Events.ON_DROP, this); } + + // Color + final MTreeNode mNode = (MTreeNode) ((DefaultTreeNode) node).getData(); + Color color = mNode.getColor(); + if (color != null){ + String hex = ZkCssHelper.createHexColorString(color); + ZkCssHelper.appendStyle(tc, "color: #" + hex); + } + // End color }else{ tr = ti.getTreerow(); tr.getChildren().clear();