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.

This commit is contained in:
Heng Sin Low 2012-04-18 13:38:55 +08:00
parent 8e22037ae1
commit 40c38aa163
2 changed files with 2 additions and 64 deletions

View File

@ -17,8 +17,6 @@
package org.adempiere.webui.component;
import org.zkoss.zk.ui.Component;
/**
*
* @author <a href="mailto:agramdass@gmail.com">Ashley G Ramdass</a>
@ -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() {
@ -50,30 +41,4 @@ public class Grid extends org.zkoss.zul.Grid
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);
}
}

View File

@ -17,10 +17,6 @@
package org.adempiere.webui.component;
import java.util.List;
import org.zkoss.zk.ui.Component;
/**
*
* @author <a href="mailto:agramdass@gmail.com">Ashley G Ramdass</a>
@ -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;
}
}