use of org.zkoss.zul.Hbox in project adempiere by adempiere.
the class ProcessPanel method initComponents.
/**
* Initialize components
*/
@Override
public void initComponents() {
m_separators = new ArrayList<Label>();
rows = new Rows();
//
mainPanel = new Panel();
parameterPanel = GridFactory.newGridLayout();
parameterPanel.setInnerWidth(width);
//setup columns
Columns columns = new Columns();
parameterPanel.appendChild(columns);
int colN = getColumns() * 2;
if (colN != 0) {
int percent = 100 / colN;
for (int i = 0; i < colN; i++) {
Column col = new Column();
col.setWidth((i == 0 ? ((int) percent / 2) : percent) + "%");
columns.appendChild(col);
}
}
// Add Rows
parameterPanel.appendChild(rows);
//
mainLayout = new Borderlayout();
mainLayout.setStyle("border: none; overflow: auto");
// Message Panel
if (isShowDescription()) {
messageDiv = new Div();
message = new Html();
messageDiv.appendChild(message);
messageDiv.setStyle(MESSAGE_DIV_STYLE);
messagePanel = new North();
messagePanel.appendChild(messageDiv);
messagePanel.setAutoscroll(true);
messagePanel.setStyle("border: none;");
mainLayout.appendChild(messagePanel);
}
// Parameter Panel
centerPanel = new Center();
mainLayout.appendChild(centerPanel);
centerPanel.appendChild(parameterPanel);
centerPanel.setFlex(false);
centerPanel.setStyle("border: none");
// Buttons Panel
if (isShowButtons()) {
Grid southRowPanel = GridFactory.newGridLayout();
Rows rows = southRowPanel.newRows();
Row row = rows.newRow();
Hbox hBox = new Hbox();
hBox.appendChild(lSaved);
fSavedName.addEventListener(Events.ON_CHANGE, this);
hBox.appendChild(fSavedName);
bSave.setEnabled(false);
bSave.setImage("/images/Save24.png");
bSave.setSclass("action-button");
bSave.addActionListener(this);
hBox.appendChild(bSave);
bDelete.setEnabled(false);
bDelete.setImage("/images/Delete24.png");
bDelete.setSclass("action-button");
bDelete.addActionListener(this);
hBox.appendChild(bDelete);
row.appendChild(hBox);
Panel confParaPanel = new Panel();
confParaPanel.setAlign("right");
// BR [ 300 ]
try {
// Set Ok
WAppsAction action = new WAppsAction(ConfirmPanel.A_OK, null, ConfirmPanel.A_OK);
bOK = action.getButton();
// Set to Cancel
action = new WAppsAction(ConfirmPanel.A_CANCEL, null, ConfirmPanel.A_CANCEL);
bCancel = action.getButton();
// Add Listener
bOK.addEventListener(Events.ON_CLICK, this);
bCancel.addEventListener(Events.ON_CLICK, this);
// Add to Panel
confParaPanel.appendChild(bCancel);
confParaPanel.appendChild(bOK);
} catch (Exception e) {
log.severe("Error loading Buttons " + e.getLocalizedMessage());
}
//
row.appendChild(confParaPanel);
South south = new South();
south.appendChild(southRowPanel);
// Add to Main panel
mainLayout.appendChild(south);
}
// Set Text
if (isShowDescription()) {
message.setContent(getTextMsg());
}
//
mainPanel.appendChild(mainLayout);
mainPanel.setHeight("100%");
mainPanel.setWidth("100%");
}
use of org.zkoss.zul.Hbox in project adempiere by adempiere.
the class WBOMDrop method addDisplay.
// addBOMLine
/**
* Add Line to Display
* @param parentM_Product_ID parent product
* @param M_Product_ID product
* @param bomType bom type
* @param name name
* @param lineQty qty
*/
private void addDisplay(int parentM_Product_ID, int M_Product_ID, String bomType, String name, BigDecimal lineQty) {
log.fine("M_Product_ID=" + M_Product_ID + ",Type=" + bomType + ",Name=" + name + ",Qty=" + lineQty);
boolean selected = true;
Hbox boxQty = new Hbox();
boxQty.setWidth("100%");
boxQty.setWidths("10%, 40%, 50%");
if (MProductBOM.BOMTYPE_StandardPart.equals(bomType)) {
String title = "";
Checkbox cb = new Checkbox();
cb.setLabel(title);
cb.setChecked(true);
cb.setEnabled(false);
m_selectionList.add(cb);
boxQty.appendChild(cb);
} else if (MProductBOM.BOMTYPE_OptionalPart.equals(bomType)) {
String title = Msg.getMsg(Env.getCtx(), "Optional");
Checkbox cb = new Checkbox();
cb.setLabel(title);
cb.setChecked(false);
selected = false;
cb.addEventListener(Events.ON_CHECK, this);
m_selectionList.add(cb);
boxQty.appendChild(cb);
} else // Alternative
{
String title = Msg.getMsg(Env.getCtx(), "Alternative") + " " + bomType;
Radio b = new Radio();
b.setLabel(title);
String groupName = String.valueOf(parentM_Product_ID) + "_" + bomType;
Radiogroup group = m_buttonGroups.get(groupName);
if (group == null) {
log.fine("ButtonGroup=" + groupName);
group = new Radiogroup();
m_buttonGroups.put(groupName, group);
group.appendChild(b);
// select first one
b.setSelected(true);
} else {
group.appendChild(b);
b.setSelected(false);
selected = false;
}
b.addEventListener(Events.ON_CLICK, this);
m_selectionList.add(b);
boxQty.appendChild(b);
}
// Add to List & display
m_productList.add(new Integer(M_Product_ID));
Decimalbox qty = new Decimalbox();
qty.setValue(lineQty);
qty.setReadonly(!selected);
m_qtyList.add(qty);
Label label = new Label(name);
HtmlBasedComponent c = (HtmlBasedComponent) label.rightAlign();
c.setStyle(c.getStyle() + ";margin-right: 5px");
boxQty.appendChild(c);
boxQty.appendChild(qty);
grpSelectProd.appendChild(boxQty);
}
use of org.zkoss.zul.Hbox in project adempiere by adempiere.
the class UserPanel method init.
private void init() {
// vbox
this.setSclass("user-panel");
this.setAlign("right");
// Top row
lblUserNameValue.setValue(getUserName() + "@" + getClientName() + "." + getOrgName() + "/" + getRoleName());
lblUserNameValue.setId("loginUserAndRole");
ThemeUtils.addSclass("user-panel-username", lblUserNameValue);
this.appendChild(lblUserNameValue);
Hbox hbox = new Hbox();
ThemeUtils.addSclass("user-panel-buttons", hbox);
this.appendChild(hbox);
hbox.setPack("end");
hbox.setVflex("1");
// TODO - make configurable
context.setLabel(Msg.getMsg(Env.getCtx(), "Context"));
context.setId("context");
context.addEventListener(Events.ON_CLICK, this);
ThemeUtils.addSclass("link", context);
context.setParent(hbox);
Separator sep = new Separator("vertical");
sep.setBar(true);
sep.setParent(hbox);
preference.setLabel(Msg.getMsg(Env.getCtx(), "Preference"));
preference.setId("preference");
preference.addEventListener(Events.ON_CLICK, this);
ThemeUtils.addSclass("link", preference);
preference.setParent(hbox);
sep = new Separator("vertical");
sep.setBar(true);
sep.setParent(hbox);
role.setLabel(this.getRoleName());
role.setId("role");
role.addEventListener(Events.ON_CLICK, this);
ThemeUtils.addSclass("link", role);
role.setParent(hbox);
sep = new Separator("vertical");
sep.setBar(true);
sep.setParent(hbox);
logout.setLabel(Msg.getMsg(Env.getCtx(), "Logout"));
logout.setId("logout");
logout.addEventListener(Events.ON_CLICK, this);
ThemeUtils.addSclass("link", logout);
logout.setParent(hbox);
}
Aggregations