From 40c38aa163f962ef17e95964c0341e951f13f8a3 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 18 Apr 2012 13:38:55 +0800 Subject: [PATCH] remove zk3 no-strip approach that's no longer working. now just set odd row sclass to a dummy value instead to disable the strip effect. --- .../org/adempiere/webui/component/Grid.java | 39 +------------------ .../org/adempiere/webui/component/Rows.java | 27 ------------- 2 files changed, 2 insertions(+), 64 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Grid.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Grid.java index dad420f52e..ee68edc70f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Grid.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Grid.java @@ -17,8 +17,6 @@ package org.adempiere.webui.component; -import org.zkoss.zk.ui.Component; - /** * * @author Ashley G Ramdass @@ -28,20 +26,13 @@ import org.zkoss.zk.ui.Component; public class Grid extends org.zkoss.zul.Grid { private static final long serialVersionUID = -4483759833677794926L; - private boolean noStrip = false; - private String oddRowSclass; public Grid() { super(); - //cache default - oddRowSclass = super.getOddRowSclass(); - super.setOddRowSclass(oddRowSclass); } public void makeNoStrip() { - setStyle("border: none"); - setOddRowSclass(null); - noStrip = true; + setOddRowSclass("dummy"); } public Rows newRows() { @@ -49,31 +40,5 @@ public class Grid extends org.zkoss.zul.Grid appendChild(rows); return rows; - } - - public boolean insertBefore(Component child, Component refChild) { - boolean b = super.insertBefore(child, refChild); - if (b && child instanceof Rows && noStrip) { - Rows rows = (Rows) child; - rows.setNoStrip(true); - } - return b; - } - - @Override - public String getOddRowSclass() { - if (oddRowSclass == null) - return null; - else - return super.getOddRowSclass(); - } - - @Override - public void setOddRowSclass(String scls) { - if (scls != null && scls.length() == 0) - oddRowSclass = null; - else - oddRowSclass = scls; - super.setOddRowSclass(scls); - } + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Rows.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Rows.java index 5bcabad895..52960a647f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Rows.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/Rows.java @@ -17,10 +17,6 @@ package org.adempiere.webui.component; -import java.util.List; - -import org.zkoss.zk.ui.Component; - /** * * @author Ashley G Ramdass @@ -33,33 +29,10 @@ public class Rows extends org.zkoss.zul.Rows * */ private static final long serialVersionUID = 5100123951371296683L; - private boolean noStrip = false; public Row newRow() { Row row = new Row(); appendChild(row); return row; } - - public void setNoStrip(boolean b) { - noStrip = b; - String style = noStrip ? "border: none" : null; - List list = getChildren(); - for (Object o : list) { - if (o instanceof Row) { - Row row = (Row) o; - row.setStyle(style); - } - } - } - - @Override - public boolean insertBefore(Component child, Component refChild) { - boolean b = super.insertBefore(child, refChild); - if (b && child instanceof Row && noStrip) { - Row row = (Row) child; - row.setStyle("border: none"); - } - return b; - } }