use of org.zkoss.zhtml.Td in project adempiere by adempiere.
the class POSNumberBox method init.
private void init() {
Table grid = new Table();
appendChild(grid);
grid.setStyle("border: none; padding: 0px; margin: 0px;" + HEIGHT + WIDTH + FONT_SIZE);
grid.setDynamicProperty("border", "0");
grid.setDynamicProperty("cellpadding", "0");
grid.setDynamicProperty("cellspacing", "0");
Tr tr = new Tr();
grid.appendChild(tr);
tr.setStyle("border: none; padding: 0px; margin: 0px; white-space:nowrap; ");
Td td = new Td();
tr.appendChild(td);
td.setStyle("border: none; padding: 0px; margin: 0px;");
decimalBox = new Decimalbox();
if (integral) {
decimalBox.setScale(0);
decimalBox.setStyle("display: inline;width:85x;" + HEIGHT + FONT_SIZE);
} else
decimalBox.setStyle("display: inline;text-align:right;width:80px;" + HEIGHT + FONT_SIZE);
td.appendChild(decimalBox);
Td btnColumn = new Td();
tr.appendChild(btnColumn);
btnColumn.setStyle("border: none; padding: 0px; margin: 0px;" + HEIGHT);
btnColumn.setSclass("editor-button");
btn = new Button();
btn.setImage("/images/Calculator10.png");
btn.setTabindex(-1);
LayoutUtils.addSclass("editor-button", btn);
btnColumn.appendChild(btn);
popup = getCalculatorPopup();
LayoutUtils.addSclass("editor-button", btn);
btn.setPopup(popup);
btn.setStyle("text-align: center; height:35px;");
appendChild(popup);
String style = AEnv.isFirefox2() ? "display: inline" : "display: inline-block";
style = style + ";white-space:nowrap";
this.setStyle(style);
}
use of org.zkoss.zhtml.Td in project adempiere by adempiere.
the class WGraph method renderTable.
private void renderTable(Component parent) {
Div div = new Div();
appendChild(div);
div.setSclass("pa-content");
parent.appendChild(div);
Table table = new Table();
table.setSclass("pa-dataGrid");
div.appendChild(table);
Tr tr = new Tr();
table.appendChild(tr);
Td td = new Td();
td.setSclass("pa-label");
tr.appendChild(td);
Text text = new Text("Target");
td.appendChild(text);
td = new Td();
td.setDynamicProperty("colspan", "2");
td.setSclass("pa-tdcontent");
tr.appendChild(td);
text = new Text(builder.getMGoal().getMeasureTarget().setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
td.appendChild(text);
tr = new Tr();
table.appendChild(tr);
td = new Td();
td.setSclass("pa-label");
tr.appendChild(td);
text = new Text("Actual");
td.appendChild(text);
td = new Td();
td.setDynamicProperty("colspan", "2");
td.setSclass("pa-tdcontent");
tr.appendChild(td);
text = new Text(builder.getMGoal().getMeasureActual().setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
td.appendChild(text);
GraphColumn[] bList = getGraphColumnList();
tr = new Tr();
table.appendChild(tr);
td = new Td();
tr.appendChild(td);
td.setDynamicProperty("rowspan", bList.length);
td.setSclass("pa-label");
td.setDynamicProperty("valign", "top");
text = new Text(builder.getMGoal().getXAxisText());
td.appendChild(text);
for (int k = 0; k < bList.length; k++) {
GraphColumn bgc = bList[k];
if (k > 0) {
tr = new Tr();
table.appendChild(tr);
}
td = new Td();
td.setSclass("pa-tdlabel");
tr.appendChild(td);
text = new Text(bgc.getLabel());
td.appendChild(text);
td = new Td();
td.setSclass("pa-tdvalue");
tr.appendChild(td);
BigDecimal value = new BigDecimal(bgc.getValue());
if (bgc.getMQuery(builder.getMGoal()) != null) {
A a = new A();
a.setSclass("pa-hrefNode");
td.appendChild(a);
a.setId(ZOOM_KEY + k);
a.addEventListener(Events.ON_CLICK, new EventListener() {
public void onEvent(Event event) throws Exception {
Component comp = event.getTarget();
String id = comp.getId();
if (id.startsWith(ZOOM_KEY)) {
String ss = id.substring(ZOOM_KEY.length());
int index = Integer.parseInt(String.valueOf(ss));
GraphColumn[] colList = getGraphColumnList();
if ((index >= 0) && (index < colList.length))
AEnv.zoom(colList[index].getMQuery(builder.getMGoal()));
}
}
});
a.setDynamicProperty("href", "javascript:;");
text = new Text(value.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
a.appendChild(text);
} else {
text = new Text(value.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString());
}
}
tr = new Tr();
table.appendChild(tr);
td = new Td();
td.setDynamicProperty("colspan", "3");
tr.appendChild(td);
text = new Text(builder.getMGoal().getDescription());
td.appendChild(text);
Br br = new Br();
td.appendChild(br);
text = new Text(stripHtml(builder.getMGoal().getColorSchema().getDescription(), true));
td.appendChild(text);
}
use of org.zkoss.zhtml.Td in project adempiere by adempiere.
the class HeaderPanel method init.
private void init() {
ThemeUtils.addSclass("ad-headerpanel", this);
// Keep this simple for speed
// Create a simple table to hold the header elements.
Tr tr = new Tr();
ThemeUtils.addSclass("ad-headerpanel-row", tr);
Td tdLeft = new Td();
ThemeUtils.addSclass("ad-headerpanel-left", tdLeft);
Td tdRight = new Td();
ThemeUtils.addSclass("ad-headerpanel-right", tdRight);
this.appendChild(tr);
tr.appendChild(tdLeft);
tr.appendChild(tdRight);
image.setSrc(ThemeUtils.getSmallLogo());
image.addEventListener(Events.ON_CLICK, this);
ThemeUtils.addSclass("ad-headerpanel-logo", image);
image.setParent(tdLeft);
UserPanel userPanel = new UserPanel();
userPanel.setParent(tdRight);
}
Aggregations