use of org.zkoss.zul.Borderlayout in project adempiere by adempiere.
the class WContext method init.
private void init() {
setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
setBorder("normal");
setClosable(true);
int height = SessionManager.getAppDesktop().getClientInfo().desktopHeight * 85 / 100;
int width = SessionManager.getAppDesktop().getClientInfo().desktopWidth * 50 / 100;
this.setWidth(width + "px");
this.setHeight(height + "px");
this.setContentStyle("overflow: auto");
this.setSizable(true);
this.setMaximizable(true);
this.setTitle(Msg.getMsg(Env.getCtx(), "Context"));
Textbox contextText = new Textbox();
contextText.setMultiline(true);
contextText.setReadonly(true);
contextText.setWidth("100%");
contextText.setHeight("100%");
confirmPanel = new ConfirmPanel(false, false, false, false, false, false);
confirmPanel.addActionListener(Events.ON_CLICK, this);
confirmPanel.setStyle("border-top: 2px groove #444; padding-top: 4px");
Borderlayout mainPanel = new Borderlayout();
//mainPanel.setWidth("100%");
mainPanel.setHeight("100%");
Center center = new Center();
mainPanel.appendChild(center);
center.appendChild(contextText);
South south = new South();
mainPanel.appendChild(south);
south.appendChild(confirmPanel);
this.appendChild(mainPanel);
// Get the context
String[] contextArray = Env.getEntireContext(Env.getCtx());
Arrays.sort(contextArray);
contextText.setText("");
// Need a specific format to add the eol character.
// Otherwise, could use Arrays.toString(contextArray)
StringBuffer sb = new StringBuffer("");
if (contextArray.length > 0) {
String eol = System.getProperty("line.separator");
for (int i = 0; i < contextArray.length; i++) {
sb.append(contextArray[i] + eol);
}
}
contextText.setText(sb.toString());
}
use of org.zkoss.zul.Borderlayout in project adempiere by adempiere.
the class ZkReportViewer method init.
private void init() {
Borderlayout layout = new Borderlayout();
layout.setStyle("position: absolute; height: 99%; width: 99%");
this.appendChild(layout);
this.setStyle("width: 100%; height: 100%; position: absolute");
toolBar.setHeight("26px");
previewType.setMold("select");
previewType.appendItem("PDF", "PDF");
previewType.appendItem("HTML", "HTML");
previewType.appendItem("Excel", "XLS");
toolBar.appendChild(previewType);
previewType.addEventListener(Events.ON_SELECT, this);
toolBar.appendChild(new Separator("vertical"));
//set default type
String type = m_reportEngine.getPrintFormat().isForm() ? MSysConfig.getValue("ZK_REPORT_FORM_OUTPUT_TYPE") : MSysConfig.getValue("ZK_REPORT_TABLE_OUTPUT_TYPE");
if ("PDF".equals(type))
previewType.setSelectedIndex(0);
else if ("HTML".equals(type))
previewType.setSelectedIndex(1);
else if ("XLS".equals(type))
previewType.setSelectedIndex(2);
else
//fallback to PDF
previewType.setSelectedIndex(0);
labelDrill.setValue(Msg.getMsg(Env.getCtx(), "Drill") + ": ");
toolBar.appendChild(labelDrill);
comboDrill.setMold("select");
comboDrill.setTooltiptext(Msg.getMsg(Env.getCtx(), "Drill"));
toolBar.appendChild(comboDrill);
toolBar.appendChild(new Separator("vertical"));
comboReport.setMold("select");
comboReport.setTooltiptext(Msg.translate(Env.getCtx(), "AD_PrintFormat_ID"));
toolBar.appendChild(comboReport);
// FR [ 237 ]
// toolBar.appendChild(new Separator("vertical"));
comboReportView.setMold("select");
comboReportView.setTooltiptext(Msg.translate(Env.getCtx(), "AD_ReportView_ID"));
toolBar.appendChild(comboReportView);
summary.setText(Msg.getMsg(Env.getCtx(), "Summary"));
toolBar.appendChild(summary);
bCustomize.setImage(ServletFns.resolveThemeURL("~./images/Preference24.png"));
bCustomize.setTooltiptext(Msg.getMsg(Env.getCtx(), "PrintCustomize"));
toolBar.appendChild(bCustomize);
bCustomize.addEventListener(Events.ON_CLICK, this);
bFind.setImage(ServletFns.resolveThemeURL("~./images/Find24.png"));
bFind.setTooltiptext(Msg.getMsg(Env.getCtx(), "Find"));
toolBar.appendChild(bFind);
bFind.addEventListener(Events.ON_CLICK, this);
toolBar.appendChild(new Separator("vertical"));
bSendMail.setImage(ServletFns.resolveThemeURL("~./images/SendMail24.png"));
bSendMail.setTooltiptext(Msg.getMsg(Env.getCtx(), "SendMail"));
toolBar.appendChild(bSendMail);
bSendMail.addEventListener(Events.ON_CLICK, this);
bArchive.setImage(ServletFns.resolveThemeURL("~./images/Archive24.png"));
bArchive.setTooltiptext(Msg.getMsg(Env.getCtx(), "Archive"));
toolBar.appendChild(bArchive);
bArchive.addEventListener(Events.ON_CLICK, this);
if (m_isCanExport) {
bExport.setImage(ServletFns.resolveThemeURL("~./images/ExportX24.png"));
bExport.setTooltiptext(Msg.getMsg(Env.getCtx(), "Export"));
toolBar.appendChild(bExport);
bExport.addEventListener(Events.ON_CLICK, this);
}
toolBar.appendChild(new Separator("vertical"));
bRefresh.setImage(ServletFns.resolveThemeURL("~./images/Refresh24.png"));
bRefresh.setTooltiptext(Msg.getMsg(Env.getCtx(), "Refresh"));
toolBar.appendChild(bRefresh);
bRefresh.addEventListener(Events.ON_CLICK, this);
North north = new North();
layout.appendChild(north);
north.appendChild(toolBar);
Center center = new Center();
center.setHflex("true");
center.setVflex("true");
layout.appendChild(center);
iframe = new Iframe();
iframe.setId("reportFrame");
iframe.setHeight("100%");
iframe.setWidth("100%");
iframe.addEventListener(Events.ON_CLICK, this);
iframe.addEventListener(Events.ON_RIGHT_CLICK, this);
center.appendChild(iframe);
try {
renderReport();
} catch (Exception e) {
throw new AdempiereException("Failed to render report", e);
}
iframe.setAutohide(true);
this.setBorder("normal");
this.addEventListener("onZoom", new EventListener() {
public void onEvent(Event event) throws Exception {
if (event instanceof ZoomEvent) {
ZoomEvent ze = (ZoomEvent) event;
if (ze.getData() != null && ze.getData() instanceof MQuery) {
AEnv.zoom((MQuery) ze.getData());
}
}
}
});
this.addEventListener(DrillEvent.ON_DRILL_ACROSS, new EventListener() {
public void onEvent(Event event) throws Exception {
if (event instanceof DrillEvent) {
DrillEvent de = (DrillEvent) event;
if (de.getData() != null && de.getData() instanceof MQuery) {
MQuery query = (MQuery) de.getData();
Listitem item = comboDrill.getSelectedItem();
if (item != null && item.getValue() != null && item.toString().trim().length() > 0) {
query.setTableName(item.getValue().toString());
executeDrill(query, event.getTarget());
}
}
}
}
});
this.addEventListener(DrillEvent.ON_DRILL_DOWN, new EventListener() {
public void onEvent(Event event) throws Exception {
if (event instanceof DrillEvent) {
DrillEvent de = (DrillEvent) event;
if (de.getData() != null && de.getData() instanceof MQuery) {
MQuery query = (MQuery) de.getData();
executeDrill(query, event.getTarget());
}
}
}
});
}
use of org.zkoss.zul.Borderlayout in project adempiere by adempiere.
the class WTask method zkInit.
/**
* Static Layout
* @throws Exception
*/
private void zkInit() throws Exception {
Borderlayout layout = new Borderlayout();
layout.setWidth("100%");
layout.setHeight("100%");
layout.setStyle("position: absolute;");
this.setHeight("100%");
this.setWidth("100%");
appendChild(layout);
Center center = new Center();
layout.appendChild(center);
Div div = new Div();
div.setStyle("width: 100%; height:100%; overflow: auto");
div.appendChild(info);
center.appendChild(div);
center.setHflex("true");
center.setVflex("true");
South south = new South();
layout.appendChild(south);
south.setStyle("border: none");
south.appendChild(confirmPanel);
//
confirmPanel.addActionListener(this);
confirmPanel.getOKButton().setEnabled(false);
ThemeUtils.sendDeferLayoutEvent(layout, 100);
}
use of org.zkoss.zul.Borderlayout in project adempiere by adempiere.
the class InfoPanel method init.
protected void init() {
ThemeUtils.addSclass("ad-infopanel", this);
if (isModal()) {
setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
setBorder("normal");
setClosable(true);
setWidth(p_width + "px");
setHeight(p_height + "px");
setContentStyle("overflow: auto");
setSizable(true);
setMaximizable(true);
ThemeUtils.addSclass("ad-infopanel-modal", this);
} else {
setAttribute(Window.MODE_KEY, Window.MODE_EMBEDDED);
// setBorder("none");
// setWidth("100%");
// setHeight("100%");
// setStyle("position: absolute");
ThemeUtils.addSclass("ad-infopanel-embedded", this);
}
// Elaine 2008/12/16
confirmPanel = new ConfirmPanel(true, true, false, true, true, true);
confirmPanel.addActionListener(Events.ON_CLICK, this);
// Elaine 2008/12/16
confirmPanel.getButton(ConfirmPanel.A_CUSTOMIZE).setVisible(hasCustomize());
confirmPanel.getButton(ConfirmPanel.A_HISTORY).setVisible(hasHistory());
confirmPanel.getButton(ConfirmPanel.A_ZOOM).setVisible(hasZoom());
confirmPanel.getButton(ConfirmPanel.A_OK).setVisible(p_saveResults);
checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setTooltip(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
checkAutoQuery.setName("AutoQuery");
checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
checkAutoQuery.setAttribute("zk_component_ID", "Lookup_Confirm_checkAutoQuery");
checkAutoQuery.addActionListener(this);
confirmPanel.getButton(ConfirmPanel.A_REFRESH).getParent().insertBefore(checkAutoQuery, confirmPanel.getButton(ConfirmPanel.A_REFRESH));
confirmPanel.getButton(ConfirmPanel.A_REFRESH).getParent().insertBefore(new Separator("vertical"), confirmPanel.getButton(ConfirmPanel.A_REFRESH));
//
statusBar.setEastVisibility(false);
statusBar.setAttribute("zk_component_ID", "info_statusBar");
//
p_southLayout.setVflex("min");
Center center = new Center();
center.appendChild(confirmPanel);
p_southLayout.appendChild(center);
South south = new South();
south.appendChild(statusBar);
p_southLayout.appendChild(south);
//
// Reset button
bReset = confirmPanel.createButton(ConfirmPanel.A_RESET);
bReset.addActionListener(this);
lblReset = new Label();
lblReset.setValue(Util.cleanAmp(Msg.translate(Env.getCtx(), "Reset")));
p_table.setOddRowSclass(null);
p_table.setAttribute("zk_component_ID", "Lookup_Data_SearchResults");
p_table.setVflex(true);
// Sizes
p_centerNorth.setVflex("min");
p_centerCenter.setVflex("1");
p_centerSouth.setHeight("25%");
//
ThemeUtils.addSclass("info-panel-center", p_centerLayout);
// May be empty
p_centerLayout.appendChild(p_centerNorth);
// the table
p_centerLayout.appendChild(p_centerCenter);
// detail tabs or other
p_centerLayout.appendChild(p_centerSouth);
//
// Need to use a container for p_table so we can insert paging if required.
Div div = new Div();
div.appendChild(p_table);
div.setVflex("1");
div.setHflex("1");
p_centerCenter.appendChild(div);
p_centerCenter.setAutoscroll(false);
p_centerCenter.setHflex("1");
//
p_centerSouth.setCollapsible(true);
p_centerSouth.setSplittable(true);
p_centerSouth.setHflex("1");
// Setup the north reset button and criteria grid
West spWest = new West();
spWest.setHflex("min");
ThemeUtils.addSclass("criteria", spWest);
Center spCenter = new Center();
//spCenter.setWidth("100%");
spCenter.setHflex("1");
spCenter.setVflex("min");
ThemeUtils.addSclass("criteria", spCenter);
p_northLayout.setHflex("min");
p_northLayout.setVflex("min");
p_northLayout.appendChild(spWest);
p_northLayout.appendChild(spCenter);
// spWest - the reset button
Grid bGrid = GridFactory.newGridLayout();
bGrid.setSizedByContent(true);
Columns bColumns = new Columns();
Column col = new Column();
col.setHflex("min");
bColumns.appendChild(col);
bGrid.appendChild(bColumns);
Rows bRows = new Rows();
Row bRow = new Row();
bGrid.appendChild(bRows);
bRows.appendChild(bRow);
bRow.appendChild(bReset);
bRow = new Row();
bRows.appendChild(bRow);
bRow.appendChild(lblReset);
spWest.appendChild(bGrid);
// The criteria table
//p_criteriaGrid.setSizedByContent(true);
spCenter.appendChild(p_criteriaGrid);
Borderlayout mainPanel = new Borderlayout();
mainPanel.setWidth("100%");
mainPanel.setHeight("100%");
//
North north = new North();
mainPanel.appendChild(north);
north.appendChild(p_northLayout);
//
center = new Center();
mainPanel.appendChild(center);
center.appendChild(p_centerLayout);
//
south = new South();
mainPanel.appendChild(south);
south.appendChild(p_southLayout);
//
if (!isModal()) {
mainPanel.setStyle("position: absolute");
}
this.appendChild(mainPanel);
this.addEventListener(Events.ON_OK, this);
this.setVisible(true);
}
use of org.zkoss.zul.Borderlayout in project adempiere by adempiere.
the class InfoPAttributeInstancePanel method jbInit.
/**
* Static Init
* @throws Exception
*/
private void jbInit() throws Exception {
showAll.setText(Msg.getMsg(Env.getCtx(), "ShowAll"));
showAll.addActionListener(this);
showAll.setAttribute("zk_component_ID", "Lookup_Criteria_showAll");
m_table.setAttribute("zk_component_ID", "Lookup_Data_ASIResults");
Borderlayout borderlayout = new Borderlayout();
//
//this.doModal();
setAttribute(Window.MODE_MODAL, Boolean.TRUE);
//setAttribute(Window.MODE_KEY, Window.MODE_MODAL);
setBorder("normal");
setClosable(true);
this.setContentStyle("overflow: auto");
this.setSizable(true);
this.setMaximizable(true);
//
// As a modal window, the panel can't extend past the parent
this.setWidth("100%");
this.setHeight("100%");
this.setMaximized(true);
//
borderlayout.setWidth("100%");
borderlayout.setHeight("100%");
borderlayout.setStyle("border: none; position: relative");
this.appendChild(borderlayout);
North north = new North();
borderlayout.appendChild(north);
Div div = new Div();
div.setAlign("right");
div.appendChild(showAll);
north.appendChild(div);
Center center = new Center();
center.setAutoscroll(true);
center.setHflex("true");
center.setVflex("true");
borderlayout.appendChild(center);
center.appendChild(m_table);
South south = new South();
borderlayout.appendChild(south);
south.appendChild(confirmPanel);
// ConfirmPanel
confirmPanel.addActionListener(this);
}
Aggregations