diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/CWindowToolbar.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/CWindowToolbar.java index b27365fb50..b21732de97 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/CWindowToolbar.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/CWindowToolbar.java @@ -80,8 +80,16 @@ public class CWindowToolbar extends FToolbar implements EventListener private Map keyMap = new HashMap(); - public CWindowToolbar() + private boolean embedded; + + public CWindowToolbar() { + this(false); + } + + public CWindowToolbar(boolean embedded) + { + this.embedded = embedded; init(); } @@ -89,36 +97,36 @@ public class CWindowToolbar extends FToolbar implements EventListener { LayoutUtils.addSclass("adwindow-toolbar", this); - btnIgnore = createButton("Ignore", "Ignore24.png", "Ignore"); + btnIgnore = createButton("Ignore", "Ignore", "Ignore"); addSeparator(); - btnHelp = createButton("Help", "Help24.png","Help"); - btnNew = createButton("New", "New24.png", "New"); - btnCopy = createButton("Copy", "Copy24.png", "Copy"); - btnDelete = createButton("Delete", "Delete24.png", "Delete"); - btnSave = createButton("Save", "Save24.png", "Save"); + btnHelp = createButton("Help", "Help","Help"); + btnNew = createButton("New", "New", "New"); + btnCopy = createButton("Copy", "Copy", "Copy"); + btnDelete = createButton("Delete", "Delete", "Delete"); + btnSave = createButton("Save", "Save", "Save"); addSeparator(); - btnRefresh = createButton("Refresh", "Refresh24.png", "Refresh"); - btnFind = createButton("Find", "Find24.png", "Find"); - btnAttachment = createButton("Attachment", "Attachment24.png", "Attachment"); - btnGridToggle = createButton("Toggle", "Multi24.png", "Multi"); + btnRefresh = createButton("Refresh", "Refresh", "Refresh"); + btnFind = createButton("Find", "Find", "Find"); + btnAttachment = createButton("Attachment", "Attachment", "Attachment"); + btnGridToggle = createButton("Toggle", "Multi", "Multi"); addSeparator(); - btnHistoryRecords = createButton("HistoryRecords", "HistoryX24.png", "History"); - btnParentRecord = createButton("ParentRecord", "Parent24.png", "Parent"); - btnDetailRecord = createButton("DetailRecord", "Detail24.png", "Detail"); + btnHistoryRecords = createButton("HistoryRecords", "HistoryX", "History"); + btnParentRecord = createButton("ParentRecord", "Parent", "Parent"); + btnDetailRecord = createButton("DetailRecord", "Detail", "Detail"); addSeparator(); - btnFirst = createButton("First", "First24.png", "First"); - btnPrevious = createButton("Previous", "Previous24.png", "Previous"); - btnNext = createButton("Next", "Next24.png", "Next"); - btnLast = createButton("Last", "Last24.png", "Last"); + btnFirst = createButton("First", "First", "First"); + btnPrevious = createButton("Previous", "Previous", "Previous"); + btnNext = createButton("Next", "Next", "Next"); + btnLast = createButton("Last", "Last", "Last"); addSeparator(); - btnReport = createButton("Report", "Report24.png", "Report"); - btnArchive = createButton("Archive", "Archive24.png", "Archive"); - btnPrint = createButton("Print", "Print24.png", "Print"); + btnReport = createButton("Report", "Report", "Report"); + btnArchive = createButton("Archive", "Archive", "Archive"); + btnPrint = createButton("Print", "Print", "Print"); addSeparator(); - btnZoomAcross = createButton("ZoomAcross", "ZoomAcross24.png", "ZoomAcross"); - btnActiveWorkflows = createButton("ActiveWorkflows", "WorkFlow24.png", "WorkFlow"); - btnRequests = createButton("Requests", "Request24.png", "Request"); - btnProductInfo = createButton("ProductInfo", "Product24.png", "InfoProduct"); + btnZoomAcross = createButton("ZoomAcross", "ZoomAcross", "ZoomAcross"); + btnActiveWorkflows = createButton("ActiveWorkflows", "WorkFlow", "WorkFlow"); + btnRequests = createButton("Requests", "Request", "Request"); + btnProductInfo = createButton("ProductInfo", "Product", "InfoProduct"); for (Object obj : this.getChildren()) { @@ -146,27 +154,33 @@ public class CWindowToolbar extends FToolbar implements EventListener btnArchive.setDisabled(false); // Elaine 2008/07/28 configureKeyMap(); + + if (embedded) + { + btnParentRecord.setVisible(false); + btnDetailRecord.setVisible(false); + btnActiveWorkflows.setVisible(false); + btnHistoryRecords.setVisible(false); + btnProductInfo.setVisible(false); + setAlign("end"); + setWidth("100%"); + setStyle("background: transparent none"); + } + else + { + setWidth("100%"); + } } - /** - * set embedded mode on/off, embedded panel toolbar should show less button - * @param embedded - */ - public void setEmbedded(boolean embedded) - { - btnParentRecord.setVisible(!embedded); - btnDetailRecord.setVisible(!embedded); - btnActiveWorkflows.setVisible(!embedded); - btnHistoryRecords.setVisible(!embedded); - btnProductInfo.setVisible(!embedded); - } private ToolBarButton createButton(String name, String image, String tooltip) { ToolBarButton btn = new ToolBarButton(""); btn.setName("btn"+name); - btn.setImage("/images/"+image); + btn.setImage("/images/"+image + (embedded ? "16.png" : "24.png")); btn.setTooltiptext(Msg.getMsg(Env.getCtx(),tooltip)); + if (embedded) + btn.setStyle("background: transparent none"); buttons.put(name, btn); this.appendChild(btn); return btn; diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java index d56f21b0b6..3e07a711cb 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java @@ -125,7 +125,7 @@ public class GridPanel extends Borderlayout implements EventListener * Update listbox index to sync with grid current row pointer changes */ public void updateListIndex() { - int rowIndex = gridTab.getCurrentRow(); + int rowIndex = gridTab.isOpen() ? gridTab.getCurrentRow() : -1; if (pageSize > 0) { if (paging.getTotalSize() != gridTab.getRowCount()) paging.setTotalSize(gridTab.getRowCount()); diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java index 9984d225b9..b9e050c576 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADTabpanel.java @@ -73,6 +73,7 @@ import org.zkoss.zkex.zul.West; import org.zkoss.zul.Div; import org.zkoss.zul.Group; import org.zkoss.zul.Groupfoot; +import org.zkoss.zul.Hbox; import org.zkoss.zul.Separator; import org.zkoss.zul.SimpleTreeNode; import org.zkoss.zul.Space; @@ -276,6 +277,7 @@ DataStatusListener, IADTabpanel rows.appendChild(row); row = new Group(); + row.setSpans("2,3"); rows.appendChild(row); includedTab .put(field.getIncluded_Tab_ID(), (Group)row); row = new Row(); @@ -927,7 +929,15 @@ DataStatusListener, IADTabpanel grid.getRows().insertBefore(row, next); panel.createPart(row); panel.getComponent().setWidth("99%"); - group.setLabel(gridWindow.getTab(tabIndex).getName()); + + Label title = new Label(gridWindow.getTab(tabIndex).getName()); + group.appendChild(title); + group.appendChild(panel.getToolbar()); + panel.getStatusBar().setZclass("z-group-foot"); + if (!group.isOpen()) { + panel.getToolbar().setVisible(false); + } + panel.initPanel(-1, null); if (active) activateChild(true, ep); diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADWindowPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADWindowPanel.java index 5c335368bb..3ae22bab68 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADWindowPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/ADWindowPanel.java @@ -92,17 +92,20 @@ public class ADWindowPanel extends AbstractADWindowPanel layout.setPage(page); } - North n = new North(); - n.setParent(layout); - n.setCollapsible(false); - n.setHeight("30px"); - toolbar.setHeight("30px"); - toolbar.setParent(n); + if (!isEmbedded()) + { + North n = new North(); + n.setParent(layout); + n.setCollapsible(false); + n.setHeight("30px"); + toolbar.setHeight("30px"); + toolbar.setParent(n); + } South s = new South(); layout.appendChild(s); s.setCollapsible(false); - statusBar.setParent(s); + statusBar.setParent(s); LayoutUtils.addSclass("adwindow-status", statusBar); if (!isEmbedded() && adTab.isUseExternalSelection()) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java index 0bca546d4a..1ff8463432 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/panel/AbstractADWindowPanel.java @@ -183,10 +183,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To private void initComponents() { /** Initalise toolbar */ - toolbar = new CWindowToolbar(); + toolbar = new CWindowToolbar(isEmbedded()); toolbar.addListener(this); - toolbar.setWidth("100%"); - toolbar.setEmbedded(isEmbedded()); statusBar = new StatusBarPanel(); }